add udevsettle function and settle after raid/lvm/crypto activities
authorHarald Hoyer <harald@redhat.com>
Mon, 31 Aug 2009 09:41:36 +0000 (11:41 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 1 Sep 2009 13:42:27 +0000 (15:42 +0200)
modules.d/50plymouth/cryptroot-ask.sh
modules.d/90crypt/cryptroot-ask.sh
modules.d/90dmraid/dmraid.sh
modules.d/90lvm/lvm_scan.sh
modules.d/99base/dracut-lib.sh
modules.d/99base/init

index 9dbb44f..2188088 100755 (executable)
@@ -24,6 +24,7 @@ if [ -n "$LUKS" ]; then
 fi
 
 if [ $ask -gt 0 ]; then
+    info "luksOpen $1 $2"
     # flock against other interactive activities
     { flock -s 9; 
        /bin/plymouth ask-for-password \
@@ -35,6 +36,8 @@ fi
 # mark device as asked
 >> /tmp/cryptroot-asked-$2
 
+udevsettle
+
 unset LUKS
 unset ask
 unset luks
index 9d23808..a2ebde6 100755 (executable)
@@ -24,14 +24,17 @@ if [ -n "$LUKS" ]; then
 fi
 
 if [ $ask -gt 0 ]; then
+    info "luksOpen $1 $2"
     # flock against other interactive activities
     { flock -s 9; 
        echo -n "$1 is password protected " 
-       /sbin/cryptsetup luksOpen -T1 $1 $2
+       /sbin/cryptsetup luksOpen -T1 $1 $2 
     } 9>/.console.lock
 fi
 
 # mark device as asked
 >> /tmp/cryptroot-asked-$2
 
+udevsettle
+
 exit 0
index 74ea70f..2cd6773 100755 (executable)
@@ -15,12 +15,14 @@ if $UDEV_QUEUE_EMPTY >/dev/null 2>&1; then
                if [ "${s##$r}" != "$s" ]; then
                    info "Activating $s"
                    dmraid -ay $s 2>&1 | vinfo
+                    udevsettle
                fi
            done
        done
     else 
        # scan and activate all DM RAIDS
        dmraid -ay 2>&1 | vinfo
+        udevsettle
     fi
 fi
 
index 966f909..a40b677 100755 (executable)
@@ -23,7 +23,7 @@ if $UDEV_QUEUE_EMPTY >/dev/null 2>&1; then
                printf '"a|^/dev/%s$|", ' $dev;
            done;
            echo '"r/.*/" ]';
-           echo 'types = [ "blkext", 1024 ]'
+           echo 'types = [ "blkext", 1024 , "cciss0", 1024 ]'
            echo '}';     
         } > /etc/lvm/lvm.conf
        lvmwritten=1
@@ -33,5 +33,6 @@ if $UDEV_QUEUE_EMPTY >/dev/null 2>&1; then
     lvm vgchange -ay $VGS 2>&1 | vinfo
     [ "$lvmwritten" ] && rm -f /etc/lvm/lvm.conf
     unset lvmwritten
+    udevsettle
 fi
 
index 3c6cf86..76cb127 100644 (file)
@@ -107,3 +107,11 @@ incol2() {
     done < $file
     return 1
 }
+
+udevsettle() {
+    if [ $UDEVVERSION -ge 143 ]; then
+        udevadm settle --exit-if-exists=/initqueue/work --exit-if-exists=/dev/root 
+    else
+        udevadm settle --timeout=30
+    fi
+}
index 19c7f38..d94a3a2 100755 (executable)
@@ -112,11 +112,7 @@ while :; do
     # check if root can be mounted
     [ -e /dev/root ] && break;
 
-    if [ $UDEVVERSION -ge 143 ]; then
-        udevadm settle --exit-if-exists=/initqueue/work --exit-if-exists=/dev/root 
-    else
-        udevadm settle --timeout=30
-    fi
+    udevsettle
 
     # bail out, if we have mounted the root filesystem
     [ -d "$NEWROOT/proc" ] && break;