Skip to content

Commit 145a13b

Browse files
committed
Fix generating a boot image for grub-efi with mkisofs
A boot ISO image for grub-efi is currently generated using the genisoimage-specific option '--efi-boot <grub_image>'. This is accepted by genisoimage and 'xorriso -as genisoimage' but not by mkisofs: > /usr/bin/mkisofs -J -r -input-charset utf-8 -V HelenOS-CD --efi-boot boot/grub/efi.img -o boot/grub/image.iso boot/grub/grub_dist > Bad Option '--efi-boot' (error -1 BADFLAG). When mkisofs is selected during the configure time, run the build command with the equivalent options '-eltorito-platform efi -eltorito-boot <grub_image> -no-emul-boot'.
1 parent 807be7e commit 145a13b

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

boot/grub/meson.build

+5-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,11 @@ grub_image = 'boot/grub' / GRUB_ARCH + '.img'
107107
if GRUB_ARCH == 'pc'
108108
genisoimage_args = [ '-eltorito-boot', grub_image, '-no-emul-boot', '-boot-info-table' ]
109109
elif GRUB_ARCH == 'efi'
110-
genisoimage_args = [ '--efi-boot', grub_image ]
110+
if genisoimage_type == 'mkisofs'
111+
genisoimage_args = [ '-eltorito-platform', 'efi', '-eltorito-boot', grub_image, '-no-emul-boot' ]
112+
else
113+
genisoimage_args = [ '--efi-boot', grub_image ]
114+
endif
111115
endif
112116

113117
image_iso = custom_target('image.iso',

meson/part/tools/meson.build

+12-10
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,20 @@ if debug_shell_scripts
6161
endif
6262

6363
genisoimage = find_program('genisoimage', required: false)
64-
65-
if not genisoimage.found()
64+
if genisoimage.found()
65+
genisoimage_type = 'genisoimage'
66+
else
6667
genisoimage = find_program('mkisofs', required: false)
67-
endif
68-
69-
if not genisoimage.found()
70-
xorriso = find_program('xorriso', required: false)
71-
72-
if xorriso.found()
73-
genisoimage = [ xorriso, '-as', 'genisoimage' ]
68+
if genisoimage.found()
69+
genisoimage_type = 'mkisofs'
7470
else
75-
error('Need genisoimage, mkisofs or xorriso.')
71+
xorriso = find_program('xorriso', required: false)
72+
if xorriso.found()
73+
genisoimage = [ xorriso, '-as', 'genisoimage' ]
74+
genisoimage_type = 'genisoimage'
75+
else
76+
error('Need genisoimage, mkisofs or xorriso.')
77+
endif
7678
endif
7779
endif
7880

0 commit comments

Comments
 (0)