Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornl6720 <nl6720@gmail.com>2023-01-22 12:02:35 +0200
committernl6720 <nl6720@gmail.com>2023-02-02 11:49:15 +0200
commit8d7ad3c629e1a2d0cb2f2008e62ea979639230e7 (patch)
treee6816987563f60bc32e7607a4a15ac45f6b9cacb
parentab3d78860e1dc4cd157e455a7071cc9e8a99a772 (diff)
mkarchiso: write a .uuid file to /.disk/ on ISO 9660 to allow GRUB to search for it
Create a `/.disk/INSERT_UUID_HERE.uuid` file to implement something called "file system transposition". See https://www.mail-archive.com/grub-devel@gnu.org/msg34346.html for the proposal of it for grub-mkrescue. This will allow GRUB to search for the volume containing the file instead of hardcoding the ISO volume label or another file system or partition attribute in GRUB configuration. By only relying on the directory structure simplifies supporting medium preparation methods with manual partitioning such as https://wiki.archlinux.org/title/USB_flash_installation_medium#In_GNU/Linux_4
-rwxr-xr-xarchiso/mkarchiso11
1 files changed, 9 insertions, 2 deletions
diff --git a/archiso/mkarchiso b/archiso/mkarchiso
index 7331bb0..f8a3df1 100755
--- a/archiso/mkarchiso
+++ b/archiso/mkarchiso
@@ -569,7 +569,13 @@ _make_common_bootmode_grub_copy_to_isofs() {
# Prepare GRUB configuration files
_make_common_bootmode_grub_cfg(){
- local _cfg
+ local _cfg uuid_search_filename
+
+ # Create a .uuid file and place it in /.disk/ on ISO 9660 to provide a way for GRUB to search for the volume
+ uuid_search_filename="$(uuidgen --sha1 --namespace 93a870ff-8565-4cf3-a67b-f47299271a96 \
+ --name "${SOURCE_DATE_EPOCH} disk search UUID")"
+ install -d -m 0755 -- "${isofs_dir}/.disk"
+ : > "${isofs_dir}/.disk/${uuid_search_filename}.uuid"
install -d -- "${work_dir}/grub"
@@ -577,7 +583,8 @@ _make_common_bootmode_grub_cfg(){
for _cfg in "${profile}/grub/"*'.cfg'; do
sed "s|%ARCHISO_LABEL%|${iso_label}|g;
s|%INSTALL_DIR%|${install_dir}|g;
- s|%ARCH%|${arch}|g" \
+ s|%ARCH%|${arch}|g;
+ s|%UUID_SEARCH_FILENAME%|${uuid_search_filename}|g" \
"${_cfg}" > "${work_dir}/grub/${_cfg##*/}"
done
# Add all GRUB files to the list of files used to calculate the required FAT image size.