diff options
author | Juan RP <xtraeme@gmail.com> | 2014-12-02 19:53:04 +0100 |
---|---|---|
committer | Juan RP <xtraeme@gmail.com> | 2014-12-02 19:53:04 +0100 |
commit | a30890cffc5fce967396353c8ecaabf871e57ad8 (patch) | |
tree | aaacf55a5d7e36e4787734b3887f6082e6ecfd6b /dracut | |
parent | c4efb3d95ec69064a0da2c4e3710fa593fd4b88a (diff) | |
download | hrmpf-a30890cffc5fce967396353c8ecaabf871e57ad8.tar.gz hrmpf-a30890cffc5fce967396353c8ecaabf871e57ad8.tar.xz hrmpf-a30890cffc5fce967396353c8ecaabf871e57ad8.zip |
dracut/adduser: autologin if live.autologin is set in the kernel cmdline.
Diffstat (limited to 'dracut')
-rw-r--r-- | dracut/adduser.sh | 6 |
1 files changed, 6 insertions, 0 deletions
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 |