summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-09-17 11:51:29 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-09-17 11:51:29 +0000
commitd1098abfb443fb7cf8cbc97ad96a303fa5c749f8 (patch)
treef4fdf2f84e041b554bd964cc5de47a8c95b203da
parent1d2aeea6110b4e3b8db35e33f5543153a8b41bc6 (diff)
downloaddrakx-d1098abfb443fb7cf8cbc97ad96a303fa5c749f8.tar
drakx-d1098abfb443fb7cf8cbc97ad96a303fa5c749f8.tar.gz
drakx-d1098abfb443fb7cf8cbc97ad96a303fa5c749f8.tar.bz2
drakx-d1098abfb443fb7cf8cbc97ad96a303fa5c749f8.tar.xz
drakx-d1098abfb443fb7cf8cbc97ad96a303fa5c749f8.zip
- bootloader-config:
o --action migrate-to-uuids: do not migrate software raid to UUID (#43928) also fix a small typo in bootloader-config
-rw-r--r--perl-install/NEWS2
-rw-r--r--perl-install/devices.pm5
-rw-r--r--perl-install/fs/wild_device.pm2
-rwxr-xr-xperl-install/standalone/bootloader-config5
4 files changed, 11 insertions, 3 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index 1a3eebafb..ad4a9417c 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,3 +1,5 @@
+- bootloader-config:
+ o --action migrate-to-uuids: do not migrate software raid to UUID (#43928)
- license: put focus back on Refuse button by default
Version 11.44 - 16 September 2008
diff --git a/perl-install/devices.pm b/perl-install/devices.pm
index 9ee3d6ac5..8e7ff8f1a 100644
--- a/perl-install/devices.pm
+++ b/perl-install/devices.pm
@@ -208,6 +208,11 @@ sub prefix_for_dev {
$dev . ($dev =~ /\d$/ ? 'p' : '');
}
+sub should_prefer_UUID {
+ my ($dev) = @_;
+ $dev =~ /^(hd|sd)/;
+}
+
sub symlink_now_and_register {
my ($if_struct, $of) = @_;
my $if = $if_struct->{device};
diff --git a/perl-install/fs/wild_device.pm b/perl-install/fs/wild_device.pm
index f31390d9e..4e2a3a849 100644
--- a/perl-install/fs/wild_device.pm
+++ b/perl-install/fs/wild_device.pm
@@ -79,7 +79,7 @@ sub to_subpart {
sub _prefer_device_UUID {
my ($part) = @_;
$part->{prefer_device_UUID} ||
- !$::no_uuid_by_default && $part->{device} =~ /^(hd|sd)/;
+ !$::no_uuid_by_default && devices::should_prefer_UUID($part->{device});
}
sub from_part {
diff --git a/perl-install/standalone/bootloader-config b/perl-install/standalone/bootloader-config
index 17446b581..8c3dc7466 100755
--- a/perl-install/standalone/bootloader-config
+++ b/perl-install/standalone/bootloader-config
@@ -284,7 +284,7 @@ sub _migrate_to_uuids__fstab() {
sub _migrate_dev_to_uuid {
my ($fstab, $dev) = @_;
- $dev && $dev =~ m!/dev/! or next;
+ $dev && $dev =~ m!/dev/! or return;
my $part = fs::get::device2part($dev, $fstab);
$part && $part->{device_UUID} && "UUID=$part->{device_UUID}";
@@ -292,7 +292,8 @@ sub _migrate_dev_to_uuid {
sub _set_prefer_device_UUID {
my ($part) = @_;
- $part->{device_UUID} && !$part->{prefer_device_UUID} && !$part->{prefer_device_LABEL} or return;
+ $part->{device_UUID} && !$part->{prefer_device_UUID} && !$part->{prefer_device_LABEL}
+ && devices::should_prefer_UUID($part->{device}) or return;
$part->{prefer_device_UUID} = 1;
$part->{prefer_device} = 0;
1;