aboutsummaryrefslogtreecommitdiffstats
path: root/functions.sh
diff options
context:
space:
mode:
Diffstat (limited to 'functions.sh')
-rwxr-xr-xfunctions.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/functions.sh b/functions.sh
index c266756..c33f55e 100755
--- a/functions.sh
+++ b/functions.sh
@@ -541,11 +541,21 @@ function partitionningimage() {
function loopingImage() {
title "Looping image ..."
+ if ! [ -x /usr/bin/udisksctl ]; then
+ error "Error, udisks2 is missing."
+ cleanExit ${ERR_1}
+ fi
+
# Mettre en place et contrôler des périphériques boucle.
# -f, --find trouver le premier périphérique inutilisé
# --show afficher le nom du périphérique après configuration (avec -f)
# DEVICE=$(/usr/sbin/losetup -f --show "${INSTALL_PATH}/${IMAGE}")
DEVICE=$(/usr/bin/udisksctl loop-setup -f ${INSTALL_PATH}/${IMAGE} | sed -e 's/^.*\/dev\//\/dev\//' -e 's/\.$//')
+ if [ -z "${DEVICE}" ]; then
+ error "Error, device missing from udisksctl loop-setup output."
+ cleanExit ${ERR_1}
+ fi
+
print_info "Image looped on ${DEVICE}"