]> git.pld-linux.org Git - projects/geninitrd.git/blobdiff - mod-md.sh
- swsusp support from mis@pld-linux
[projects/geninitrd.git] / mod-md.sh
index 3e63afc00a20f2757a6700fdd2fa701ab7fd8f09..a3585170fb7bb56e1db25ed4f72f75ffe64d717a 100644 (file)
--- a/mod-md.sh
+++ b/mod-md.sh
@@ -8,10 +8,6 @@ have_md=no
 # setup geninitrd module
 # @access      public
 setup_mod_md() {
-       mdassemble=$(find_tool $initrd_dir/mdassemble /sbin/initrd-mdassemble)
-       if [ ! -x "$mdassemble" ]; then
-               USE_MD=no
-       fi
        mdadm=$(find_tool /sbin/mdadm $initrd_dir/mdadm /sbin/initrd-mdadm)
        if [ ! -x "$mdadm" ]; then
                USE_MD=no
@@ -137,15 +133,17 @@ initrd_gen_md() {
        fi
        verbose "Setting up mdadm..."
 
-       inst_exec $mdassemble /bin/mdassemble
+       inst_exec $mdadm /sbin/mdadm
+
+       echo "DEVICE partitions containers" >> "$DESTDIR/etc/mdadm.conf"
 
        # LVM on RAID case
        local dev_list_extra ex_dev
        dev_list_extra=$(awk '/^DEVICE / { for (i=2; i<=NF; i++) { printf "%s ", $i; }; } ' /etc/mdadm.conf | xargs)
        new_dev_list_extra=""
        for ex_dev in $dev_list_extra; do
-               if [ "$ex_dev" = "partitions" ]; then
-                       echo "DEVICE partitions" >> "$DESTDIR/etc/mdadm.conf"
+               if [ "$ex_dev" = "partitions" -o "$ex_dev" = "containers" ]; then
+                       echo "DEVICE $ex_dev" >> "$DESTDIR/etc/mdadm.conf"
                        # FIXME: find and copy partition devices from /proc/partitions
                        #        - best if done at runtime, now initrd gen time
                        continue
@@ -181,8 +179,9 @@ initrd_gen_md() {
                done
        done
 
-       add_linuxrc <<-EOF
-       mdassemble
+       echo "wait_for_files $cr_dev_list" | add_linuxrc
+       add_linuxrc <<-'EOF'
+       /sbin/mdadm --assemble --scan
 
        if [ "$DEBUGINITRD" ]; then
                [ -e /proc/mdstat ] && echo "/proc/mdstat contents:" && cat /proc/mdstat
This page took 0.05663 seconds and 4 git commands to generate.