[kernel] r15507 - dists/sid/linux-2.6/debian
Ben Hutchings
benh at alioth.debian.org
Sat Apr 10 21:34:33 UTC 2010
Author: benh
Date: Sat Apr 10 21:34:30 2010
New Revision: 15507
Log:
linux-base: Check device IDs in mdadm.conf rather than assuming it needs manual conversion
Modified:
dists/sid/linux-2.6/debian/changelog
dists/sid/linux-2.6/debian/linux-base.postinst
Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog Sat Apr 10 20:55:06 2010 (r15506)
+++ dists/sid/linux-2.6/debian/changelog Sat Apr 10 21:34:30 2010 (r15507)
@@ -12,6 +12,8 @@
- Fix scope of _system() function (Closes: #576925)
- Fix case where a file may wrongly be listed as automatically converted
(Closes: #577047)
+ - Check device IDs in mdadm.conf rather than assuming it needs manual
+ conversion
[ maximilian attems]
* Ignore ABI breakage due to libata switch.
Modified: dists/sid/linux-2.6/debian/linux-base.postinst
==============================================================================
--- dists/sid/linux-2.6/debian/linux-base.postinst Sat Apr 10 20:55:06 2010 (r15506)
+++ dists/sid/linux-2.6/debian/linux-base.postinst Sat Apr 10 21:34:30 2010 (r15507)
@@ -907,6 +907,25 @@
return @results;
}
+### mdadm
+
+sub mdadm_list {
+ my ($file) = @_;
+ my (@results) = ();
+
+ while (<$file>) {
+ # Look for DEVICE (case-insensitive, may be abbreviated to as
+ # little as 3 letters) followed by a whitespace-separated list
+ # of devices (or wildcards, or keywords!). Ignore comments
+ # (hash preceded by whitespace).
+ if (/^DEV(?:I(?:C(?:E)?)?)?[ \t]*((?:[^ \t]|[ \t][^#])*)/i) {
+ push @results, split(/[ \t]+/, $1);
+ }
+ }
+
+ return @results;
+}
+
### list of all configuration files and functions
my @config_files = ({packages => 'mount',
@@ -987,7 +1006,8 @@
# mdadm.conf requires manual update because it may
# contain wildcards.
{packages => 'mdadm',
- path => '/etc/mdadm/mdadm.conf'},
+ path => '/etc/mdadm/mdadm.conf',
+ list => \&mdadm_list},
# hdparm.conf requires manual update because it
# (1) refers to whole disks (2) might not work
# properly with the new drivers (3) is in a very
@@ -1173,8 +1193,11 @@
$needs_update = defined($id_map_text) && $id_map_text ne '';
} elsif (exists($config->{list})) {
for my $bdev (&{$config->{list}}($file)) {
- if ($bdev =~ m{^/dev/(?:[hs]d[a-z]\d*|s(?:cd|r)\d+)$} &&
- -b $bdev) {
+ # Match standard IDE and SCSI device names, plus wildcards
+ # in disk device names to allow for mdadm insanity.
+ if ($bdev =~ m{^/dev/(?:[hs]d[a-z\?\*][\d\?\*]*|
+ s(?:cd|r)\d+)$}x &&
+ ($bdev =~ m/[\?\*]/ || -b $bdev)) {
$bdev_map{$bdev} = {};
push @matched_bdevs, $bdev;
}
More information about the Kernel-svn-changes
mailing list