summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2009-08-03 10:02:48 +0000
committerOlivier Blin <oblin@mandriva.com>2009-08-03 10:02:48 +0000
commitc72d7bdafa5400200ab12301e29417689658ac5e (patch)
tree5eb177046775b263849999478dc13f6901638e9a
parenta9fa8e298ae530af842dce7be92c32cfd3a34626 (diff)
downloaddraklive-c72d7bdafa5400200ab12301e29417689658ac5e.tar
draklive-c72d7bdafa5400200ab12301e29417689658ac5e.tar.gz
draklive-c72d7bdafa5400200ab12301e29417689658ac5e.tar.bz2
draklive-c72d7bdafa5400200ab12301e29417689658ac5e.tar.xz
draklive-c72d7bdafa5400200ab12301e29417689658ac5e.zip
allow to install bootloader on separate /boot partition
-rwxr-xr-xdraklive7
-rw-r--r--lib/MDV/Draklive/Media.pm5
2 files changed, 10 insertions, 2 deletions
diff --git a/draklive b/draklive
index 6434bbb..d52724e 100755
--- a/draklive
+++ b/draklive
@@ -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) = @_;