Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archiso
diff options
context:
space:
mode:
authornl6720 <nl6720@gmail.com>2023-03-16 09:22:57 +0200
committernl6720 <nl6720@gmail.com>2023-05-17 15:23:18 +0300
commit094afd169a0ff871eb7a6b37d68a9b9bcb7195e4 (patch)
tree22720913309ddbb515e0565bc114701f8eaf60f5 /archiso
parentb468327442d3f57da214b988e4c71d9e96ce46f9 (diff)
mkarchiso: support %ARCHISO_UUID% variable in boot loader configuration
It will be replaced with the ISO's modification date in UTC, i.e. its "UUID". This allows to replace `archisolabel=%ARCHISO_LABEL%` with `archisodevice=UUID=%ARCHISO_UUID%` in boot loader configurations. Related to #202
Diffstat (limited to 'archiso')
-rwxr-xr-xarchiso/mkarchiso14
1 files changed, 9 insertions, 5 deletions
diff --git a/archiso/mkarchiso b/archiso/mkarchiso
index e991b52..afaeb6e 100755
--- a/archiso/mkarchiso
+++ b/archiso/mkarchiso
@@ -29,6 +29,7 @@ gpg_key=""
gpg_sender=""
iso_name=""
iso_label=""
+iso_uuid=""
iso_publisher=""
iso_application=""
iso_version=""
@@ -446,6 +447,7 @@ _make_bootmode_bios.syslinux.mbr() {
install -d -m 0755 -- "${isofs_dir}/boot/syslinux"
for _cfg in "${profile}/syslinux/"*.cfg; do
sed "s|%ARCHISO_LABEL%|${iso_label}|g;
+ s|%ARCHISO_UUID%|${iso_uuid}|g;
s|%INSTALL_DIR%|${install_dir}|g;
s|%ARCH%|${arch}|g" \
"${_cfg}" > "${isofs_dir}/boot/syslinux/${_cfg##*/}"
@@ -558,21 +560,20 @@ _make_common_bootmode_grub_copy_to_isofs() {
# Prepare GRUB configuration files
_make_common_bootmode_grub_cfg(){
- local _cfg archiso_uuid search_filename
+ local _cfg search_filename
install -d -- "${work_dir}/grub"
- # Precalculate the ISO's modification date in UTC, i.e. its "UUID"
- TZ=UTC printf -v archiso_uuid '%(%F-%H-%M-%S-00)T' "$SOURCE_DATE_EPOCH"
# Create a /boot/grub/YYYY-mm-dd-HH-MM-SS-00.uuid file on ISO 9660. GRUB will search for it to find the ISO
# volume. This is similar to what grub-mkrescue does, except it places the file in /.disk/, but we opt to use a
# directory that does not start with a dot to avoid it being accidentally missed when copying the ISO's contents.
- : > "${work_dir}/grub/${archiso_uuid}.uuid"
- search_filename="/boot/grub/${archiso_uuid}.uuid"
+ : > "${work_dir}/grub/${iso_uuid}.uuid"
+ search_filename="/boot/grub/${iso_uuid}.uuid"
# Fill GRUB configuration files
for _cfg in "${profile}/grub/"*'.cfg'; do
sed "s|%ARCHISO_LABEL%|${iso_label}|g;
+ s|%ARCHISO_UUID%|${iso_uuid}|g;
s|%INSTALL_DIR%|${install_dir}|g;
s|%ARCH%|${arch}|g;
s|%ARCHISO_SEARCH_FILENAME%|${search_filename}|g" \
@@ -821,6 +822,7 @@ _make_bootmode_uefi-x64.systemd-boot.esp() {
mcopy -i "${efibootimg}" "${profile}/efiboot/loader/loader.conf" ::/loader/
for _conf in "${profile}/efiboot/loader/entries/"*".conf"; do
sed "s|%ARCHISO_LABEL%|${iso_label}|g;
+ s|%ARCHISO_UUID%|${iso_uuid}|g;
s|%INSTALL_DIR%|${install_dir}|g;
s|%ARCH%|${arch}|g" \
"${_conf}" | mcopy -i "${efibootimg}" - "::/loader/entries/${_conf##*/}"
@@ -1660,6 +1662,8 @@ _set_overrides() {
# Set variables that do not have overrides
[[ -n "$airootfs_image_type" ]] || airootfs_image_type="squashfs"
[[ -n "$iso_name" ]] || iso_name="${app_name}"
+ # Precalculate the ISO's modification date in UTC, i.e. its "UUID"
+ TZ=UTC printf -v iso_uuid '%(%F-%H-%M-%S-00)T' "$SOURCE_DATE_EPOCH"
}
_export_gpg_publickey() {