From 079d0cc6cb762e54c5d7c1a3923f78930a30e000 Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Wed, 18 Jul 2018 00:48:15 +0200 Subject: [PATCH] - added suppression of loop devices in clean option - corrected a bug in option all --- create_arm_img_urpmi.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/create_arm_img_urpmi.sh b/create_arm_img_urpmi.sh index 59b3fb0..2e08527 100755 --- a/create_arm_img_urpmi.sh +++ b/create_arm_img_urpmi.sh @@ -114,7 +114,14 @@ function clean() else warning "$IMAGE does not exists" fi - + for LOOP in ` ls /dev/loop*[0-9]p1` + do + X=${LOOP:0:10} + if [ -e $X ];then + info "removing $X" + partx -d $X + fi + done if [ -d "$BOOT" ];then info "Removing $BOOT" /bin/rmdir $BOOT @@ -135,6 +142,7 @@ function clean() function createchroot() { + title "Making chroot" if ! [ -f /bin/qemu-arm-static ]; then title "Qemu package not present : installing qemu packages" /sbin/urpmi --auto --no-recommends qemu-user-static @@ -303,7 +311,7 @@ EOF" >>"$BUILD_PATH/second_stage_install.sh" function verify_disk_space() { - info "Verifying if there is enough space on disk to make the image" + title "Verifying if there is enough space on disk to make the image" DISK_SPACE=`/usr/bin/df -BG --output=avail $INSTALL_PATH | sed '1d;s/[^0-9]//g'` info "Free disk space: ${DISK_SPACE}G" if [ $DISK_SPACE -lt $IMAGE_SIZE ];then @@ -405,7 +413,6 @@ EOF BOOT_UUID=`blkid -o value uuid $BOOTP | head -n 1` ROOTP=${DEVICE}p2 ROOT_UUID=`blkid -o value uuid $ROOTP | head -n 1` - } formatpartitions() @@ -710,7 +717,6 @@ fi info "Image size is: $IMAGE_SIZE Go" - case $OPT in clean) clean @@ -729,7 +735,7 @@ case $OPT in updatemirror installbasesystem jumpchroot - createimage + $CREATEIMG ;; createchroot) createchroot