diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-09-12 09:38:27 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-09-12 09:38:27 +0000 |
commit | b9904847b8c65a09faac99d6501ed86f09767b2d (patch) | |
tree | 480bcce438cc8ccb548c6469851c8a03a7f2853c /perl-install | |
parent | f3d8180a1566b6269b11c632391604333146e849 (diff) | |
download | drakx-b9904847b8c65a09faac99d6501ed86f09767b2d.tar drakx-b9904847b8c65a09faac99d6501ed86f09767b2d.tar.gz drakx-b9904847b8c65a09faac99d6501ed86f09767b2d.tar.bz2 drakx-b9904847b8c65a09faac99d6501ed86f09767b2d.tar.xz drakx-b9904847b8c65a09faac99d6501ed86f09767b2d.zip |
create read_grub_menu_lst() and read_grub_install_sh()
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/bootloader.pm | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index 07bcdd750..26e3d40c0 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -188,14 +188,35 @@ sub read { sub read_grub { my ($fstab) = @_; + + my $grub2dev = read_grub_device_map(); + + my $bootloader = read_grub_menu_lst($fstab, $grub2dev) or return; + + read_grub_install_sh($bootloader, $grub2dev); + + $bootloader; +} + +sub read_grub_install_sh { + my ($bootloader, $grub2dev) = @_; + + #- 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); + } +} + +sub read_grub_menu_lst { + my ($fstab, $grub2dev) = @_; my $global = 1; my ($e, %b); my $menu_lst_file = "$::prefix/boot/grub/menu.lst"; -e $menu_lst_file or return; - my $grub2dev = read_grub_device_map(); - foreach (cat_($menu_lst_file)) { chomp; s/^\s*//; s/\s*$//; @@ -230,12 +251,6 @@ sub read_grub { } } } - #- 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) { - $b{boot} = grub2dev($1, $grub2dev); - } #- sanitize foreach (@{$b{entries}}) { |