Skip to content

Commit 624cf96

Browse files
committed
dracut/vmklive/adduser.sh: detect live.autologin properly
if just `live.autologin` is added to the KCL, it would not be detected and the user would still need to log into the live image.
1 parent 8a04733 commit 624cf96

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

dracut/vmklive/adduser.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
33
# ex: ts=8 sw=4 sts=4 et filetype=sh
44

5-
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
5+
if ! type getarg >/dev/null 2>&1 && ! type getargbool >/dev/null 2>&1; then
6+
. /lib/dracut-lib.sh
7+
fi
68

79
echo void-live > ${NEWROOT}/etc/hostname
810

9-
AUTOLOGIN=$(getarg live.autologin)
1011
USERNAME=$(getarg live.user)
1112
USERSHELL=$(getarg live.shell)
1213

@@ -51,6 +52,6 @@ _EOF
5152
chroot ${NEWROOT} chown polkitd:polkitd /etc/polkit-1/rules.d/void-live.rules
5253
fi
5354

54-
if [ -n "$AUTOLOGIN" ]; then
55+
if getargbool 0 live.autologin; then
5556
sed -i "s,GETTY_ARGS=\"--noclear\",GETTY_ARGS=\"--noclear -a $USERNAME\",g" ${NEWROOT}/etc/sv/agetty-tty1/conf
5657
fi

0 commit comments

Comments
 (0)