]> git.pld-linux.org Git - projects/geninitrd.git/blobdiff - mod-blkid.sh
- swsusp support from mis@pld-linux
[projects/geninitrd.git] / mod-blkid.sh
index 13c59aa0152d501069c86241c14023584a13081c..92df9aede517dcdb89ef9a4d4e513d293c63e261 100644 (file)
@@ -1,5 +1,4 @@
 #!/bin/sh
-#
 # geninitrd mod: blkid
 USE_BLKID=${USE_BLKID:-yes}
 
@@ -18,15 +17,20 @@ setup_mod_blkid() {
 # generate initrd fragment
 # @access      public
 initrd_gen_blkid() {
-       debug "Adding BLKID support to initrd"
+       if ! is_yes "$USE_BLKID"; then
+               return
+       fi
+       verbose "Adding BLKID support to initrd"
 
-       inst_exec $blkid /bin/blkid
+       inst_exec $blkid /sbin/blkid
        initrd_gen_devices
        add_linuxrc <<-'EOF'
-               # if built with blkid change ROOT=LABEL=something into ROOT=/dev/somethingelse -
-               # parsed by blkid
+               # if built with blkid change ROOT=LABEL=something into ROOT=/dev/device parsed by blkid
                if [ "${ROOT##LABEL=}" != "${ROOT}" -o "${ROOT##UUID=}" != "${ROOT}" ]; then
-                       ROOT="$(/bin/blkid -t $ROOT -o device -l)"
+                       blkid="$(/sbin/blkid -t $ROOT -o device -l)"
+                       if [ -n "$blkid" ]; then
+                               ROOT=$blkid
+                       fi
                fi
        EOF
 }
This page took 0.024672 seconds and 4 git commands to generate.