From 2221fa2a831d9fe8dc72ec60b312e3abac8ebb08 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sat, 29 Oct 2016 15:59:53 +0100 Subject: draklive: automatically generate the EFI boot image (efiboot.img) --- draklive | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/draklive b/draklive index 27710a8..a2e49f4 100755 --- a/draklive +++ b/draklive @@ -561,6 +561,8 @@ sub create_bootloader { } else { create_classical_bootloader($live); } + + create_efi_boot_image($live) if ($live->{settings}{arch} eq 'x86_64'); } sub remove_unneeded_bootlogo_locales { @@ -649,6 +651,17 @@ $live->{media}{title} )); } +sub create_efi_boot_image { + my ($live) = @_; + my $src_dir = $live->get_builddir . $live->{prefix}{build}{files} . '/EFI'; + my $dst_dir = $live->get_builddir . $live->{prefix}{build}{files} . '/boot'; + mkdir_p($dst_dir); + my $boot_image = $dst_dir . '/efiboot.img'; + eval { rm_rf($boot_image) }; + run_("/sbin/mkdosfs", "-F12", "-C", $boot_image, "4096"); + run_("mcopy", "-s", "-i", $boot_image, $src_dir, "::"); +} + sub create_media_bootloader { my ($live) = @_; cp_f($live->get_system_root . '/boot/vmlinuz-' . $live->find_kernel->{version}, $live->get_builddir . $live->{prefix}{build}{boot} . '/vmlinuz'); -- cgit v1.2.1