Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archiso/mkarchiso
diff options
context:
space:
mode:
authornl6720 <nl6720@gmail.com>2023-01-28 13:57:36 +0200
committernl6720 <nl6720@gmail.com>2023-02-24 10:22:36 +0200
commitd96a3569957906eb95a76e302cf75da250cd8337 (patch)
tree8bb7e4238514f678fe0a1a5a016ea546fbde4c81 /archiso/mkarchiso
parentf7502001b0e538bd443cb7ab82539f5aaa7afddb (diff)
mkarchiso: write grubenv in _make_common_bootmode_grub_cfg
Add all variables that we replace with values in configuration files. Keep `${isofs_dir}/${install_dir}/grubenv` with fewer variables for backwards compatibility. It will be removed in the future.
Diffstat (limited to 'archiso/mkarchiso')
-rwxr-xr-xarchiso/mkarchiso22
1 files changed, 22 insertions, 0 deletions
diff --git a/archiso/mkarchiso b/archiso/mkarchiso
index 9acba1a..0ffe0ca 100755
--- a/archiso/mkarchiso
+++ b/archiso/mkarchiso
@@ -618,6 +618,18 @@ fi
EOF
grubembedcfg="${grubembedcfg//'%UUID_SEARCH_FILENAME%'/"${uuid_search_filename}"}"
printf '%s\n' "$grubembedcfg" > "${work_dir}/grub-embed.cfg"
+
+ # Write grubenv
+ printf '%.1024s' \
+ "$(printf '# GRUB Environment Block\nNAME=%s\nVERSION=%s\nARCHISO_LABEL=%s\nINSTALL_DIR=%s\nARCH=%s\nUUID_SEARCH_FILENAME=%s\n%s' \
+ "${iso_name}" \
+ "${iso_version}" \
+ "${iso_label}" \
+ "${install_dir}" \
+ "${arch}" \
+ "${uuid_search_filename}" \
+ "$(printf '%0.1s' "#"{1..1024})")" \
+ > "${work_dir}/grub/grubenv"
}
_make_bootmode_uefi-ia32.grub.esp() {
@@ -1067,6 +1079,10 @@ _export_netboot_artifacts() {
_msg_info "Exporting netboot artifacts..."
install -d -m 0755 "${out_dir}"
cp -a -- "${isofs_dir}/${install_dir}/" "${out_dir}/"
+
+ # Remove grubenv since it serves no purpose in netboot artifacts
+ rm -f -- "${out_dir}/${install_dir}/grubenv"
+
_msg_info "Done!"
du -hs -- "${out_dir}/${install_dir}"
}
@@ -1663,7 +1679,13 @@ _make_version() {
install -d -m 0755 -- "${isofs_dir}/${install_dir}"
# Write version file to ISO 9660
printf '%s\n' "${iso_version}" > "${isofs_dir}/${install_dir}/version"
+
+ fi
+ if [[ "${buildmode}" == "iso" ]]; then
# Write grubenv with version information to ISO 9660
+ # TODO: after sufficient time has passed, do not create this file anymore when GRUB boot modes are used.
+ # _make_common_bootmode_grub_cfg already creates ${isofs_dir}/boot/grub/grubenv
+ rm -f -- "${isofs_dir}/${install_dir}/grubenv"
printf '%.1024s' "$(printf '# GRUB Environment Block\nNAME=%s\nVERSION=%s\n%s' \
"${iso_name}" "${iso_version}" "$(printf '%0.1s' "#"{1..1024})")" \
> "${isofs_dir}/${install_dir}/grubenv"