From 624cf964338b1ec360409d022e85a03424b9516f Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Fri, 7 Apr 2023 16:55:58 -0400 Subject: [PATCH] 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. --- dracut/vmklive/adduser.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dracut/vmklive/adduser.sh b/dracut/vmklive/adduser.sh index a9e6b3e..68d94b2 100644 --- a/dracut/vmklive/adduser.sh +++ b/dracut/vmklive/adduser.sh @@ -2,11 +2,12 @@ # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh -type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh +if ! type getarg >/dev/null 2>&1 && ! type getargbool >/dev/null 2>&1; then + . /lib/dracut-lib.sh +fi echo void-live > ${NEWROOT}/etc/hostname -AUTOLOGIN=$(getarg live.autologin) USERNAME=$(getarg live.user) USERSHELL=$(getarg live.shell) @@ -51,6 +52,6 @@ _EOF chroot ${NEWROOT} chown polkitd:polkitd /etc/polkit-1/rules.d/void-live.rules fi -if [ -n "$AUTOLOGIN" ]; then +if getargbool 0 live.autologin; then sed -i "s,GETTY_ARGS=\"--noclear\",GETTY_ARGS=\"--noclear -a $USERNAME\",g" ${NEWROOT}/etc/sv/agetty-tty1/conf fi