diff options
author | Olivier Blin <oblin@mandriva.com> | 2009-05-26 16:33:40 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2009-05-26 16:33:40 +0000 |
commit | 4bcc83c24946c0d9b9049aaaede6a37b47d2c193 (patch) | |
tree | a5fd2a4c510b55100be6fa0e5c0a79f3cdb4864f | |
parent | 2bb12d8edd036e851e6f2ddd6230c1419ea55576 (diff) | |
download | drakiso-4bcc83c24946c0d9b9049aaaede6a37b47d2c193.tar drakiso-4bcc83c24946c0d9b9049aaaede6a37b47d2c193.tar.gz drakiso-4bcc83c24946c0d9b9049aaaede6a37b47d2c193.tar.bz2 drakiso-4bcc83c24946c0d9b9049aaaede6a37b47d2c193.tar.xz drakiso-4bcc83c24946c0d9b9049aaaede6a37b47d2c193.zip |
do not add initrd in grub menu if it does not exist
-rwxr-xr-x | draklive | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -124,7 +124,7 @@ sub build_grub_cfg_raw { my ($name, $cmdline) = @$_; "title " . $title . if_($name, " ($name)"), "kernel $grub_part" . $boot . "/vmlinuz " . get_default_append($live, $opts) . if_($cmdline, " $cmdline"), - "initrd " . $boot . $initrd; + if_($initrd, "initrd " . $boot . $initrd); } group_by2('' => '', @{$live->{system}{boot_entries}})), "", ); @@ -555,8 +555,10 @@ $live->{media}{title} <kernel options> 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}, "/initrd.img", {}, $part_nb)); + output_p($live->get_system_root . '/boot/grub/menu.lst', build_grub_cfg_raw($live, $live->{media}, -e $initrd && $initrd_prefix, {}, $part_nb)); } sub set_device_label { |