diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-10-01 13:07:51 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-10-01 13:07:51 +0000 |
commit | 69e0a94455480ee159cee04847e531d5d771f82b (patch) | |
tree | ee6ef4c557767de5ec79ce13832872e457a6442b | |
parent | b8d90de064669c1d80e39dc8bff4dcd446bd1465 (diff) | |
download | drakx-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)
-rw-r--r-- | perl-install/NEWS | 3 | ||||
-rw-r--r-- | perl-install/fs/dmraid.pm | 20 | ||||
-rw-r--r-- | perl-install/fsedit.pm | 3 | ||||
-rwxr-xr-x | perl-install/standalone/bootloader-config | 1 |
4 files changed, 27 insertions, 0 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS index d2e210322..d7b43d741 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,3 +1,6 @@ +- bootloader-config (and other tools): handle /dev/mapper/xxx1 instead of + /dev/mapper/xxxp1 (#44182) + Version 11.62 - 1 October 2008 - fix dithering regression (introduced on 2008-09-29) 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 = ( diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm index bd4831b6b..17ed0647b 100644 --- a/perl-install/fsedit.pm +++ b/perl-install/fsedit.pm @@ -139,6 +139,9 @@ sub handle_dmraid { return; }; } + if (!$::isInstall) { + fs::dmraid::migrate_device_names($_) foreach @vgs; + } log::l("using dmraid on " . join(' ', map { $_->{device} } @vgs)); my @used_hds = map { diff --git a/perl-install/standalone/bootloader-config b/perl-install/standalone/bootloader-config index e070c37ea..35c117983 100755 --- a/perl-install/standalone/bootloader-config +++ b/perl-install/standalone/bootloader-config @@ -285,6 +285,7 @@ sub _migrate_to_uuids__fstab() { or log::l("migrate_to_uuids: no UUID for $part->{device}, can not migrate it"), next; $part->{prefer_device_UUID} = 1; $part->{prefer_device} = 0; + delete $part->{device_alias} if $part->{device_alias} && $part->{device_alias} =~ m!\bmapper/!; # see fs::dmraid::migrate_device_names() for more log::l("migrate_to_uuids: migrating fstab $part->{device} entry"); $fstab_migrated = 1; |