summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2016-10-29 15:59:53 +0100
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2016-11-06 11:48:21 +0000
commit2221fa2a831d9fe8dc72ec60b312e3abac8ebb08 (patch)
tree90e3c33faeaa39ffa2e8490b6a9f9861559f80c8
parentb8c31826370aae933f1943b12cfe7b043b3df8bb (diff)
downloaddrakiso-2221fa2a831d9fe8dc72ec60b312e3abac8ebb08.tar
drakiso-2221fa2a831d9fe8dc72ec60b312e3abac8ebb08.tar.gz
drakiso-2221fa2a831d9fe8dc72ec60b312e3abac8ebb08.tar.bz2
drakiso-2221fa2a831d9fe8dc72ec60b312e3abac8ebb08.tar.xz
drakiso-2221fa2a831d9fe8dc72ec60b312e3abac8ebb08.zip
draklive: automatically generate the EFI boot image (efiboot.img)
-rwxr-xr-xdraklive13
1 files changed, 13 insertions, 0 deletions
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} <kernel options>
));
}
+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');