From de0a890a454196769954ff36a28357e2c12d1c0a Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Wed, 20 Jul 2016 13:17:57 +0200 Subject: Add variable LIVEUID to define the name of the 'live' user account. In 'make_slackware_live.conf' you can give that variable "LIVEUID" another value than the default "live" if you want to create a Live Edition where the Live user account is not called "live". --- make_slackware_live.conf | 3 +++ make_slackware_live.sh | 30 +++++++++++++++++------------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/make_slackware_live.conf b/make_slackware_live.conf index 3fe172e..53f3834 100644 --- a/make_slackware_live.conf +++ b/make_slackware_live.conf @@ -25,6 +25,9 @@ # What runlevel to use if adding a DE like: XFCE, KDE4, PLASMA5 etc... #RUNLEVEL=4 +# Name of the 'live' user account in the Live image: +#LIVEUID="live" + # Passwords for the user accounts in the Live image: #ROOTPW="root" #LIVEPW="live" diff --git a/make_slackware_live.sh b/make_slackware_live.sh index 1e2ed6a..d0bd5a4 100755 --- a/make_slackware_live.sh +++ b/make_slackware_live.sh @@ -80,6 +80,9 @@ THEDATE=$(date +%Y%m%d) # --------------------------------------------------------------------------- # +# The live username of the image: +LIVEUID=${LIVEUID:-"live"} + # The root and live user passwords of the image: ROOTPW=${ROOTPW:-"root"} LIVEPW=${LIVEPW:-"live"} @@ -1058,13 +1061,13 @@ EOL # Set a root password. echo "root:${ROOTPW}" | chpasswd --root ${LIVE_ROOTDIR} -# Create a nonprivileged user account "live": -chroot ${LIVE_ROOTDIR} /usr/sbin/useradd -c "Slackware Live User" -g users -G wheel,audio,cdrom,floppy,plugdev,video,power,netdev,lp,scanner,kmem,dialout,games,disk -u 1000 -d /home/live -m -s /bin/bash live -echo "live:${LIVEPW}" | chpasswd --root ${LIVE_ROOTDIR} +# Create a nonprivileged user account (called "live" by default): +chroot ${LIVE_ROOTDIR} /usr/sbin/useradd -c "Slackware Live User" -g users -G wheel,audio,cdrom,floppy,plugdev,video,power,netdev,lp,scanner,kmem,dialout,games,disk -u 1000 -d /home/${LIVEUID} -m -s /bin/bash ${LIVEUID} +echo "${LIVEUID}:${LIVEPW}" | chpasswd --root ${LIVE_ROOTDIR} # Configure suauth: cat <${LIVE_ROOTDIR}/etc/suauth -root:live:OWNPASS +root:${LIVEUID}:OWNPASS root:ALL EXCEPT GROUP wheel:DENY EOT chmod 600 ${LIVE_ROOTDIR}/etc/suauth @@ -1248,9 +1251,9 @@ echo "-- Configuring the X base system." sed -i -e '/^c3\|^c4\|^c5\|^c6/s/^/# /' ${LIVE_ROOTDIR}/etc/inittab # Give the 'live' user a face: -cp ${LIVE_TOOLDIR}/blueSW-64px.png ${LIVE_ROOTDIR}/home/live/.face.icon -chown --reference=${LIVE_ROOTDIR}/home/live ${LIVE_ROOTDIR}/home/live/.face.icon -( cd ${LIVE_ROOTDIR}/home/live/ ; ln .face.icon .face ) +cp ${LIVE_TOOLDIR}/blueSW-64px.png ${LIVE_ROOTDIR}/home/${LIVEUID}/.face.icon +chown --reference=${LIVE_ROOTDIR}/home/${LIVEUID} ${LIVE_ROOTDIR}/home/${LIVEUID}/.face.icon +( cd ${LIVE_ROOTDIR}/home/${LIVEUID}/ ; ln .face.icon .face ) mkdir -p ${LIVE_ROOTDIR}/usr/share/apps/kdm/pics/users cp ${LIVE_TOOLDIR}/blueSW-64px.png ${LIVE_ROOTDIR}/usr/share/apps/kdm/pics/users/blues.icon @@ -1264,7 +1267,7 @@ sed -i "s/@LIBDIR@/lib${DIRSUFFIX}/g" ${LIVE_ROOTDIR}/etc/X11/xdm/liveslak-xdm/x # The Xscreensaver should show a blank screen only, to prevent errors about # missing modules: -echo "mode: blank" > ${LIVE_ROOTDIR}/home/live/.xscreensaver +echo "mode: blank" > ${LIVE_ROOTDIR}/home/${LIVEUID}/.xscreensaver # -------------------------------------------------------------------------- # echo "-- Configuring XFCE." @@ -1304,7 +1307,7 @@ fi mkdir -p ${LIVE_ROOTDIR}/var/lib/kdm cat < ${LIVE_ROOTDIR}/var/lib/kdm/kdmsts [PrevUser] -:0=live +:0=${LIVEUID} EOT chmod 600 ${LIVE_ROOTDIR}/var/lib/kdm/kdmsts @@ -1374,7 +1377,7 @@ if [ "$LIVEDE" = "PLASMA5" ]; then cat < ${LIVE_ROOTDIR}/var/lib/sddm/state.conf [Last] # Name of the last logged-in user. This username will be preselected/shown when the login screen shows up -User=live +User=${LIVEUID} # Name of the session file of the last session selected. This session will be preselected when the login screen shows up. Session=/usr/share/xsessions/plasma.desktop @@ -1455,15 +1458,16 @@ if type custom_config 1>/dev/null 2>/dev/null ; then fi # Workaround a bug where our Xkbconfig is not loaded sometimes: -echo "setxkbmap" > ${LIVE_ROOTDIR}/home/live/.xprofile +echo "setxkbmap" > ${LIVE_ROOTDIR}/home/${LIVEUID}/.xprofile # Give the live user a copy of our XFCE (and more) skeleton configuration: cd ${LIVE_ROOTDIR}/etc/skel/ - find . -exec cp -a --parents "{}" ${LIVE_ROOTDIR}/home/live/ \; + find . -exec cp -a --parents "{}" ${LIVE_ROOTDIR}/home/${LIVEUID}/ \; + find ${LIVE_ROOTDIR}/home/${LIVEUID}/ -type f -exec sed -i -e "s,/home/live,/home/${LIVEUID}," "{}" \; cd - 1>/dev/null # Make sure that user 'live' owns her own files: -chroot ${LIVE_ROOTDIR} chown -R live:users home/live +chroot ${LIVE_ROOTDIR} chown -R ${LIVEUID}:users home/${LIVEUID} # -------------------------------------------------------------------------- # echo "-- Tweaking system startup." -- cgit v1.2.3