Run update-initramfs after changing mdadm.conf
authorJamie Cameron <jcameron@webmin.com>
Tue, 12 May 2009 20:17:19 +0000 (20:17 +0000)
committerJamie Cameron <jcameron@webmin.com>
Tue, 12 May 2009 20:17:19 +0000 (20:17 +0000)
raid/CHANGELOG
raid/raid-lib.pl

index 582034b..778afa5 100644 (file)
@@ -19,3 +19,4 @@ Create /dev/md* device file if missing when creating a RAID set.
 Added a button for changing the number of active devices in a RAID 5 or 6 set, thanks to Diego Zuccato.
 ---- Changes since 1.480 ----
 Added an option to the RAID 1 creation form to mark one of the disks as missing initially.
+Run the update-initramfs -u command after changing mdadm.conf, to sync it into any ramdisk for use at boot time.
index 1fbf5c5..926724b 100644 (file)
@@ -225,6 +225,7 @@ else {
        push(@$lref, "ARRAY $_[0]->{'value'} level=$lvl devices=".
                     join(",", @devices));
        &flush_file_lines();
+       &update_initramfs();
        }
 }
 
@@ -266,6 +267,7 @@ else {
                        }
                }
        &flush_file_lines($config{'mdadm'});
+       &update_initramfs();
        }
 }
 
@@ -382,6 +384,7 @@ if ($raid_mode eq "mdadm") {
                        }
                }
        &flush_file_lines();
+       &update_initramfs();
        }
 }
 
@@ -431,6 +434,7 @@ if ($raid_mode eq "mdadm") {
                        }
                }
        &flush_file_lines();
+       &update_initramfs();
        }
 }
 
@@ -671,5 +675,15 @@ if ($act) {
 return undef;
 }
 
+# update_initramfs()
+# If the update-initramfs command is installed, run it to update mdadm.conf
+# in the ramdisk
+sub update_initramfs
+{
+if (&has_command("update-initramfs")) {
+       &system_logged("update-initramfs -u >/dev/null 2>&1 </dev/null");
+       }
+}
+
 1;