diff options
Diffstat (limited to 'make_slackware_live.sh')
-rwxr-xr-x | make_slackware_live.sh | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/make_slackware_live.sh b/make_slackware_live.sh index e91f1a4..6ac1175 100755 --- a/make_slackware_live.sh +++ b/make_slackware_live.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Eric Hameleers, Eindhoven, NL +# Copyright 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024 Eric Hameleers, Eindhoven, NL # All rights reserved. # # Permission to use, copy, modify, and distribute this software for @@ -346,6 +346,17 @@ LIVE_MOD_ADD=${LIVE_MOD_ADD:-"${LIVE_STAGING}/${LIVEMAIN}/addons"} LIVE_MOD_OPT=${LIVE_MOD_OPT:-"${LIVE_STAGING}/${LIVEMAIN}/optional"} LIVE_MOD_COS=${LIVE_MOD_COS:-"${LIVE_STAGING}/${LIVEMAIN}/core2ram"} +# +# --------------------------------------------------------------------------- +# + +# Internal variables: +if which magick 1>/dev/null 2>/dev/null ; then + MAGICK="magick" +else + MAGICK="" +fi + # --------------------------------------------------------------------------- # Define some functions. # --------------------------------------------------------------------------- @@ -358,6 +369,7 @@ function cleanup() { umount ${LIVE_ROOTDIR}/sys 2>${DBGOUT} || true umount ${LIVE_ROOTDIR}/proc 2>${DBGOUT} || true umount ${LIVE_ROOTDIR}/dev 2>${DBGOUT} || true + lsof -l -n -t ${LIVE_ROOTDIR} |xargs -r kill -KILL || true umount -R ${LIVE_ROOTDIR} 2>${DBGOUT} || true # Need to umount the squashfs modules too: umount -R ${LIVE_WORK}/*_$$ 2>${DBGOUT} || true @@ -1193,36 +1205,36 @@ function plasma5_custom_bg() { echo "-- Configuring ${LIVEDE} custom background image." # First convert our image into a JPG in the liveslak directory: mkdir -p ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${LIVEDE,,} - convert ${LIVE_TOOLDIR}/media/${LIVEDE,,}/bg/background.* ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${LIVEDE,,}/background.jpg + ${MAGICK:-convert} ${LIVE_TOOLDIR}/media/${LIVEDE,,}/bg/background.* ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${LIVEDE,,}/background.jpg # Create a Plasma5 desktop wallpaper set with a lowercase LIVEDE name: mkdir -p ${LIVE_ROOTDIR}/usr/share/wallpapers/${LIVEDE,,}/contents/images # Create set of images for common aspect ratios like 16:9, 16:10 and 4:3: # Aspect Ratio 16:9 : - convert ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${LIVEDE,,}/background.jpg \ + ${MAGICK:-convert} ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${LIVEDE,,}/background.jpg \ -resize 1920x1080 \ ${LIVE_ROOTDIR}/usr/share/wallpapers/${LIVEDE,,}/contents/images/1920x1080.jpg - convert ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${LIVEDE,,}/background.jpg \ + ${MAGICK:-convert} ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${LIVEDE,,}/background.jpg \ -resize 5120x2880 \ ${LIVE_ROOTDIR}/usr/share/wallpapers/${LIVEDE,,}/contents/images/5120x2880.jpg # Aspect Ratio 16:10 : - convert ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${LIVEDE,,}/background.jpg \ + ${MAGICK:-convert} ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${LIVEDE,,}/background.jpg \ -resize 5120x - | \ - convert - -geometry 1920x1200^ -gravity center -crop 1920x1200+0+0 \ + ${MAGICK:-convert} - -geometry 1920x1200^ -gravity center -crop 1920x1200+0+0 \ ${LIVE_ROOTDIR}/usr/share/wallpapers/${LIVEDE,,}/contents/images/1920x1200.jpg - convert ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${LIVEDE,,}/background.jpg \ + ${MAGICK:-convert} ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${LIVEDE,,}/background.jpg \ -resize 5120x - | \ - convert - -geometry 1280x800^ -gravity center -crop 1280x800+0+0 \ + ${MAGICK:-convert} - -geometry 1280x800^ -gravity center -crop 1280x800+0+0 \ ${LIVE_ROOTDIR}/usr/share/wallpapers/${LIVEDE,,}/contents/images/1280x800.jpg # Aspect Ratio 4:3 : - convert ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${LIVEDE,,}/background.jpg \ + ${MAGICK:-convert} ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${LIVEDE,,}/background.jpg \ -resize 5120x - | \ - convert - -geometry 1024x768^ -gravity center -crop 1024x768+0+0 \ + ${MAGICK:-convert} - -geometry 1024x768^ -gravity center -crop 1024x768+0+0 \ ${LIVE_ROOTDIR}/usr/share/wallpapers/${LIVEDE,,}/contents/images/1024x768.jpg # Create the required wallpaper screenshot of 400x225 px (16:9 aspect ratio): - convert ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${LIVEDE,,}/background.jpg \ + ${MAGICK:-convert} ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${LIVEDE,,}/background.jpg \ -resize 400x225 \ ${LIVE_ROOTDIR}/usr/share/wallpapers/${LIVEDE,,}/contents/screenshot.png @@ -2345,11 +2357,11 @@ else # Use the default Slackware blue 'S': FACE_ICON="${LIVE_TOOLDIR}/blueSW-64px.png" fi -convert ${FACE_ICON} -resize 64x64 - >${LIVE_ROOTDIR}/home/${LIVEUID}/.face.icon +${MAGICK:-convert} ${FACE_ICON} -resize 64x64 - >${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 -convert ${FACE_ICON} -resize 64x64 - >${LIVE_ROOTDIR}/usr/share/apps/kdm/pics/users/blues.icon +${MAGICK:-convert} ${FACE_ICON} -resize 64x64 - >${LIVE_ROOTDIR}/usr/share/apps/kdm/pics/users/blues.icon # Give XDM a nicer look: mkdir -p ${LIVE_ROOTDIR}/etc/X11/xdm/liveslak-xdm @@ -3499,6 +3511,9 @@ fi rm -rf ${LIVE_ROOTDIR}/boot/initrd-tree # ... and cleanup these mounts again: +# Also, prevent a 'target is busy' error while unmounting. +# because gpg-agent/keyboxd/scdaemon were activated and keep the mount open: +lsof -l -n -t ${LIVE_ROOTDIR} |xargs -r kill -KILL umount ${LIVE_ROOTDIR}/{proc,sys,dev} || true umount -R ${LIVE_ROOTDIR} || true # Paranoia: |