diff --git a/dracut/adduser.sh b/dracut/adduser.sh index 6d0142c..68b6bd4 100644 --- a/dracut/adduser.sh +++ b/dracut/adduser.sh @@ -6,8 +6,10 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh echo void-live > ${NEWROOT}/etc/hostname +AUTOLOGIN=$(getarg live.autologin) USERNAME=$(getarg live.user) USERSHELL=$(getarg live.shell) + [ -z "$USERNAME" ] && USERNAME=anon [ -x $NEWROOT/bin/bash -a -z "$USERSHELL" ] && USERSHELL=/bin/bash [ -z "$USERSHELL" ] && USERSHELL=/bin/sh @@ -48,3 +50,7 @@ polkit.addRule(function(action, subject) { _EOF chroot ${NEWROOT} chown polkitd:polkitd /etc/polkit-1/rules.d/void-live.rules fi + +if [ -n "$AUTOLOGIN" ]; then + sed -i "s,GETTY_ARGS=\"--noclear\",GETTY_ARGS=\"--noclear -a $USERNAME\",g" ${NEWROOT}/etc/sv/agetty-tty1/run +fi