summaryrefslogtreecommitdiffstats
path: root/images/make_boot_img
diff options
context:
space:
mode:
authorThomas Backlund <tmb@mageia.org>2015-04-07 19:45:38 +0259
committerThomas Backlund <tmb@mageia.org>2015-04-07 19:45:38 +0259
commit34ffa3faf940b1441f06c1eeb480c232ad734346 (patch)
tree8ffb4df7cc368b55d67b828b87ce4b5e4bca70f3 /images/make_boot_img
parenta49bc1abdfff9451b737a15a2d0a40327d863078 (diff)
downloaddrakx-34ffa3faf940b1441f06c1eeb480c232ad734346.tar
drakx-34ffa3faf940b1441f06c1eeb480c232ad734346.tar.gz
drakx-34ffa3faf940b1441f06c1eeb480c232ad734346.tar.bz2
drakx-34ffa3faf940b1441f06c1eeb480c232ad734346.tar.xz
drakx-34ffa3faf940b1441f06c1eeb480c232ad734346.zip
create efi loader at build time
Diffstat (limited to 'images/make_boot_img')
-rwxr-xr-ximages/make_boot_img27
1 files changed, 26 insertions, 1 deletions
diff --git a/images/make_boot_img b/images/make_boot_img
index f83dc532d..13d365c14 100755
--- a/images/make_boot_img
+++ b/images/make_boot_img
@@ -345,7 +345,32 @@ sub boot_iso {
_ "sed -i 's#\\(append .*\\)\\(splash quiet\\|rescue\\)\$#\\1\\2 automatic=$ENV{BOOT_AUTOMATIC_METHOD}#' .boot_iso/isolinux/isolinux.cfg"
}
- _ "genisoimage -r -f -J -cache-inodes -V 'Mga Boot ISO' -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o $iso .boot_iso";
+ my $arch = arch();
+ my $options = "-J -joliet-long -r -v -T -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table";
+ my $cmd = "mkisofs -U -A 'Mageia-$ENV{DISTRIB_VERSION}-$arch-netinstall' -V 'Mageia-$ENV{DISTRIB_VERSION}-$arch-netinstall' -volset 'Mageia-$ENV{DISTRIB_VERSION}-$arch' $options";
+ # create efi stuff on the fly
+ if ($arch =~ /x86_64/) {
+ _ "mkdir -p .boot_iso/EFI/BOOT/";
+ # create efi loader
+ my $efi_core = "configfile normal boot linux linuxefi loadenv ls reboot search search_label";
+ my $efi_part_fs = "part_msdos part_gpt part_apple fat iso9660 udf";
+ my $efi_gfx = "gfxmenu gfxterm efi_gop efi_uga video video_bochs video_cirrus video_fb font png";
+ _ "/usr/bin/grub2-mkimage --prefix='/EFI/BOOT' -O x86_64-efi -o .boot_iso/EFI/BOOT/bootx64.efi $efi_core $efi_part_fs $efi_gfx";
+ _ "cp -f grub2.config .boot_iso/EFI/BOOT/grub.cfg";
+ # add theme
+ _ "cp -r /boot/grub2/{fonts,themes} .boot_iso/EFI/BOOT/";
+ _ "cp -f grub2.theme .boot_iso/EFI/BOOT/themes/maggy/theme.txt";
+ # create efiboot.img
+ my $efisize = ceil(chomp_(`du -s -k .boot_iso/EFI`) / 1024) * 1024;
+ my $efi_img = ".boot_iso/isolinux/efiboot.img";
+ _ "dd if=/dev/zero of=$efi_img bs=1k count=$efisize";
+ _ "/sbin/mkdosfs -F12 $efi_img";
+ _ "mcopy -s -i $efi_img .boot_iso/EFI ::";
+ # create iso
+ _ "$cmd -eltorito-alt-boot -b isolinux/efiboot.img -no-emul-boot -o $iso .boot_iso";
+ } else {
+ _ "$cmd -o $iso .boot_iso";
+ }
_ "isohybrid -o 1 $iso";
rm_rf('.boot_iso');
}