From c94369576f770688a905f562419d683e70e36870 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Fri, 27 Nov 2020 20:58:00 +0000 Subject: Fail when udisks2 is missing Currently it causes to mess up with the system... --- functions.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) 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}" -- cgit v1.2.1