summaryrefslogtreecommitdiffstats
path: root/perl-install/fs/dmraid.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-10-01 13:07:51 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-10-01 13:07:51 +0000
commit69e0a94455480ee159cee04847e531d5d771f82b (patch)
treeee6ef4c557767de5ec79ce13832872e457a6442b /perl-install/fs/dmraid.pm
parentb8d90de064669c1d80e39dc8bff4dcd446bd1465 (diff)
downloaddrakx-69e0a94455480ee159cee04847e531d5d771f82b.tar
drakx-69e0a94455480ee159cee04847e531d5d771f82b.tar.gz
drakx-69e0a94455480ee159cee04847e531d5d771f82b.tar.bz2
drakx-69e0a94455480ee159cee04847e531d5d771f82b.tar.xz
drakx-69e0a94455480ee159cee04847e531d5d771f82b.zip
- bootloader-config (and other tools): handle /dev/mapper/xxx1 instead of
/dev/mapper/xxxp1 (#44182)
Diffstat (limited to 'perl-install/fs/dmraid.pm')
-rw-r--r--perl-install/fs/dmraid.pm20
1 files changed, 20 insertions, 0 deletions
diff --git a/perl-install/fs/dmraid.pm b/perl-install/fs/dmraid.pm
index 7f9e0fbce..fa06e05e9 100644
--- a/perl-install/fs/dmraid.pm
+++ b/perl-install/fs/dmraid.pm
@@ -112,6 +112,26 @@ sub vgs() {
} _sets();
}
+# the goal is to handle migration from /dev/mapper/xxx1 to /dev/mapper/xxxp1,
+# as used by initrd/nash.
+# dmraid has been patched to follow xxxp1 device names.
+# so until the box has rebooted on new initrd/dmraid, we must cope with /dev/mapper/xxx1 device names
+# (cf #44182)
+sub migrate_device_names {
+ my ($vg) = @_;
+
+ my $dev_name = basename($vg->{device});
+ foreach (all('/dev/mapper')) {
+ my ($nb) = /^\Q$dev_name\E(\d+)$/ or next;
+ my $new = $dev_name . 'p' . $nb;
+ if (! -e "/dev/mapper/$new") {
+ log::l("migrating to $new, creating a compat symlink $_");
+ rename "/dev/mapper/$_", "/dev/mapper/$new";
+ symlink $new, "/dev/mapper/$_";
+ }
+ }
+}
+
if ($ENV{DRAKX_DEBUG_DMRAID}) {
eval(<<'EOF');
my %debug_data = (