Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornl6720 <nl6720@gmail.com>2024-04-01 19:23:12 +0300
committernl6720 <nl6720@gmail.com>2024-04-01 19:29:26 +0300
commit4136bfe085c8900452390d6521f872b439196fa9 (patch)
treee7ed4a95651ad5e60ab87371125560acbf5f9254
parent7b1d6a7b14b08a8d2cebb1321fd3ed93ab920f12 (diff)
mkarchiso: copy Memtest86+ for uefi-x64.systemd-boot.* boot modes
If the Memtest86+ EFI binary exists, copy it to the EFI system partition (`efiboot.img`) and also to ISO 9660. Implements https://gitlab.archlinux.org/archlinux/archiso/-/issues/228
-rw-r--r--CHANGELOG.rst2
-rwxr-xr-xarchiso/mkarchiso26
2 files changed, 27 insertions, 1 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 9a7e255..16359f1 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -8,6 +8,8 @@ Changelog
Added
-----
+- Copy Memtest86+ EFI binary to the EFI system partition and ISO 9660 for ``uefi-x86.systemd-boot`` boot modes.
+
Changed
-------
diff --git a/archiso/mkarchiso b/archiso/mkarchiso
index e3b582f..5d175e2 100755
--- a/archiso/mkarchiso
+++ b/archiso/mkarchiso
@@ -848,13 +848,16 @@ _make_common_bootmode_systemd-boot() {
# shellcheck disable=SC2076
if [[ " ${bootmodes[*]} " =~ ' uefi-x64.systemd-boot.esp ' || " ${bootmodes[*]} " =~ ' uefi-x64.systemd-boot.eltorito ' ]]; then
efiboot_files+=("${pacstrap_dir}/usr/lib/systemd/boot/efi/systemd-bootx64.efi"
- "${pacstrap_dir}/usr/share/edk2-shell/x64/Shell_Full.efi")
+ "${pacstrap_dir}/usr/share/edk2-shell/x64/Shell_Full.efi"
+ "${pacstrap_dir}/boot/memtest86+/memtest.efi"
+ "${pacstrap_dir}/usr/share/licenses/spdx/GPL-2.0-only.txt")
fi
# shellcheck disable=SC2076
if [[ " ${bootmodes[*]} " =~ ' uefi-ia32.systemd-boot.esp ' || " ${bootmodes[*]} " =~ ' uefi-ia32.systemd-boot.eltorito ' ]]; then
efiboot_files+=("${pacstrap_dir}/usr/lib/systemd/boot/efi/systemd-bootia32.efi"
"${pacstrap_dir}/usr/share/edk2-shell/ia32/Shell_Full.efi")
fi
+
efiboot_files+=("${work_dir}/loader/"
"${pacstrap_dir}/boot/vmlinuz-"*
"${pacstrap_dir}/boot/initramfs-"*".img"
@@ -912,6 +915,15 @@ _make_bootmode_uefi-x64.systemd-boot.esp() {
"${pacstrap_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" ::/shellx64.efi
fi
+ # Copy Memtest86+
+ if [[ -e "${pacstrap_dir}/boot/memtest86+/memtest.efi" ]]; then
+ mmd -i "${efibootimg}" ::/boot ::/boot/memtest86+
+ mcopy -i "${efibootimg}" \
+ "${pacstrap_dir}/boot/memtest86+/memtest.efi" ::/boot/memtest86+/
+ mcopy -i "${efibootimg}" \
+ "${pacstrap_dir}/usr/share/licenses/spdx/GPL-2.0-only.txt" ::/boot/memtest86+/LICENSE
+ fi
+
# Copy kernel and initramfs to FAT image.
# systemd-boot can only access files from the EFI system partition it was launched from.
_run_once _make_boot_on_fat
@@ -947,6 +959,13 @@ _make_bootmode_uefi-x64.systemd-boot.eltorito() {
install -m 0644 -- "${pacstrap_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" "${isofs_dir}/shellx64.efi"
fi
+ # Copy Memtest86+
+ if [[ -e "${pacstrap_dir}/boot/memtest86+/memtest.efi" ]]; then
+ install -d -m 0755 -- "${isofs_dir}/boot/memtest86+/"
+ install -m 0644 -- "${pacstrap_dir}/boot/memtest86+/memtest.efi" "${isofs_dir}/boot/memtest86+/memtest.efi"
+ install -m 0644 -- "${pacstrap_dir}/usr/share/licenses/spdx/GPL-2.0-only.txt" "${isofs_dir}/boot/memtest86+/LICENSE"
+ fi
+
_msg_info "Done!"
}
@@ -1098,6 +1117,11 @@ _validate_requirements_bootmode_uefi-x64.systemd-boot.esp() {
_msg_error "Validating '${bootmode}': cannot be used with bootmode uefi-x64.grub.esp!" 0
fi
_validate_requirements_common_systemd-boot
+
+ # shellcheck disable=SC2076
+ if [[ ! " ${pkg_list[*]} " =~ ' memtest86+-efi ' ]]; then
+ _msg_info "Validating '${bootmode}': 'memtest86+-efi' is not in the package list. Memory testing will not be available from systemd-boot."
+ fi
}
_validate_requirements_bootmode_uefi-x64.systemd-boot.eltorito() {