summaryrefslogtreecommitdiffstats
path: root/make_slackware_live.sh
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2020-10-05 15:45:02 +0200
committer Eric Hameleers <alien@slackware.com>2020-10-05 15:45:02 +0200
commit50cfb6cef69c74e4827c0473664fc32ff374d68a (patch)
treec602dd43503eff58a029e4a9019e0d1dabcca067 /make_slackware_live.sh
parent70b689e6bf00338f55ae2daf1c2d0c2d972e00e8 (diff)
downloadliveslak-50cfb6cef69c74e4827c0473664fc32ff374d68a.tar.gz
liveslak-50cfb6cef69c74e4827c0473664fc32ff374d68a.tar.xz
Improvements to script legibility
Better demarcation of the start and end of internal function definitions.
Diffstat (limited to '')
-rwxr-xr-xmake_slackware_live.sh24
1 files changed, 13 insertions, 11 deletions
diff --git a/make_slackware_live.sh b/make_slackware_live.sh
index fca54ef..5043b9e 100755
--- a/make_slackware_live.sh
+++ b/make_slackware_live.sh
@@ -304,7 +304,7 @@ LIVE_MOD_OPT=${LIVE_MOD_OPT:-"${LIVE_STAGING}/${LIVEMAIN}/optional"}
# ---------------------------------------------------------------------------
# Clean up in case of failure:
-cleanup() {
+function cleanup() {
# Clean up by unmounting our loopmounts, deleting tempfiles:
echo "--- Cleaning up the staging area..."
sync
@@ -319,22 +319,23 @@ cleanup() {
rmdir ${LIVE_WORK}/*_$$ 2>${DBGOUT}
rm ${LIVE_MOD_OPT}/* 2>${DBGOUT} || true
rm ${LIVE_MOD_ADD}/* 2>${DBGOUT} || true
-}
+} # End of cleanup()
+
trap 'echo "*** $0 FAILED at line $LINENO ***"; cleanup; exit 1' ERR INT TERM
# Uncompress the initrd based on the compression algorithm used:
-uncompressfs () {
+function uncompressfs() {
if $(file "${1}" | grep -qi ": gzip"); then
gzip -cd "${1}"
elif $(file "${1}" | grep -qi ": XZ"); then
xz -cd "${1}"
fi
-}
+} # End of uncompressfs()
#
# Return the full pathname of first package found below $2 matching exactly $1:
#
-full_pkgname() {
+function full_pkgname() {
PACK=$1
if [ -e $2 ]; then
TOPDIR=$2
@@ -352,7 +353,7 @@ full_pkgname() {
else
echo ""
fi
-}
+} # End of full_pkgname()
#
# Find packages and install them into the temporary root:
@@ -614,8 +615,7 @@ function install_pkgs() {
done
fi
- # End install_pkgs
-}
+} # End install_pkgs()
#
@@ -708,7 +708,8 @@ EOL
done
done
-}
+
+} # End of gen_bootmenu()
#
# Create the grub menu file for UEFI boot:
@@ -833,12 +834,13 @@ EOL
rm -f $TZLIST
done
-}
+
+} # End of gen_uefimenu()
#
# Create an ISO file from a directory's content:
#
-create_iso() {
+function create_iso() {
TOPDIR=${1:-"${LIVE_STAGING}"}
cd "$TOPDIR"