Author: wiget
Date: Wed Feb  2 17:23:30 2011
New Revision: 12101

Modified:
   geninitrd/trunk/functions
Log:
Allow rootfs on crypted device

Modified: geninitrd/trunk/functions
==============================================================================
--- geninitrd/trunk/functions   (original)
+++ geninitrd/trunk/functions   Wed Feb  2 17:23:30 2011
@@ -64,15 +64,33 @@
        esac
 
        case $rootdev in
-       /dev/dm-* | /dev/mapper/*)
+       /dev/dm-*)
                local node
-               node=$(dm_lvm2_name "$rootdev") || return 1
+               node=$(dm_longname "$rootdev") || return 1
                if [ "$node" ]; then
                        rootdev="$node"
                fi
                ;;
        esac
 
+       case $rootdev in
+       /dev/mapper/*)
+               local dm_uuid=$(dmsetup info -c --noheadings $rootdev | awk -F: 
'{print $8}')
+               case $dm_uuid in
+               LVM-*)
+                       local node
+                       node=$(dm_lvm2_name "$rootdev") || return 1
+                       if [ "$node" ]; then
+                               rootdev="$node"
+                       fi
+                       return 0
+                       ;;
+               CRYPT-*)
+                       return 0
+                       ;;
+               esac
+       esac
+
        if [ "$rootFs" = "nfs" ]; then
                rootdev="/dev/nfs"
                return 0
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to