diff options
author | Olivier Blin <oblin@mandriva.com> | 2009-06-29 13:11:28 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2009-06-29 13:11:28 +0000 |
commit | 94bdc0cab5bb8d33fee6b388f9eb9da23c173248 (patch) | |
tree | 159620bd0d6dcf148aaa14b9a4acd91c453a18ba | |
parent | f74bba9e0c827683fc1405c4e41c95bb5f154ec8 (diff) | |
download | draklive-94bdc0cab5bb8d33fee6b388f9eb9da23c173248.tar draklive-94bdc0cab5bb8d33fee6b388f9eb9da23c173248.tar.gz draklive-94bdc0cab5bb8d33fee6b388f9eb9da23c173248.tar.bz2 draklive-94bdc0cab5bb8d33fee6b388f9eb9da23c173248.tar.xz draklive-94bdc0cab5bb8d33fee6b388f9eb9da23c173248.zip |
use part index instead of number
-rwxr-xr-x | draklive | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -106,14 +106,15 @@ sub build_grub_cfg { my ($live, $media, $opts, $device) = @_; #- FIXME? first partition is hardcoded for loopback (master images) my ($part_nb) = $device =~ m!/dev/loop! ? 1 : $device =~ /(\d+)$/; + my $part_idx = $part_nb - 1; my $initrd = $media->get_initrd_path; - build_grub_cfg_raw($live, $media, $initrd, $opts, $part_nb); + build_grub_cfg_raw($live, $media, $initrd, $opts, $part_idx); } sub build_grub_cfg_raw { - my ($live, $media, $initrd, $opts, $part_nb) = @_; + my ($live, $media, $initrd, $opts, $part_idx) = @_; #- FIXME: use the bootloader module from drakx - my $grub_part = "(hd0" . (defined $part_nb ? "," . ($part_nb-1) : "") . ")"; + my $grub_part = "(hd0" . (defined $part_idx ? "," . $part_idx : "") . ")"; my $boot = $live->get_media_prefix('boot'); #- FIXME handle boot media my $title = $media->{title} || $live->{media}{title}; join("\n", @@ -557,8 +558,8 @@ 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_nb = 1; #- FIXME: get from partition layout config - output_p($live->get_system_root . '/boot/grub/menu.lst', build_grub_cfg_raw($live, $live->{media}, -e $initrd && $initrd_prefix, {}, $part_nb)); + my $part_idx = 0; #- FIXME: get from partition layout config + output_p($live->get_system_root . '/boot/grub/menu.lst', build_grub_cfg_raw($live, $live->{media}, -e $initrd && $initrd_prefix, {}, $part_idx)); } sub set_device_label { |