From a30890cffc5fce967396353c8ecaabf871e57ad8 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 2 Dec 2014 19:53:04 +0100 Subject: dracut/adduser: autologin if live.autologin is set in the kernel cmdline. --- dracut/adduser.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'dracut/adduser.sh') 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 -- cgit 1.4.1