Author: glen
Date: Thu Nov 13 00:07:08 2008
New Revision: 9984

Modified:
   geninitrd/trunk/geninitrd
Log:
- cleanup: do not need LUKSNAME to pass around

Modified: geninitrd/trunk/geninitrd
==============================================================================
--- geninitrd/trunk/geninitrd   (original)
+++ geninitrd/trunk/geninitrd   Thu Nov 13 00:07:08 2008
@@ -73,8 +73,8 @@
 # VG for suspend resume dev
 SUSPENDVG=""
 
-# DM name for cryptsetup luks
-LUKSNAME=""
+# device to use for name for cryptsetup luks
+LUKSDEV=""
 
 # resume device
 resume_dev=""
@@ -827,8 +827,8 @@
        local devpath="$1"
        local dev
 
-       LUKSNAME=${devpath#/dev/mapper/}
-       LUKSDEV=$(cryptsetup status $LUKSNAME 2>/dev/null | awk 
'/device:/{print $2}')
+       local name=${devpath#/dev/mapper/}
+       LUKSDEV=$(cryptsetup status $name 2>/dev/null | awk '/device:/{print 
$2}')
        if [ -z "$LUKSDEV" ]; then
                die "Lost cryptsetup device meanwhile?"
        fi
@@ -1275,8 +1275,7 @@
 
 # produce cryptsetup from $name from /etc/crypttab
 luks_crypttab() {
-       local LUKSNAME="$1"
-       local LUKSDEV="$2"
+       local LUKSDEV="$1"
 
        # copy from /etc/rc.d/init.d/cryptsetup
        local dst src key opt mode owner
@@ -1310,7 +1309,7 @@
                                warn "$dst: options are invalid for LUKS 
partitions, ignoring them"
                        fi
                        if [ "$key" ]; then
-                               keyfile=/etc/luks-$LUKSNAME.key
+                               keyfile=/etc/.$dst.key
                                inst $key $keyfile
                        fi
 
@@ -1337,9 +1336,10 @@
        mount_dev
        mount_sys
        initrd_gen_devices
+       # TODO: 'udevadm settle' is called by lukssetup, is udev optional?
 
-       debug "luks: process /etc/crypttab $LUKSNAME $LUKSDEV"
-       luks_crypttab $LUKSNAME $LUKSDEV
+       debug "luks: process /etc/crypttab $LUKSDEV"
+       luks_crypttab $LUKSDEV
 }
 
 initrd_gen_bootsplash() {
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to