From 799434029f1702ad7210fd4183f495049a0fe159 Mon Sep 17 00:00:00 2001 From: r00t Date: Tue, 23 Dec 2014 15:09:57 -0500 Subject: [PATCH] i really hope this works. --- extra/build.conf.sample | 15 +++++++++++++-- lib/mk.chroot.sh | 6 ++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/extra/build.conf.sample b/extra/build.conf.sample index d31d87f..b18fc43 100644 --- a/extra/build.conf.sample +++ b/extra/build.conf.sample @@ -74,7 +74,8 @@ LOGFILE="${BASEDIR}/logs/$(date +%s)" # What should the regular username be? (Automatically logged in on boot) REGUSR="${UXNAME}" -# Should the REGUSR have a password? IF THIS IS NOT SET, THE PASSWORD WILL BE BLANK! +# Should the REGUSR have a password? IF THIS IS NOT SET, PASSWORD LOGIN WILL BE DISABLED! +# If you wish to have a blank password, use the string "{[BLANK]}". # Do NOT use a plaintext password here. You will need to generate a salted and hashed string # in a shadow-compatible format. # Debian can do this with the mkpasswd utility (it's in Arch's AUR as debian-whois-mkpasswd): @@ -88,10 +89,20 @@ REGUSR="${UXNAME}" # /sbin/grub-crypt --sha-512 # The end-product should look something like this: # $6$aBcDeFgHiJ$Yh342vFH7MOjPNu9InFymD1Dd42i5cFsr1cTWdpKGNIkbRGR/ZKQDRPJ1ZeeGb7y894Tfh3iWZIJKu3phlsqQ1 +# +# Note that if you want an automatic login, this is *not* where it would be set. +# It should instead be controlled via overlay/etc/systemd/system/getty@ttyN.service.d/autologin.conf +# In the following format: +# [Service] +# Type=idle +# ExecStart= +# ExecStart=-/usr/bin/agetty --autologin --noclear %I 38400 linux +# (where N is the TTY number). Alternatively, if booting to a GUI, it can be set as according +# to that GUI (e.g. for LXDE, overlay/etc/lxdm/lxdm.conf, "autologin=") REGUSR_PASS="" # Same exact thing as REGUSR_PASS, but for the root password (i.e. if no password hash is -# specified, password login will be disabled). +# specified, password login will be disabled, etc.). ROOT_PASS="" # Do we have enough horsepower on the build system to jack up the resources we throw at building? diff --git a/lib/mk.chroot.sh b/lib/mk.chroot.sh index 736cc21..738018b 100755 --- a/lib/mk.chroot.sh +++ b/lib/mk.chroot.sh @@ -213,12 +213,18 @@ EOF if [ -n "${REGUSR_PASS}" ]; then ${CHROOTCMD} ${i}/ "echo ${REGUSR}:${REGUSR_PASS} | chpasswd -e" >> "${LOGFILE}.${FUNCNAME}" 2>&1 + elif [[ "${REGUSR_PASS}" == '{[BLANK]}' ]]; + then + continue else sed -i -e "s/^${REGUSR}::/${REGUSR}:!:/g" ${i}/etc/shadow fi if [ -n "${ROOT_PASS}" ]; then ${CHROOTCMD} ${i}/ "echo ${root}:${ROOT_PASS} | chpasswd -e" >> "${LOGFILE}.${FUNCNAME}" 2>&1 + elif [[ "${ROOT_PASS}" == '{[BLANK]}' ]]; + then + continue else sed -i -e 's/^root::/root:!:/g' ${i}/etc/shadow fi