Update alpine-install.func
This commit is contained in:
parent
1773950db3
commit
8de2c8ca88
@ -214,12 +214,21 @@ customize() {
|
|||||||
passwd -d root >/dev/null 2>&1
|
passwd -d root >/dev/null 2>&1
|
||||||
|
|
||||||
# Ensure agetty is available
|
# Ensure agetty is available
|
||||||
apk add --no-cache --force-broken-world util-linux-getty >/dev/null 2>&1
|
apk add --no-cache --force-broken-world util-linux >/dev/null 2>&1
|
||||||
|
|
||||||
# Enable autologin on tty1
|
# Create persistent autologin boot script
|
||||||
sed -i 's|^tty1::respawn:.*|tty1::respawn:/sbin/agetty --autologin root --noclear tty1 38400 linux|' /etc/inittab
|
mkdir -p /etc/local.d
|
||||||
touch /run/openrc/softlevel
|
cat <<'EOF' >/etc/local.d/autologin.start
|
||||||
kill -HUP 1
|
#!/bin/sh
|
||||||
|
sed -i 's|^tty1::respawn:.*|tty1::respawn:/sbin/agetty --autologin root --noclear tty1 38400 linux|' /etc/inittab
|
||||||
|
kill -HUP 1
|
||||||
|
EOF
|
||||||
|
|
||||||
|
chmod +x /etc/local.d/autologin.start
|
||||||
|
rc-update add local >/dev/null 2>&1
|
||||||
|
|
||||||
|
# Apply autologin immediately for current session
|
||||||
|
/etc/local.d/autologin.start
|
||||||
|
|
||||||
msg_ok "Customized Container"
|
msg_ok "Customized Container"
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user