summaryrefslogtreecommitdiff
path: root/helpers/lh_source_hdd
diff options
context:
space:
mode:
Diffstat (limited to 'helpers/lh_source_hdd')
-rwxr-xr-xhelpers/lh_source_hdd63
1 files changed, 31 insertions, 32 deletions
diff --git a/helpers/lh_source_hdd b/helpers/lh_source_hdd
index 74b8889..416f1ba 100755
--- a/helpers/lh_source_hdd
+++ b/helpers/lh_source_hdd
@@ -9,21 +9,21 @@
set -e
-# Source common functions
-for FUNCTION in /usr/share/live-helper/functions/*.sh
+# Including common functions
+LH_BASE="${LH_BASE:-/usr/share/live-helper}"
+
+for FUNCTION in "${LH_BASE}"/functions/*.sh
do
- . ${FUNCTION}
+ . "${FUNCTION}"
done
-# Set static variables
+# Setting static variables
DESCRIPTION="build source harddisk image"
HELP=""
USAGE="${PROGRAM} [--force]"
Arguments "${@}"
-Echo_debug "Init ${PROGRAM}"
-
# Reading configuration files
Read_conffile config/common
Read_conffile config/bootstrap
@@ -32,40 +32,39 @@ Read_conffile config/binary
Read_conffile config/source
Set_defaults
-Breakpoint "source_hdd: Init"
-
if [ "${LIVE_SOURCE}" != "enabled" ]
then
exit 0
fi
-for IMAGE in ${LIVE_SOURCE_IMAGES}
-do
- if [ "${IMAGE}" = "hdd" ]
- then
- # Requiring stage file
- Require_stagefile .stage/source_debian
+if ! echo "${LIVE_SOURCE_IMAGES}" | grep -qs hdd
+then
+ exit 0
+fi
- # Checking stage file
- Check_stagefile .stage/source_hdd
+Echo_message "Begin building source harddisk image..."
+Echo_message "This may take a while."
- # Checking lock file
- Check_lockfile .lock
+# Requiring stage file
+Require_stagefile .stage/source_debian
- # Creating lock file
- Create_lockfile .lock
+# Checking stage file
+Check_stagefile .stage/source_hdd
- # Remove old source
- if [ -f source-hdd.tar.gz ]
- then
- rm -f source-hdd.tar.gz
- fi
+# Checking lock file
+Check_lockfile .lock
- # Create tarball
- Echo_message "Creating tarball, this can take a while."
- tar cfz source-hdd.tar.gz source
+# Creating lock file
+Create_lockfile .lock
- # Creating stage file
- Create_stagefile .stage/source_hdd
- fi
-done
+# Remove old source
+if [ -f source-hdd.tar.gz ]
+then
+ rm -f source-hdd.tar.gz
+fi
+
+# Create tarball
+tar cfz source-hdd.tar.gz source
+
+# Creating stage file
+Create_stagefile .stage/source_hdd