summaryrefslogtreecommitdiffstats
path: root/make_slackware_live.sh
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2021-02-15 15:56:06 +0100
committer Eric Hameleers <alien@slackware.com>2021-02-15 15:56:06 +0100
commit75cb97a25a3a2b17b9d1efbf211915dd6343adbd (patch)
tree61b0a3961e4db9d135b07be0bc6995707a8da8bd /make_slackware_live.sh
parent0e6ef18dcaa30440a499b4c198830f2c07651146 (diff)
downloadliveslak-75cb97a25a3a2b17b9d1efbf211915dd6343adbd.tar.gz
liveslak-75cb97a25a3a2b17b9d1efbf211915dd6343adbd.tar.xz
Silence a few harmless error messages from chpasswd
We will catch the error anyway and invoke chpasswd with different syntax.
Diffstat (limited to '')
-rwxr-xr-xmake_slackware_live.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/make_slackware_live.sh b/make_slackware_live.sh
index 57fffde..788cebf 100755
--- a/make_slackware_live.sh
+++ b/make_slackware_live.sh
@@ -1631,8 +1631,8 @@ KERNEL=="loop*", ENV{UDISKS_PRESENTATION_HIDE}="1"
KERNEL=="loop*", ENV{UDISKS_IGNORE}="1"
EOL
-# Set a root password.
-if ! echo "root:${ROOTPW}" | /usr/sbin/chpasswd -R ${LIVE_ROOTDIR} ; then
+# Set a root password. Note 'chpasswd' sometimes segfaults in the first form.
+if ! echo "root:${ROOTPW}" | /usr/sbin/chpasswd -R ${LIVE_ROOTDIR} 2>/dev/null; then
echo "root:${ROOTPW}" | chroot ${LIVE_ROOTDIR} /usr/sbin/chpasswd
fi
@@ -1641,7 +1641,7 @@ if ! chroot ${LIVE_ROOTDIR} /usr/bin/getent passwd ${NVUID} > /dev/null 2>&1 ;
then
chroot ${LIVE_ROOTDIR} /usr/sbin/groupadd -g ${NVGRPNR} ${NVGRP}
chroot ${LIVE_ROOTDIR} /usr/sbin/useradd -c "Nvidia persistence" -u ${NVUIDNR} -g ${NVGRPNR} -d /dev/null -s /bin/false ${NVUID}
- if ! echo "${NVUID}:$(openssl rand -base64 12)" | /usr/sbin/chpasswd -R ${LIVE_ROOTDIR} ; then
+ if ! echo "${NVUID}:$(openssl rand -base64 12)" | /usr/sbin/chpasswd -R ${LIVE_ROOTDIR} 2>/dev/null ; then
echo "${NVUID}:$(openssl rand -base64 12)" | chroot ${LIVE_ROOTDIR} /usr/sbin/chpasswd
fi
fi
@@ -1656,7 +1656,7 @@ 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}
-if ! echo "${LIVEUID}:${LIVEPW}" | /usr/sbin/chpasswd -R ${LIVE_ROOTDIR} ; then
+if ! echo "${LIVEUID}:${LIVEPW}" | /usr/sbin/chpasswd -R ${LIVE_ROOTDIR} 2>/dev/null ; then
echo "${LIVEUID}:${LIVEPW}" | chroot ${LIVE_ROOTDIR} /usr/sbin/chpasswd
fi
@@ -2583,7 +2583,7 @@ if [ "$LIVEDE" = "STUDIOWARE" ]; then
# Create group and user for the Avahi service:
chroot ${LIVE_ROOTDIR} /usr/sbin/groupadd -g 214 avahi
chroot ${LIVE_ROOTDIR} /usr/sbin/useradd -c "Avahi Service Account" -u 214 -g 214 -d /dev/null -s /bin/false avahi
- if ! echo "avahi:$(openssl rand -base64 12)" | /usr/sbin/chpasswd -R ${LIVE_ROOTDIR} ; then
+ if ! echo "avahi:$(openssl rand -base64 12)" | /usr/sbin/chpasswd -R ${LIVE_ROOTDIR} 2>/dev/null ; then
echo "avahi:$(openssl rand -base64 12)" | chroot ${LIVE_ROOTDIR} /usr/sbin/chpasswd
fi