From c7bbdbf51c502493aaeb7fd44ea44efdf1d097c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sat, 10 Mar 2018 02:03:59 +0100 Subject: [PATCH] Use full path for tools normally in /sbin Do not rely on Fedora-specific setting - having /sbin in PATH also for normal user. This allows to build templates on Debian. --- cleanup_image | 2 +- prepare_image | 10 +++++----- qubeize_image | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cleanup_image b/cleanup_image index c48771f..224c04a 100755 --- a/cleanup_image +++ b/cleanup_image @@ -21,4 +21,4 @@ echo "--> Cleaning up image file..." $SCRIPTSDIR/09_cleanup.sh echo "--> Compacting image file..." -fstrim -v "$INSTALLDIR" +/sbin/fstrim -v "$INSTALLDIR" diff --git a/prepare_image b/prepare_image index 69d2582..e210078 100755 --- a/prepare_image +++ b/prepare_image @@ -46,10 +46,10 @@ echo "-> Preparing instalation of ${DIST} template..." if [ -f "${IMG}" ]; then echo "-> Image file already exists, assuming *update*..." if [ "0$TEMPLATE_ROOT_WITH_PARTITIONS" -eq 1 ]; then - IMG_LOOP=$(losetup -P -f --show "$IMG") + IMG_LOOP=$(/sbin/losetup -P -f --show "$IMG") IMG_DEV=${IMG_LOOP}p3 else - IMG_LOOP=$(losetup -f --show "$IMG") + IMG_LOOP=$(/sbin/losetup -f --show "$IMG") IMG_DEV=${IMG_LOOP} fi else @@ -68,10 +68,10 @@ size=2MiB, type=21686148-6449-6E6F-744E-656564454649, uuid=1e6c9db4-1e91-46c4-84 type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=693244e6-3e07-47bf-ad79-acade4293fe7, name="Root filesystem" EOF - IMG_LOOP=$(losetup -P -f --show "$IMG") + IMG_LOOP=$(/sbin/losetup -P -f --show "$IMG") IMG_DEV=${IMG_LOOP}p3 else - IMG_LOOP=$(losetup -f --show "$IMG") + IMG_LOOP=$(/sbin/losetup -f --show "$IMG") IMG_DEV=${IMG_LOOP} fi @@ -96,6 +96,6 @@ trap - EXIT echo "-> Unmounting prepared_image..." umount_kill "$(readlink -m ${INSTALLDIR})" || true -losetup -d ${IMG_LOOP} +/sbin/losetup -d ${IMG_LOOP} exit ${RETCODE} diff --git a/qubeize_image b/qubeize_image index 93bdd0f..36ffe5f 100755 --- a/qubeize_image +++ b/qubeize_image @@ -50,7 +50,7 @@ function cleanup() { trap - ERR trap umount_kill "$PWD/mnt" || true - losetup -d ${IMG_LOOP} + /sbin/losetup -d ${IMG_LOOP} exit $errval } trap cleanup ERR @@ -72,10 +72,10 @@ fi echo "--> Mounting $IMG" mkdir -p mnt if [ "0$TEMPLATE_ROOT_WITH_PARTITIONS" -eq 1 ]; then - IMG_LOOP=$(losetup -P -f --show "$IMG") + IMG_LOOP=$(/sbin/losetup -P -f --show "$IMG") IMG_DEV=${IMG_LOOP}p3 else - IMG_LOOP=$(losetup -f --show "$IMG") + IMG_LOOP=$(/sbin/losetup -f --show "$IMG") IMG_DEV=${IMG_LOOP} fi mount "$IMG_DEV" mnt || exit 1 @@ -123,7 +123,7 @@ ls -als $IMG # ------------------------------------------------------------------------------ echo "--> Unmounting $IMG" umount_kill "$PWD/mnt" || true -losetup -d ${IMG_LOOP} +/sbin/losetup -d ${IMG_LOOP} echo "Qubeized image stored at: $IMG"