aboutsummaryrefslogtreecommitdiffstats
path: root/functions.sh
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2020-11-27 20:58:00 +0000
committerPascal Terjan <pterjan@mageia.org>2020-12-19 15:00:52 +0000
commitc94369576f770688a905f562419d683e70e36870 (patch)
treef63bd1be257073055f061786f48c5b27cf104ca8 /functions.sh
parent86dadb4d2fa8c314206b7cc867dde620018b0736 (diff)
downloadmageia4arm-c94369576f770688a905f562419d683e70e36870.tar
mageia4arm-c94369576f770688a905f562419d683e70e36870.tar.gz
mageia4arm-c94369576f770688a905f562419d683e70e36870.tar.bz2
mageia4arm-c94369576f770688a905f562419d683e70e36870.tar.xz
mageia4arm-c94369576f770688a905f562419d683e70e36870.zip
Fail when udisks2 is missing
Currently it causes to mess up with the system...
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}"