]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - src/install+setup/install/mountdest.sh
installer: fix setup unwanted reboot if size of destination not found.
[people/teissler/ipfire-2.x.git] / src / install+setup / install / mountdest.sh
index e28a0689bd1c5a98e3bd8c81a1478bedb2fa17d0..16cf6ed4d3a6aa79fcc8a039dc4105a47dd73016 100644 (file)
@@ -111,11 +111,15 @@ for path in /sys/block/*; do
        echo "  OK, this is it..."
        echo -n "${device_}" > /tmp/dest_device
 
-       # Disk size to GiB.
-       device_size=$(( ${device_size} / 2097152 ))
-
-       # Build string with drive details
-       device_str="/dev/${device_} - ${device_size} GiB -"
+       if [ ${device_size} -gt 0 ]; then
+               # Disk size to GiB.
+               device_size=$(( ${device_size} / 2097152 ))
+
+               # Build string with drive details
+               device_str="/dev/${device_} - ${device_size} GiB -"
+       else
+               device_str="/dev/${device_} -"
+       fi
        device_str="${device_str} $(cat /sys/block/${device}/device/vendor)"
        device_str="${device_str} $(cat /sys/block/${device}/device/model)"