diff options
-rwxr-xr-x | draklive | 7 | ||||
-rw-r--r-- | lib/MDV/Draklive/Media.pm | 5 |
2 files changed, 10 insertions, 2 deletions
@@ -117,6 +117,9 @@ sub build_grub_cfg_raw { #- FIXME: use the bootloader module from drakx my $grub_part = "(hd0" . (defined $part_idx ? "," . $part_idx : "") . ")"; my $boot = $live->get_media_prefix('boot'); #- FIXME handle boot media + #- remove prefix if installing bootloader on separate /boot partition + $media->{partitions}[$part_idx]{mntpoint} eq $boot and $boot = ""; + my $title = $media->{title} || $live->{media}{title}; join("\n", "timeout " . get_bootloader_timeout($live), @@ -565,7 +568,7 @@ sub create_classical_bootloader { my ($live) = @_; my $initrd_prefix = "/initrd.img"; my $initrd = $live->get_system_root . $live->get_media_prefix('boot') . $initrd_prefix; - my $part_idx = $live->{media}->find_partition_index('/'); + my $part_idx = $live->{media}->find_boot_partition_index; my $oem_rescue_idx = $live->{media}->find_partition_index('OEM_RESCUE'); output_p($live->get_system_root . '/boot/grub/menu.lst', build_grub_cfg_raw($live, $live->{media}, -e $initrd && $initrd_prefix, { oem_rescue_idx => $oem_rescue_idx }, $part_idx)); } @@ -799,7 +802,7 @@ sub install_grub_to_image { mkdir_p($live->{mnt} . $grub_dir); cp_af(glob_($live->get_system_root . "/lib/grub/i386-mandriva/*"), $live->{mnt} . $grub_dir); - my $part_idx = $media->find_partition_index('/'); + my $part_idx = $media->find_boot_partition_index; open(my $grub, "| /sbin/grub --batch --no-floppy"); # using disk loopback fails, have to use image path diff --git a/lib/MDV/Draklive/Media.pm b/lib/MDV/Draklive/Media.pm index 4c7a7f4..4dcc403 100644 --- a/lib/MDV/Draklive/Media.pm +++ b/lib/MDV/Draklive/Media.pm @@ -52,6 +52,11 @@ sub find_partition_index { eval { find_index { $_->{mntpoint} eq $mntpoint } @{$media->{partitions}} }; } +sub find_boot_partition_index { + my ($media) = @_; + $media->find_partition_index('/boot') || $media->find_partition_index('/'); +} + sub supplement_partitions { my ($media, $total_size) = @_; |