From 52102af9f98f888d876079182eed1fbc8c681ff2 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 21 Mar 2008 15:18:05 +0000 Subject: prepare next commit --- perl-install/bootloader.pm | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'perl-install') diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index 3b229aecc..a9691938e 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -212,20 +212,27 @@ sub read_grub { my $bootloader = read_grub_menu_lst($fstab, $grub2dev) or return; - read_grub_install_sh($bootloader, $grub2dev); + if (my $boot = read_grub_install_sh()->{boot}) { + $bootloader->{boot} = grub2dev($boot, $grub2dev); + } $bootloader; } -sub read_grub_install_sh { - my ($bootloader, $grub2dev) = @_; +sub read_grub_install_sh() { + my $s = cat_("$::prefix/boot/grub/install.sh"); + my %h; #- matches either: #- setup (hd0) #- install (hd0,0)/boot/grub/stage1 d (hd0) (hd0,0)/boot/grub/stage2 p (hd0,0)/boot/grub/menu.lst - if (cat_("$::prefix/boot/grub/install.sh") =~ /^(?:setup.*|install\s.*\sd)\s+(\(.*?\))/m) { - $bootloader->{boot} = grub2dev($1, $grub2dev); + if ($s =~ /^(?:setup.*|install\s.*\sd)\s+(\(.*?\))/m) { + $h{boot} = $1; } + if ($s =~ /^root\s+(\(.*?\))/m) { + $h{root} = $1; + } + \%h; } sub read_grub_menu_lst { -- cgit v1.2.1