summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/NEWS3
-rw-r--r--perl-install/bootloader.pm10
-rwxr-xr-xperl-install/standalone/bootloader-config7
3 files changed, 13 insertions, 7 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index 44ee265b9..c656af1b3 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,3 +1,6 @@
+- bootloader-config:
+ o --action migrate-to-uuids: backup conf file prior to migration with suffix
+ .before-migrate-to-uuids
- libDrakX:
o fix handling KDE4 in running_window_manager() and ask_window_manager_to_logout()
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index 49a68ffa5..f3e52a741 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -1312,7 +1312,7 @@ sub make_label_lilo_compatible {
}
sub write_lilo {
- my ($bootloader, $all_hds) = @_;
+ my ($bootloader, $all_hds, $o_backup_extension) = @_;
$bootloader->{prompt} ||= $bootloader->{timeout};
my $file2fullname = sub {
@@ -1430,7 +1430,7 @@ sub write_lilo {
my $f = arch() =~ /ia64/ ? "$::prefix/boot/efi/elilo.conf" : "$::prefix/etc/lilo.conf";
log::l("writing lilo config to $f");
- renamef($f, "$f.old");
+ renamef($f, $f . ($o_backup_extension || '.old'));
output_with_perm($f, $bootloader->{password} ? 0600 : 0644, map { "$_\n" } @conf);
}
@@ -1627,7 +1627,7 @@ sub update_copy_in_boot {
}
sub write_grub {
- my ($bootloader, $all_hds) = @_;
+ my ($bootloader, $all_hds, $o_backup_extension) = @_;
my $fstab = [ fs::get::fstab($all_hds) ];
my @legacy_floppies = detect_devices::floppies();
@@ -1730,14 +1730,14 @@ sub write_grub {
}
my $f = "$::prefix/boot/grub/menu.lst";
log::l("writing grub config to $f");
- renamef($f, "$f.old");
+ renamef($f, $f . ($o_backup_extension || '.old'));
output($f, map { "$_\n" } @conf);
}
{
my $f = "$::prefix/boot/grub/install.sh";
my $boot_dev = device_string2grub($bootloader->{boot}, \@legacy_floppies, \@sorted_hds);
my $files_dev = device2grub(fs::get::root_($fstab, 'boot'), \@sorted_hds);
- renamef($f, "$f.old");
+ renamef($f, $f . ($o_backup_extension || '.old'));
output_with_perm($f, 0755,
"grub --device-map=/boot/grub/device.map --batch <<EOF
root $files_dev
diff --git a/perl-install/standalone/bootloader-config b/perl-install/standalone/bootloader-config
index 4a4b194df..b5a8e6807 100755
--- a/perl-install/standalone/bootloader-config
+++ b/perl-install/standalone/bootloader-config
@@ -259,7 +259,7 @@ sub migrate_to_uuids() {
});
if ($bootloader_migrated) {
- bootloader::action($bootloader, 'write', $all_hds);
+ bootloader::action($bootloader, 'write', $all_hds, '.before-migrate-to-uuids');
bootloader::action($bootloader, 'when_config_changed');
}
}
@@ -272,7 +272,10 @@ sub _migrate_to_uuids__fstab() {
$fstab_migrated = 1;
}
}
- fs::write_fstab($all_hds) if $fstab_migrated;
+ if ($fstab_migrated) {
+ cp_af('/etc/fstab', '/etc/fstab.before-migrate-to-uuids');
+ fs::write_fstab($all_hds);
+ }
}
sub _migrate_dev_to_uuid {