diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-01-25 13:04:36 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-01-25 13:04:36 +0000 |
commit | 00fa474c6a9f453f01bc9cca6d7f123c8998506a (patch) | |
tree | 37599ca85e462c31b47ffa42fadae418a7438b60 /make_boot_img | |
parent | 2f4eff32e61c253072d3663d5754bc44d2d2ff3d (diff) | |
download | drakx-backup-do-not-use-00fa474c6a9f453f01bc9cca6d7f123c8998506a.tar drakx-backup-do-not-use-00fa474c6a9f453f01bc9cca6d7f123c8998506a.tar.gz drakx-backup-do-not-use-00fa474c6a9f453f01bc9cca6d7f123c8998506a.tar.bz2 drakx-backup-do-not-use-00fa474c6a9f453f01bc9cca6d7f123c8998506a.tar.xz drakx-backup-do-not-use-00fa474c6a9f453f01bc9cca6d7f123c8998506a.zip |
create syslinux_cfg_all() and cleanup using it
Diffstat (limited to 'make_boot_img')
-rwxr-xr-x | make_boot_img | 38 |
1 files 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'); |