diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-04-14 08:20:39 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-04-14 08:20:39 +0000 |
commit | d8b338c82e68b4e17726aed60d191c400c96aa05 (patch) | |
tree | 1af31ffa585e411389a1d58a0728e1e84e0ae5ae | |
parent | 9a67059e7262bdaaabdd2e2d8a3a0a2700ad4bdc (diff) | |
download | drakx-d8b338c82e68b4e17726aed60d191c400c96aa05.tar drakx-d8b338c82e68b4e17726aed60d191c400c96aa05.tar.gz drakx-d8b338c82e68b4e17726aed60d191c400c96aa05.tar.bz2 drakx-d8b338c82e68b4e17726aed60d191c400c96aa05.tar.xz drakx-d8b338c82e68b4e17726aed60d191c400c96aa05.zip |
- bootloader-config:
o fix detecting device.map inconsistency when "/boot" and "/" are not on
same "drive" (esp. when "/" is LVM and "/boot" is not, #39229)
(backport from HEAD)
-rw-r--r-- | perl-install/NEWS | 3 | ||||
-rw-r--r-- | perl-install/bootloader.pm | 24 |
2 files changed, 15 insertions, 12 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS index a1cb6c5ef..e3e3b70d7 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,3 +1,6 @@ +- bootloader-config: + o fix detecting device.map inconsistency when "/boot" and "/" are not on + same "drive" (esp. when "/" is LVM and "/boot" is not, #39229) - drakupdate_fstab: o only add formatted partitions in fstab (or else it will make subsequent boot fail) diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index c35f5aad2..bfe2379d5 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -210,7 +210,7 @@ sub read_grub { my $grub2dev = read_grub_device_map(); my $boot_root = read_grub_install_sh(); - _may_fix_grub2dev($fstab, $grub2dev, $boot_root->{root}); + _may_fix_grub2dev($fstab, $grub2dev, $boot_root->{boot_part}); my $bootloader = read_grub_menu_lst($fstab, $grub2dev) or return; @@ -222,26 +222,26 @@ sub read_grub { } sub _may_fix_grub2dev { - my ($fstab, $grub2dev, $root) = @_; - my $real_root_part = fs::get::root_($fstab) or + my ($fstab, $grub2dev, $boot_part) = @_; + my $real_boot_part = fs::get::root_($fstab, 'boot') or log::l("argh... the fstab given is useless, it doesn't contain '/'"), return; - if (my $prev_root_part = fs::get::device2part(grub2dev($root, $grub2dev), $fstab)) { # the root_device as far as grub config files say - $real_root_part == $prev_root_part and return; + if (my $prev_boot_part = fs::get::device2part(grub2dev($boot_part, $grub2dev), $fstab)) { # the boot_device as far as grub config files say + $real_boot_part == $prev_boot_part and return; } log::l("WARNING: we have detected that device.map is inconsistent with the system"); - my $real_root_dev = $real_root_part->{rootDevice}; + my $real_boot_dev = $real_boot_part->{rootDevice}; - my ($hd_grub, undef, undef) = parse_grub_file($root); - if (my $prev_hd_grub = find { $grub2dev->{$_} eq $real_root_dev } keys %$grub2dev) { + my ($hd_grub, undef, undef) = parse_grub_file($boot_part); + if (my $prev_hd_grub = find { $grub2dev->{$_} eq $real_boot_dev } keys %$grub2dev) { $grub2dev->{$prev_hd_grub} = $grub2dev->{$hd_grub}; - log::l("swapping result: $hd_grub/$real_root_dev and $prev_hd_grub/$grub2dev->{$hd_grub}"); + log::l("swapping result: $hd_grub/$real_boot_dev and $prev_hd_grub/$grub2dev->{$hd_grub}"); } else { - log::l("argh... can't swap, setting $hd_grub to $real_root_dev anyway"); + log::l("argh... can't swap, setting $hd_grub to $real_boot_dev anyway"); } - $grub2dev->{$hd_grub} = $real_root_dev; + $grub2dev->{$hd_grub} = $real_boot_dev; } sub read_grub_install_sh() { @@ -255,7 +255,7 @@ sub read_grub_install_sh() { $h{boot} = $1; } if ($s =~ /^root\s+(\(.*?\))/m) { - $h{root} = $1; + $h{boot_part} = $1; } \%h; } |