i really hope this works.

This commit is contained in:
brent s. 2014-12-23 15:09:57 -05:00
parent f9a3310a0a
commit 799434029f
2 changed files with 19 additions and 2 deletions

View File

@ -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 <USERNAME> --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=<USERNAME>")
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?

View File

@ -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