From 194f79a647466b87d8afa8b43acdab4fb7d509ab Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Sat, 5 Sep 2020 22:06:07 +0200 Subject: Allow customization of the live user's full name --- make_slackware_live.sh | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/make_slackware_live.sh b/make_slackware_live.sh index 0ca3c82..47806a3 100755 --- a/make_slackware_live.sh +++ b/make_slackware_live.sh @@ -83,14 +83,20 @@ THEDATE=$(date +%Y%m%d) # Distribution name: DISTRO=${DISTRO:-"slackware"} +# What type of Live image? +# Choices are: SLACKWARE, XFCE, DAW, PLASMA5, MATE, CINNAMON, DLACK, STUDIOWARE +LIVEDE=${LIVEDE:-"SLACKWARE"} + # The live username of the image: LIVEUID=${LIVEUID:-"live"} # The number of the live account in the image: LIVEUIDNR=${LIVEUIDNR:-"1000"} -# The full name of the live account in the image: -LIVEUIDFN=${LIVEUIDFN:-"${DISTRO^} Live User"} +# The full name of the live account in the image can be set per Live variant, +# and will always be overridden by a LIVEUIDFN definition in the .conf file. +# The LIVEUIDFN defaults to '${DISTRO^} Live User' if not set explicitly: +LIVEUIDFN_DAW=""${DISTRO^} Live Musician" # The root and live user passwords of the image: ROOTPW=${ROOTPW:-"root"} @@ -105,10 +111,6 @@ NVGRPNR=${NVUIDNR:-"365"} # Custom name for the host: LIVE_HOSTNAME=${LIVE_HOSTNAME:-"darkstar"} -# What type of Live image? -# Choices are: SLACKWARE, XFCE, DAW, PLASMA5, MATE, CINNAMON, DLACK, STUDIOWARE -LIVEDE=${LIVEDE:-"SLACKWARE"} - # What runlevel to use if adding a DE like: XFCE, DAW, PLASMA5 etc... RUNLEVEL=${RUNLEVEL:-4} @@ -1475,6 +1477,14 @@ then echo "${NVUID}:$(openssl rand -base64 12)" | chroot ${LIVE_ROOTDIR} /usr/sbin/chpasswd fi +# Determine the full name of the live account in the image: +if [ -z ${LIVEUIDFN} ]; then + eval LIVEUIDFN=\$LIVEUIDFN_${LIVEDE} + if [ -z ${LIVEUIDFN} ]; then + LIVEUIDFN="${DISTRO^} Live User" + fi +fi + # Create a nonprivileged user account (called "live" by default): chroot ${LIVE_ROOTDIR} /usr/sbin/useradd -c "${LIVEUIDFN}" -g users -G wheel,audio,cdrom,floppy,plugdev,video,power,netdev,lp,scanner,kmem,dialout,games,disk,input -u ${LIVEUIDNR} -d /home/${LIVEUID} -m -s /bin/bash ${LIVEUID} echo "${LIVEUID}:${LIVEPW}" | chroot ${LIVE_ROOTDIR} /usr/sbin/chpasswd -- cgit v1.2.3