From 0d7ae0f998220aed6a923703452660406b2bc40d Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 16 Jun 2005 06:50:04 +0000 Subject: - new grub has files in /lib/grub/i386-pc, copy them in /boot/grub (as done by grub-install) - use "setup" grub command instead of "install" so that it handles stage1.5 embedding if possible, and is simpler --- perl-install/bootloader.pm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'perl-install') diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index fd13a797f..9b1157ba9 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -1266,6 +1266,11 @@ sub grub2file { sub write_grub { my ($bootloader, $all_hds) = @_; + { + my @files = grep { /(stage1|stage2|_stage1_5)$/ } glob("$::prefix/lib/grub/*/*"); + cp_af(@files, "$::prefix/boot/grub"); + } + my $fstab = [ fs::get::fstab($all_hds) ]; my @legacy_floppies = detect_devices::floppies(); my @sorted_hds = sort_hds_according_to_bios($bootloader, $all_hds); @@ -1338,13 +1343,13 @@ sub write_grub { } { my $f = "$::prefix/boot/grub/install.sh"; - my $dev = device_string2grub($bootloader->{boot}, \@legacy_floppies, \@sorted_hds); - my ($stage1, $stage2) = map { $file2grub->(glob("/lib/grub/*/$_")) } qw(stage1 stage2); - my ($menu_lst) = $file2grub->("/boot/grub/menu.lst"); + 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"); - output_with_perm("$::prefix/boot/grub/install.sh", 0755, + output_with_perm($f, 0755, "grub --device-map=/boot/grub/device.map --batch <