Move check for block device to mount_persistence_media().
authorJan Blunck <jblunck@vyatta.com>
Mon, 2 Sep 2013 15:03:42 +0000 (17:03 +0200)
committerDaniel Baumann <mail@daniel-baumann.ch>
Fri, 13 Sep 2013 12:15:48 +0000 (14:15 +0200)
We should only check for the persistence media path being a block device
where it is really required which is the case in mount_persistence_media().

components/9990-misc-helpers.sh

index 570a12a..c502d59 100755 (executable)
@@ -694,6 +694,11 @@ mount_persistence_media ()
        device=${1}
        probe=${2}
 
+       if [ ! -b "${device}" ]
+       then
+               return 1
+       fi
+
        backing="/live/persistence/$(basename ${device})"
 
        mkdir -p "${backing}"
@@ -1250,11 +1255,6 @@ get_custom_mounts ()
 
        for device in ${devices}
        do
-               if [ ! -b "${device}" ]
-               then
-                       continue
-               fi
-
                local device_name backing include_list
                device_name="$(basename ${device})"
                backing=$(mount_persistence_media ${device})