summaryrefslogtreecommitdiff
path: root/parabolaiso/mkparabolaiso
diff options
context:
space:
mode:
authorDavid P <megver83@parabola.nu>2022-07-17 21:27:43 -0400
committerDavid P <megver83@parabola.nu>2022-07-17 21:27:43 -0400
commited443bf0566251a929ae466a9196f6c65252e79b (patch)
tree0f35b721a8389a3cdab6e2e454c97bd9364e5ad9 /parabolaiso/mkparabolaiso
parent5db81c454cc4071283800876c49cce5e40895049 (diff)
sync with archiso 3050203
archiso: 3050203 (HEAD -> master, origin/master, origin/HEAD) Merge remote-tracking branch 'origin/merge-requests/273' 211572d Add efibootimg variable in place of full path Signed-off-by: David P <megver83@parabola.nu>
Diffstat (limited to 'parabolaiso/mkparabolaiso')
-rwxr-xr-xparabolaiso/mkparabolaiso42
1 files changed, 22 insertions, 20 deletions
diff --git a/parabolaiso/mkparabolaiso b/parabolaiso/mkparabolaiso
index 3fd3f5b..36b1114 100755
--- a/parabolaiso/mkparabolaiso
+++ b/parabolaiso/mkparabolaiso
@@ -41,6 +41,7 @@ airootfs_image_tool_options=()
cert_list=()
sign_netboot_artifacts=""
declare -A file_permissions=()
+efibootimg=""
efiboot_files=()
# Show an INFO message
@@ -508,9 +509,9 @@ _make_bootmode_bios.syslinux.eltorito() {
# Copy kernel and initramfs to FAT image
_make_boot_on_fat() {
_msg_info "Preparing kernel and initramfs for the FAT file system..."
- mmd -i "${work_dir}/efiboot.img" \
+ mmd -i "${efibootimg}" \
"::/${install_dir}" "::/${install_dir}/boot" "::/${install_dir}/boot/x86_64"
- mcopy -i "${work_dir}/efiboot.img" "${pacstrap_dir}/boot/vmlinuz-"* \
+ mcopy -i "${efibootimg}" "${pacstrap_dir}/boot/vmlinuz-"* \
"${pacstrap_dir}/boot/initramfs-"*".img" "::/${install_dir}/boot/x86_64/"
_msg_info "Done!"
}
@@ -534,23 +535,23 @@ _make_efibootimg() {
)"
# The FAT image must be created with mkfs.fat not mformat, as some systems have issues with mformat made images:
# https://lists.gnu.org/archive/html/grub-devel/2019-04/msg00099.html
- rm -f -- "${work_dir}/efiboot.img"
+ rm -f -- "${efibootimg}"
_msg_info "Creating FAT image of size: ${imgsize_kib} KiB..."
if [[ "${quiet}" == "y" ]]; then
# mkfs.fat does not have a -q/--quiet option, so redirect stdout to /dev/null instead
# https://github.com/dosfstools/dosfstools/issues/103
- mkfs.fat -C -n PARAISO_EFI "${work_dir}/efiboot.img" "${imgsize_kib}" > /dev/null
+ mkfs.fat -C -n PARAISO_EFI "${efibootimg}" "${imgsize_kib}" > /dev/null
else
- mkfs.fat -C -n PARAISO_EFI "${work_dir}/efiboot.img" "${imgsize_kib}"
+ mkfs.fat -C -n PARAISO_EFI "${efibootimg}" "${imgsize_kib}"
fi
# Create the default/fallback boot path in which a boot loaders will be placed later.
- mmd -i "${work_dir}/efiboot.img" ::/EFI ::/EFI/BOOT
+ mmd -i "${efibootimg}" ::/EFI ::/EFI/BOOT
}
# Copy the grub.cfg file in efiboot.img which is used by both IA32 UEFI and x64 UEFI.
_make_efibootimg_grubcfg() {
- mcopy -i "${work_dir}/efiboot.img" \
+ mcopy -i "${efibootimg}" \
"${work_dir}/grub.cfg" ::/EFI/BOOT/grub.cfg
}
@@ -596,14 +597,14 @@ EOF
fi
# Copy GRUB EFI binary to the default/fallback boot path
- mcopy -i "${work_dir}/efiboot.img" \
+ mcopy -i "${efibootimg}" \
"${work_dir}/BOOTIA32.EFI" ::/EFI/BOOT/BOOTIA32.EFI
# Copy GRUB configuration files
_run_once _make_efibootimg_grubcfg
if [[ -e "${pacstrap_dir}/usr/share/edk2-shell/ia32/Shell_Full.efi" ]]; then
- mcopy -i "${work_dir}/efiboot.img" \
+ mcopy -i "${efibootimg}" \
"${pacstrap_dir}/usr/share/edk2-shell/ia32/Shell_Full.efi" ::/shellia32.efi
fi
@@ -674,13 +675,13 @@ EOF
_make_efibootimg "$efiboot_imgsize"
# Copy grub EFI binary to the default/fallback boot path
- mcopy -i "${work_dir}/efiboot.img" \
+ mcopy -i "${efibootimg}" \
"${work_dir}/BOOTx64.EFI" ::/EFI/BOOT/BOOTx64.EFI
_run_once _make_efibootimg_grubcfg
if [[ -e "${pacstrap_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" ]]; then
- mcopy -i "${work_dir}/efiboot.img" \
+ mcopy -i "${efibootimg}" \
"${pacstrap_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" ::/shellx64.efi
fi
@@ -732,22 +733,22 @@ _make_bootmode_uefi-x64.systemd-boot.esp() {
_make_efibootimg "$efiboot_imgsize"
# Copy systemd-boot EFI binary to the default/fallback boot path
- mcopy -i "${work_dir}/efiboot.img" \
+ mcopy -i "${efibootimg}" \
"${pacstrap_dir}/usr/lib/systemd/boot/efi/systemd-bootx64.efi" ::/EFI/BOOT/BOOTx64.EFI
# Copy systemd-boot configuration files
- mmd -i "${work_dir}/efiboot.img" ::/loader ::/loader/entries
- mcopy -i "${work_dir}/efiboot.img" "${profile}/efiboot/loader/loader.conf" ::/loader/
+ mmd -i "${efibootimg}" ::/loader ::/loader/entries
+ mcopy -i "${efibootimg}" "${profile}/efiboot/loader/loader.conf" ::/loader/
for _conf in "${profile}/efiboot/loader/entries/"*".conf"; do
sed "s|%PARABOLAISO_LABEL%|${iso_label}|g;
s|%INSTALL_DIR%|${install_dir}|g;
s|%ARCH%|${arch}|g" \
- "${_conf}" | mcopy -i "${work_dir}/efiboot.img" - "::/loader/entries/${_conf##*/}"
+ "${_conf}" | mcopy -i "${efibootimg}" - "::/loader/entries/${_conf##*/}"
done
# shellx64.efi is picked up automatically when on /
if [[ -e "${pacstrap_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" ]]; then
- mcopy -i "${work_dir}/efiboot.img" \
+ mcopy -i "${efibootimg}" \
"${pacstrap_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" ::/shellx64.efi
fi
@@ -1265,7 +1266,7 @@ _add_xorrisofs_options_uefi-x64.systemd-boot.esp() {
# shellcheck disable=SC2076
[[ " ${xorrisofs_options[*]} " =~ ' -partition_offset ' ]] || xorrisofs_options+=('-partition_offset' '16')
# Attach efiboot.img as a second partition and set its partition type to "EFI system partition"
- xorrisofs_options+=('-append_partition' '2' 'C12A7328-F81F-11D2-BA4B-00A0C93EC93B' "${work_dir}/efiboot.img")
+ xorrisofs_options+=('-append_partition' '2' 'C12A7328-F81F-11D2-BA4B-00A0C93EC93B' "${efibootimg}")
# Ensure GPT is used as some systems do not support UEFI booting without it
# shellcheck disable=SC2076
if [[ " ${bootmodes[*]} " =~ ' bios.syslinux.mbr ' ]]; then
@@ -1312,7 +1313,7 @@ _add_xorrisofs_options_uefi-x64.systemd-boot.eltorito() {
# The ISO will not contain a GPT partition table, so to be able to reference efiboot.img, place it as a
# file inside the ISO 9660 file system
install -d -m 0755 -- "${isofs_dir}/EFI/parabolaiso"
- cp -a -- "${work_dir}/efiboot.img" "${isofs_dir}/EFI/parabolaiso/efiboot.img"
+ cp -a -- "${efibootimg}" "${isofs_dir}/EFI/parabolaiso/efiboot.img"
# systemd-boot in an embedded efiboot.img via El Torito
xorrisofs_options+=(
# Start a new El Torito boot entry for UEFI
@@ -1336,7 +1337,7 @@ _add_xorrisofs_options_uefi-x64.grub.esp() {
# shellcheck disable=SC2076
[[ " ${xorrisofs_options[*]} " =~ ' -partition_offset ' ]] || xorrisofs_options+=('-partition_offset' '16')
# Attach efiboot.img as a second partition and set its partition type to "EFI system partition"
- xorrisofs_options+=('-append_partition' '2' 'C12A7328-F81F-11D2-BA4B-00A0C93EC93B' "${work_dir}/efiboot.img")
+ xorrisofs_options+=('-append_partition' '2' 'C12A7328-F81F-11D2-BA4B-00A0C93EC93B' "${efibootimg}")
# Ensure GPT is used as some systems do not support UEFI booting without it
# shellcheck disable=SC2076
if [[ " ${bootmodes[*]} " =~ ' bios.syslinux.mbr ' ]]; then
@@ -1384,7 +1385,7 @@ _add_xorrisofs_options_uefi-x64.grub.eltorito() {
# The ISO will not contain a GPT partition table, so to be able to reference efiboot.img, place it as a
# file inside the ISO 9660 file system
install -d -m 0755 -- "${isofs_dir}/EFI/parabolaiso"
- cp -a -- "${work_dir}/efiboot.img" "${isofs_dir}/EFI/parabolaiso/efiboot.img"
+ cp -a -- "${efibootimg}" "${isofs_dir}/EFI/parabolaiso/efiboot.img"
# grub in an embedded efiboot.img via El Torito
xorrisofs_options+=(
# Start a new El Torito boot entry for UEFI
@@ -1751,6 +1752,7 @@ _build_buildmode_netboot() {
_build_buildmode_iso() {
local image_name="${iso_name}-${iso_version}-${arch}.iso"
local run_once_mode="${buildmode}"
+ efibootimg="${efibootimg}"
_build_iso_base
_run_once _build_iso_image
}