Skip to content

Commit 6c7c5c0

Browse files
committed
Add optical boot support for ISO images
* UEFI still uses El-Torito for optical boot, so we now also create an 8 MB FAT image with the Shells (but without Mosby, since Mosby requires RW media anyway) that can be used for optical boot. * Also, for transposition to case-sensitive file system with pedantic UEFI implementations, we now follow the bootloader naming case convention exactly as stated in the specs: https://uefi.org/specs/UEFI/2.11/03_Boot_Manager.html#removable-media-boot-behavior * Closes #14. * Also update EDK2 to latest for dress rehearsal before the 202511 EDK2 stable release.
1 parent 83fde42 commit 6c7c5c0

2 files changed

Lines changed: 27 additions & 10 deletions

File tree

.github/workflows/linux_gcc_edk2.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
steps:
3030
- name: Checkout repository and submodules
3131
# Must happen first, else the LoongArch toolchain gets deleted (even with clean: false)
32-
uses: actions/checkout@v4
32+
uses: actions/checkout@v5
3333
with:
3434
# Need fetch-depth: 0 to obtain the EDK2 stable tag
3535
fetch-depth: 0
@@ -38,7 +38,7 @@ jobs:
3838
- name: Install toolchains
3939
run: |
4040
sudo apt-get update
41-
sudo apt-get -y --no-install-recommends install gcc-12-multilib gcc-12-aarch64-linux-gnu gcc-12-arm-linux-gnueabi gcc-12-riscv64-linux-gnu nasm genisoimage uuid-dev
41+
sudo apt-get -y --no-install-recommends install gcc-12-multilib gcc-12-aarch64-linux-gnu gcc-12-arm-linux-gnueabi gcc-12-riscv64-linux-gnu nasm genisoimage uuid-dev dosfstools mtools
4242
sudo ln -s /usr/bin/aarch64-linux-gnu-gcc-12 /usr/bin/aarch64-linux-gnu-gcc
4343
sudo ln -s /usr/bin/aarch64-linux-gnu-gcc-ar-12 /usr/bin/aarch64-linux-gnu-gcc-ar
4444
sudo ln -s /usr/bin/arm-linux-gnueabi-gcc-12 /usr/bin/arm-linux-gnueabi-gcc
@@ -101,12 +101,17 @@ jobs:
101101
- name: Create ISO filesystem structure
102102
run: |
103103
for BUILD_TYPE in ${{ env.BUILD_TYPES }}; do
104-
mkdir -p $BUILD_TYPE/efi/boot
104+
# Follow the casing convention of https://uefi.org/specs/UEFI/2.11/03_Boot_Manager.html#removable-media-boot-behavior
105+
# which means uppercase for everything except the 'x' in 'BOOTx64.EFI'
106+
mkdir -p $BUILD_TYPE/EFI/BOOT
105107
for ARCH in ${{ env.ARCHS }}; do
106-
mv edk2/Build/Shell/${BUILD_TYPE}_${{ env.COMPILER }}/$ARCH/Shell_${{ env.FULL_SHELL_GUID }}.efi $BUILD_TYPE/efi/boot/boot${ARCH,,}.efi
108+
mv edk2/Build/Shell/${BUILD_TYPE}_${{ env.COMPILER }}/$ARCH/Shell_${{ env.FULL_SHELL_GUID }}.efi $BUILD_TYPE/EFI/BOOT/BOOT$ARCH.EFI
107109
done
108-
if [ -f $BUILD_TYPE/efi/boot/bootaarch64.efi ]; then
109-
mv $BUILD_TYPE/efi/boot/bootaarch64.efi $BUILD_TYPE/efi/boot/bootaa64.efi
110+
if [ -f $BUILD_TYPE/EFI/BOOT/BOOTAARCH64.EFI ]; then
111+
mv $BUILD_TYPE/EFI/BOOT/BOOTAARCH64.EFI $BUILD_TYPE/EFI/BOOT/BOOTAA64.EFI
112+
fi
113+
if [ -f $BUILD_TYPE/EFI/BOOT/BOOTX64.EFI ]; then
114+
mv $BUILD_TYPE/EFI/BOOT/BOOTX64.EFI $BUILD_TYPE/EFI/BOOT/BOOTx64.EFI
110115
fi
111116
printf "*** UEFI Shell v%s, release %s%s ***\n\n" ${{ steps.set_version.outputs.shell_version }} ${{ steps.set_version.outputs.shell_release }} "$( [ $BUILD_TYPE == DEBUG ] && echo ' (DEBUG BUILD)')" > $BUILD_TYPE/README.txt
112117
printf "This bootable image contains builds of the official UEFI Shell, as provided by\n" >> $BUILD_TYPE/README.txt
@@ -139,22 +144,34 @@ jobs:
139144
printf "</release>\n" >> Version.xml
140145
done
141146
147+
- name: Create the El-Torito FAT32 disk images
148+
run: |
149+
for BUILD_TYPE in ${{ env.BUILD_TYPES }}; do
150+
# genisoimage requires the El-Torito images to be within the source directory folder even though they
151+
# are completely independent of the ISO-9660 CD-ROM volumes (and not part of the visible file system),
152+
# so we place them into a '[BOOT]/' subfolder that follows 7-zip's virtual image presentation logic.
153+
mkdir "$BUILD_TYPE/[BOOT]"
154+
dd if=/dev/zero of="$BUILD_TYPE/[BOOT]/Boot-NoEmul.img" bs=1M count=8
155+
mkdosfs "$BUILD_TYPE/[BOOT]/Boot-NoEmul.img" -n "UEFI SHELL"
156+
mcopy -s -i "$BUILD_TYPE/[BOOT]/Boot-NoEmul.img" $BUILD_TYPE/EFI/ ::
157+
done
158+
142159
- name: Generate ISO images
143160
run: |
144161
for BUILD_TYPE in ${{ env.BUILD_TYPES }}; do
145-
genisoimage -v -V "UEFI SHELL ${{ steps.set_version.outputs.shell_version }} ${{ steps.set_version.outputs.shell_release }} ($BUILD_TYPE)" -JR -o "UEFI-Shell-${{ steps.set_version.outputs.shell_version }}-${{ steps.set_version.outputs.shell_release }}-$BUILD_TYPE.iso" $BUILD_TYPE
162+
genisoimage -V "UEFI SHELL ${{ steps.set_version.outputs.shell_version }} ${{ steps.set_version.outputs.shell_release }} ($BUILD_TYPE)" -e "[BOOT]/Boot-NoEmul.img" -no-emul-boot -JR -o "UEFI-Shell-${{ steps.set_version.outputs.shell_version }}-${{ steps.set_version.outputs.shell_release }}-$BUILD_TYPE.iso" $BUILD_TYPE
146163
done
147164
148165
- name: Display SHA-256
149166
run: |
150167
for BUILD_TYPE in ${{ env.BUILD_TYPES }}; do
151-
sha256sum $BUILD_TYPE/efi/boot/*.efi
168+
sha256sum $BUILD_TYPE/EFI/BOOT/*.EFI
152169
done
153170
sha256sum *.iso
154171
sha256sum *.efi
155172
156173
- name: Upload ISO artifacts
157-
uses: actions/upload-artifact@v4
174+
uses: actions/upload-artifact@v5
158175
with:
159176
name: ISOs
160177
path: ./*.iso

edk2

Submodule edk2 updated 1720 files

0 commit comments

Comments
 (0)