From 87605d8be1c3e4939f208c4df271fae7cfb89eec Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Wed, 12 Nov 2008 14:16:50 +0000 Subject: write a /boot/grub/install.sh script when installing grub, and run grub in chroot (requires to bind-mount the image inside its mount point) --- draklive | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/draklive b/draklive index d19baf8..44555ce 100755 --- a/draklive +++ b/draklive @@ -705,16 +705,35 @@ sub record_cdrom_master { sub install_grub_to_image { my ($live, $img) = @_; - cp_af(glob_($live->get_system_root . "/lib/grub/i386-mandriva/*"), $live->{mnt} . "/boot/grub"); - open(my $grub, "| /sbin/grub --batch --no-floppy"); - # using disk loopback fails, have to use image path - print $grub <get_system_root . "/lib/grub/i386-mandriva/*"), $live->{mnt} . $grub_dir); + + output($live->{mnt} . $grub_script, <{mnt} . $hd_tmp); + run_("mount", "--bind", $img, $live->{mnt} . $hd_tmp); + } + my $hd0 = $hd_tmp || $img; + + # using disk loopback fails, have to use image path + output($live->{mnt} . $grub_device_map, "(hd0) $hd0"); + run_({ root => $live->{mnt} }, $grub_script); + unlink $live->{mnt} . $grub_device_map; + + if ($hd_tmp) { + run_("umount", $live->{mnt} . $hd_tmp); + unlink $live->{mnt} . $hd_tmp; + } } sub install_usb_bootloader { -- cgit v1.2.1