From 00fa474c6a9f453f01bc9cca6d7f123c8998506a Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 25 Jan 2005 13:04:36 +0000 Subject: create syslinux_cfg_all() and cleanup using it --- make_boot_img | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/make_boot_img b/make_boot_img index 183bb38aa..8b7efad9d 100755 --- a/make_boot_img +++ b/make_boot_img @@ -210,7 +210,7 @@ sub initrd { sub entries_append { my ($type) = @_; - my $automatic = $type =~ /cdrom|^all/ ? 'automatic=method:cdrom ' : ''; + my $automatic = $type =~ /cdrom/ ? 'automatic=method:cdrom ' : ''; $automatic .= 'changedisk ' if $type =~ /changedisk/; my @simple_entries = ( @@ -231,6 +231,21 @@ sub entries_append { group_by2(@entries); } +sub syslinux_cfg_all { + my ($type) = @_; + + syslinux_cfg(150, [ + (map { + { kernel => 'alt0/vmlinuz', initrd => 'alt0/all.rdz', %$_ }; + } entries_append($type)), + (map_index { + { label => "alt$::i", kernel => "alt$::i/vmlinuz", initrd => "alt$::i/all.rdz", + append => "$default_append $default_acpi $default_vga" }; + } @kernels), + { label => 'memtest', kernel => 'test/memtest.bin' }, + ]); +} + sub boot_img_i386 { my ($mnt, $type, $I, $img, $kernel) = @_; @@ -704,17 +719,7 @@ sub isolinux { _ "cp /usr/lib/syslinux/isolinux.bin isolinux/isolinux.bin"; _ "install -m 644 -D /boot/memtest* isolinux/test/memtest.bin"; - output("isolinux/isolinux.cfg", - syslinux_cfg(150, [ - (map { - { kernel => 'alt0/vmlinuz', initrd => 'alt0/all.rdz', %$_ }; - } entries_append('all')), - (map_index { - { label => "alt$::i", kernel => "alt$::i/vmlinuz", initrd => "alt$::i/all.rdz", - append => "$default_append $default_acpi $default_vga" }; - } @kernels), - { label => 'memtest', kernel => 'test/memtest.bin' }, - ])); + output("isolinux/isolinux.cfg", syslinux_cfg_all('cdrom')); output("isolinux/help.msg", syslinux_msg('help.msg.xml')); output("isolinux/advanced.msg", syslinux_msg('advanced.msg.xml', @@ -791,12 +796,7 @@ EOF sub boot_iso { my ($iso, $bootcdrom, $kernels) = @_; - my $cfg = cat_('isolinux/isolinux.cfg') or die 'isolinux missing'; - if ($bootcdrom) { - $cfg =~ s/(automatic=method:\w+)/changedisk $1/gm; - } else { - $cfg =~ s/(automatic=method:\w+)//gm; - } + -e 'isolinux/isolinux.cfg' or die 'isolinux missing'; eval { rm_rf('.boot_iso') }; mkdir_p('.boot_iso/isolinux'); @@ -809,7 +809,7 @@ sub boot_iso { my $cfg_file = '.boot_iso/isolinux/isolinux.cfg'; unlink $cfg_file; - output($cfg_file, $cfg); + output($cfg_file, syslinux_cfg_all('cdrom-changedisk')); _ "mkisofs -r -f -J -cache-inodes -V 'Mdk Boot ISO' -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o $iso .boot_iso"; rm_rf('.boot_iso'); -- cgit v1.2.1