feat(image): add overlay to /etc and use busybox getty for login prompt

This commit is contained in:
Lars Sjöström 2025-02-25 21:54:42 +01:00
parent 3374541b3a
commit 0ed83a6d27
No known key found for this signature in database
2 changed files with 20 additions and 27 deletions

View file

@ -13,6 +13,7 @@ find rootfs/ -type d -exec chmod 755 {} \;
ln -sf multi-user.target rootfs/usr/lib/systemd/system/default.target
# mount patos state
ln -sf ../etc.mount rootfs/usr/lib/systemd/system/local-fs.target.wants/etc.mount
ln -sf ../var.mount rootfs/usr/lib/systemd/system/sysinit.target.wants/var.mount
# enable dbus
@ -25,32 +26,6 @@ ln -sf ../systemd-networkd.service rootfs/usr/lib/systemd/system/sysinit.target.
# generate a temporary machine id
$systemd/usr/bin/systemd-machine-id-setup --root=rootfs/
# FIXME: remove this later (just to get a shell in the initramfs)
cat <<EOF > rootfs/usr/lib/systemd/system/demo.service
[Unit]
Description=Debug Shell (/bin/sulogin)
Conflicts=shutdown.target
Before=shutdown.target
[Service]
Environment=HOME=/root
WorkingDirectory=/root
ExecStart=/bin/sulogin
Type=idle
StandardInput=tty-force
StandardOutput=inherit
StandardError=inherit
KillMode=process
IgnoreSIGPIPE=no
SendSIGHUP=yes
Restart=always
[Install]
WantedBy=multi-user.target
EOF
ln -sf ../demo.service rootfs/usr/lib/systemd/system/multi-user.target.wants/demo.service
$systemd/usr/bin/ukify build \
--linux $kernel/bzImage \
--initrd $initrd/initrd.xz \