From ab3d78860e1dc4cd157e455a7071cc9e8a99a772 Mon Sep 17 00:00:00 2001 From: nl6720 Date: Sun, 29 Jan 2023 11:11:38 +0200 Subject: Update URLs * Update mkinitcpio-archiso project link, * Update code of conduct link, * Update arch-releng mailing list link, * Use HTTPS where possible, * Replace dead link. --- configs/releng/syslinux/archiso_head.cfg | 2 +- configs/releng/syslinux/archiso_tail.cfg | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'configs') diff --git a/configs/releng/syslinux/archiso_head.cfg b/configs/releng/syslinux/archiso_head.cfg index 1154f78..671ab4e 100644 --- a/configs/releng/syslinux/archiso_head.cfg +++ b/configs/releng/syslinux/archiso_head.cfg @@ -12,7 +12,7 @@ MENU CMDLINEROW 14 MENU HELPMSGROW 16 MENU HELPMSGENDROW 29 -# Refer to http://syslinux.zytor.com/wiki/index.php/Doc/menu +# Refer to https://wiki.syslinux.org/wiki/index.php/Comboot/menu.c32 MENU COLOR border 30;44 #40ffffff #a0000000 std MENU COLOR title 1;36;44 #9033ccff #a0000000 std diff --git a/configs/releng/syslinux/archiso_tail.cfg b/configs/releng/syslinux/archiso_tail.cfg index e5339a2..dcbb413 100644 --- a/configs/releng/syslinux/archiso_tail.cfg +++ b/configs/releng/syslinux/archiso_tail.cfg @@ -7,12 +7,12 @@ MENU LABEL Boot existing OS COM32 chain.c32 APPEND hd0 0 -# http://www.memtest.org/ +# https://www.memtest.org/ LABEL memtest MENU LABEL Run Memtest86+ (RAM test) LINUX /%INSTALL_DIR%/boot/memtest -# http://hdt-project.org/ +# https://wiki.syslinux.org/wiki/index.php/Hdt_(Hardware_Detection_Tool) LABEL hdt MENU LABEL Hardware Information (HDT) COM32 hdt.c32 -- cgit v1.2.3-70-g09d2 From 3f95d391eff6145e0546b8c0b69bd2851fc3c400 Mon Sep 17 00:00:00 2001 From: nl6720 Date: Sun, 22 Jan 2023 12:17:51 +0200 Subject: configs/*/grub/grub.cfg: search for a .uuid file in /.disk/ and use the volume it's on Search for `/.disk/%UUID_SEARCH_FILENAME%.uuid` and pass the UUID of the volume it's on as `archisodevice`. mkarchiso will replace `%UUID_SEARCH_FILENAME%` with a hardcoded value generated using `SOURCE_DATE_EPOCH` durring ISO build. This allows to prepare an UEFI bootable installation medium by simply copying the directory structure without having to touch `grub.cfg`. Relying on the volume UUID instead of its LABEL also avoids collisions of multiple ISOs created in the same month. Fixes #202 --- CHANGELOG.rst | 7 +++++++ configs/baseline/grub/grub.cfg | 8 ++++++-- configs/releng/grub/grub.cfg | 14 +++++++------- 3 files changed, 20 insertions(+), 9 deletions(-) (limited to 'configs') diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 66ffe75..f6a6f25 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,9 +8,16 @@ Changelog Added ----- +- Support *file system transposition* to simplify boot medium preparation for UEFI boot via extracting the ISO image + contents to a drive. ``grub.cfg`` does not hardcode the ISO volume label anymore, instead GRUB will search for volume + with a ``/.disk/%UUID_SEARCH_FILENAME%.uuid`` file on it. + Changed ------- +- Identify the ISO volume via a UUID instead of a file system label to avoid collisions of multiple ISOs created in the + same month. + Removed ------- diff --git a/configs/baseline/grub/grub.cfg b/configs/baseline/grub/grub.cfg index d2aa4ab..7d73fe6 100644 --- a/configs/baseline/grub/grub.cfg +++ b/configs/baseline/grub/grub.cfg @@ -20,6 +20,11 @@ if serial --unit=0 --speed=115200; then terminal_output --append serial fi +# Search for the ISO volume +regexp --set=1:ARCHISO_HINT '^\(([^)]+)\)' "${cmdpath}" +search --no-floppy --set=root --file '/.disk/%UUID_SEARCH_FILENAME%.uuid' --hint "${ARCHISO_HINT}" +probe --set ARCHISO_UUID --fs-uuid "${root}" + # Set default menu entry default=archlinux timeout=15 @@ -30,7 +35,6 @@ timeout_style=menu menuentry "Arch Linux (x86_64, UEFI)" --class arch --class gnu-linux --class gnu --class os --id 'archlinux' { set gfxpayload=keep - search --no-floppy --set=root --label %ARCHISO_LABEL% - linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% + linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux archisobasedir=%INSTALL_DIR% archisodevice=/dev/disk/by-uuid/${ARCHISO_UUID} initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux.img } diff --git a/configs/releng/grub/grub.cfg b/configs/releng/grub/grub.cfg index 79ea2d2..ddd8af2 100644 --- a/configs/releng/grub/grub.cfg +++ b/configs/releng/grub/grub.cfg @@ -20,6 +20,11 @@ if serial --unit=0 --speed=115200; then terminal_output --append serial fi +# Search for the ISO volume +regexp --set=1:ARCHISO_HINT '^\(([^)]+)\)' "${cmdpath}" +search --no-floppy --set=root --file '/.disk/%UUID_SEARCH_FILENAME%.uuid' --hint "${ARCHISO_HINT}" +probe --set ARCHISO_UUID --fs-uuid "${root}" + # Set default menu entry default=archlinux timeout=15 @@ -32,15 +37,13 @@ play 600 988 1 1319 4 menuentry "Arch Linux install medium (x86_64, UEFI)" --class arch --class gnu-linux --class gnu --class os --id 'archlinux' { set gfxpayload=keep - search --no-floppy --set=root --label %ARCHISO_LABEL% - linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% + linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux archisobasedir=%INSTALL_DIR% archisodevice=/dev/disk/by-uuid/${ARCHISO_UUID} initrd /%INSTALL_DIR%/boot/intel-ucode.img /%INSTALL_DIR%/boot/amd-ucode.img /%INSTALL_DIR%/boot/x86_64/initramfs-linux.img } menuentry "Arch Linux install medium with speakup screen reader (x86_64, UEFI)" --hotkey s --class arch --class gnu-linux --class gnu --class os --id 'archlinux-accessibility' { set gfxpayload=keep - search --no-floppy --set=root --label %ARCHISO_LABEL% - linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% accessibility=on + linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux archisobasedir=%INSTALL_DIR% archisodevice=/dev/disk/by-uuid/${ARCHISO_UUID} accessibility=on initrd /%INSTALL_DIR%/boot/intel-ucode.img /%INSTALL_DIR%/boot/amd-ucode.img /%INSTALL_DIR%/boot/x86_64/initramfs-linux.img } @@ -48,18 +51,15 @@ if [ "${grub_platform}" == "efi" ]; then if [ "${grub_cpu}" == "x86_64" ]; then menuentry "Run Memtest86+ (RAM test)" --class memtest86 --class gnu --class tool { set gfxpayload=800x600,1024x768 - search --fs-uuid --no-floppy --set=root --label %ARCHISO_LABEL% linux /%INSTALL_DIR%/boot/memtest.efi } menuentry "UEFI Shell" { insmod chain - search --no-floppy --set=root --label %ARCHISO_LABEL% chainloader /shellx64.efi } elif [ "${grub_cpu}" == "i386" ]; then menuentry "UEFI Shell" { insmod chain - search --no-floppy --set=root --label %ARCHISO_LABEL% chainloader /shellia32.efi } fi -- cgit v1.2.3-70-g09d2 From 5587e031f34d7cd1828012596453bc9b2c8be26b Mon Sep 17 00:00:00 2001 From: nl6720 Date: Sun, 22 Jan 2023 13:32:54 +0200 Subject: Preload GRUB's NTFS, exFAT and UDF modules There are claims that some UEFI allegedly natively support NTFS. Preload the required GRUB modules to support booting from NTFS on such systems. Additionally preload the exFAT and UEF modules, because, why not? --- CHANGELOG.rst | 2 ++ archiso/mkarchiso | 16 ++++++++-------- configs/baseline/grub/grub.cfg | 4 ++++ configs/releng/grub/grub.cfg | 4 ++++ 4 files changed, 18 insertions(+), 8 deletions(-) (limited to 'configs') diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f6a6f25..e2dfa9e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,6 +11,8 @@ Added - Support *file system transposition* to simplify boot medium preparation for UEFI boot via extracting the ISO image contents to a drive. ``grub.cfg`` does not hardcode the ISO volume label anymore, instead GRUB will search for volume with a ``/.disk/%UUID_SEARCH_FILENAME%.uuid`` file on it. +- Preload GRUB's NTFS modules for UEFI that allegedly have native NTFS support. GRUB's exFAT and UDF modules are also + preloaded in case someone finds them useful. Changed ------- diff --git a/archiso/mkarchiso b/archiso/mkarchiso index f8a3df1..c1a8c22 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -612,11 +612,11 @@ _make_bootmode_uefi-ia32.grub.esp() { # Create EFI binary # Module list from https://bugs.archlinux.org/task/71382#comment202911 - grubmodules=(all_video at_keyboard boot btrfs cat chain configfile echo efifwsetup efinet ext2 f2fs fat font \ + grubmodules=(all_video at_keyboard boot btrfs cat chain configfile echo efifwsetup efinet exfat ext2 f2fs fat font \ gfxmenu gfxterm gzio halt hfsplus iso9660 jpeg keylayouts linux loadenv loopback lsefi lsefimmap \ - minicmd normal part_apple part_gpt part_msdos png read reboot regexp search search_fs_file \ - search_fs_uuid search_label serial sleep tpm usb usbserial_common usbserial_ftdi usbserial_pl2303 \ - usbserial_usbdebug video xfs zstd) + minicmd normal ntfs ntfscomp part_apple part_gpt part_msdos png read reboot regexp search \ + search_fs_file search_fs_uuid search_label serial sleep tpm udf usb usbserial_common usbserial_ftdi \ + usbserial_pl2303 usbserial_usbdebug video xfs zstd) grub-mkstandalone -O i386-efi \ --modules="${grubmodules[*]}" \ --locales="en@quot" \ @@ -689,11 +689,11 @@ _make_bootmode_uefi-x64.grub.esp() { # Create EFI binary # Module list from https://bugs.archlinux.org/task/71382#comment202911 - grubmodules=(all_video at_keyboard boot btrfs cat chain configfile echo efifwsetup efinet ext2 f2fs fat font \ + grubmodules=(all_video at_keyboard boot btrfs cat chain configfile echo efifwsetup efinet exfat ext2 f2fs fat font \ gfxmenu gfxterm gzio halt hfsplus iso9660 jpeg keylayouts linux loadenv loopback lsefi lsefimmap \ - minicmd normal part_apple part_gpt part_msdos png read reboot regexp search search_fs_file \ - search_fs_uuid search_label serial sleep tpm usb usbserial_common usbserial_ftdi usbserial_pl2303 \ - usbserial_usbdebug video xfs zstd) + minicmd normal ntfs ntfscomp part_apple part_gpt part_msdos png read reboot regexp search \ + search_fs_file search_fs_uuid search_label serial sleep tpm udf usb usbserial_common usbserial_ftdi \ + usbserial_pl2303 usbserial_usbdebug video xfs zstd) grub-mkstandalone -O x86_64-efi \ --modules="${grubmodules[*]}" \ --locales="en@quot" \ diff --git a/configs/baseline/grub/grub.cfg b/configs/baseline/grub/grub.cfg index 7d73fe6..d606b10 100644 --- a/configs/baseline/grub/grub.cfg +++ b/configs/baseline/grub/grub.cfg @@ -3,6 +3,10 @@ insmod part_gpt insmod part_msdos insmod fat insmod iso9660 +insmod ntfs +insmod ntfscomp +insmod exfat +insmod udf # Use graphics-mode output insmod all_video diff --git a/configs/releng/grub/grub.cfg b/configs/releng/grub/grub.cfg index ddd8af2..ddf71e7 100644 --- a/configs/releng/grub/grub.cfg +++ b/configs/releng/grub/grub.cfg @@ -3,6 +3,10 @@ insmod part_gpt insmod part_msdos insmod fat insmod iso9660 +insmod ntfs +insmod ntfscomp +insmod exfat +insmod udf # Use graphics-mode output insmod all_video -- cgit v1.2.3-70-g09d2 From 0f34e4429a6d16d201c2568417cdc5ff79dd68dd Mon Sep 17 00:00:00 2001 From: nl6720 Date: Sat, 18 Jun 2022 11:01:49 +0300 Subject: configs/*/airootfs/etc/ssh/sshd_config: update to match 9.2p1-1 Update /etc/ssh/sshd_config to match changes made in https://github.com/archlinux/svntogit-packages/commit/42aa04744e96c5805b7aa3904636f8cbd781f682 and https://github.com/archlinux/svntogit-packages/commit/7166713c55002dac3c2b306fdc63e89a412083a6 The only modification remains `PermitRootLogin yes`. --- configs/baseline/airootfs/etc/ssh/sshd_config | 6 +++--- configs/releng/airootfs/etc/ssh/sshd_config | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'configs') diff --git a/configs/baseline/airootfs/etc/ssh/sshd_config b/configs/baseline/airootfs/etc/ssh/sshd_config index 93f7d63..dc22c11 100644 --- a/configs/baseline/airootfs/etc/ssh/sshd_config +++ b/configs/baseline/airootfs/etc/ssh/sshd_config @@ -58,7 +58,7 @@ AuthorizedKeysFile .ssh/authorized_keys #PermitEmptyPasswords no # Change to no to disable s/key passwords -#KbdInteractiveAuthentication yes +KbdInteractiveAuthentication no # Kerberos options #KerberosAuthentication no @@ -75,7 +75,7 @@ AuthorizedKeysFile .ssh/authorized_keys # be allowed through the KbdInteractiveAuthentication and # PasswordAuthentication. Depending on your PAM configuration, # PAM authentication via KbdInteractiveAuthentication may bypass -# the setting of "PermitRootLogin without-password". +# the setting of "PermitRootLogin prohibit-password". # If you just want the PAM account and session checks to run without # PAM authentication, then enable this but set PasswordAuthentication # and KbdInteractiveAuthentication to 'no'. @@ -88,7 +88,7 @@ UsePAM yes #X11DisplayOffset 10 #X11UseLocalhost yes #PermitTTY yes -PrintMotd no # pam does that +PrintMotd no #PrintLastLog yes #TCPKeepAlive yes #PermitUserEnvironment no diff --git a/configs/releng/airootfs/etc/ssh/sshd_config b/configs/releng/airootfs/etc/ssh/sshd_config index 93f7d63..dc22c11 100644 --- a/configs/releng/airootfs/etc/ssh/sshd_config +++ b/configs/releng/airootfs/etc/ssh/sshd_config @@ -58,7 +58,7 @@ AuthorizedKeysFile .ssh/authorized_keys #PermitEmptyPasswords no # Change to no to disable s/key passwords -#KbdInteractiveAuthentication yes +KbdInteractiveAuthentication no # Kerberos options #KerberosAuthentication no @@ -75,7 +75,7 @@ AuthorizedKeysFile .ssh/authorized_keys # be allowed through the KbdInteractiveAuthentication and # PasswordAuthentication. Depending on your PAM configuration, # PAM authentication via KbdInteractiveAuthentication may bypass -# the setting of "PermitRootLogin without-password". +# the setting of "PermitRootLogin prohibit-password". # If you just want the PAM account and session checks to run without # PAM authentication, then enable this but set PasswordAuthentication # and KbdInteractiveAuthentication to 'no'. @@ -88,7 +88,7 @@ UsePAM yes #X11DisplayOffset 10 #X11UseLocalhost yes #PermitTTY yes -PrintMotd no # pam does that +PrintMotd no #PrintLastLog yes #TCPKeepAlive yes #PermitUserEnvironment no -- cgit v1.2.3-70-g09d2 From 28d2bc11e3dc4a86667a8f5f379d8ac9c18c0a03 Mon Sep 17 00:00:00 2001 From: nl6720 Date: Thu, 27 Oct 2022 11:04:42 +0300 Subject: mkarchiso: do not place memtest86+ in netboot artifacts Move memtest86+ to `/boot/memtest86+/` on ISO 9660. That directory is not copied to netboot artifact output. Netboot boot menu https://ipxe.archlinux.org/releng/netboot/archlinux.ipxe does not have entries for memtest and archiso-manager removes these files (not the EFI one, though) before uploading the release files anyway. --- CHANGELOG.rst | 2 ++ archiso/mkarchiso | 14 ++++++-------- configs/releng/grub/grub.cfg | 2 +- configs/releng/syslinux/archiso_tail.cfg | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'configs') diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e2dfa9e..2b0d90f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -23,6 +23,8 @@ Changed Removed ------- +- Do not place memtest86+ in netboot artifacts. + [69] - 2022-12-24 ================= diff --git a/archiso/mkarchiso b/archiso/mkarchiso index c1a8c22..ce89642 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -471,11 +471,10 @@ _make_bootmode_bios.syslinux.mbr() { # Add other aditional/extra files to ${install_dir}/boot/ if [[ -e "${pacstrap_dir}/boot/memtest86+/memtest.bin" ]]; then + install -d -m 0755 -- "${isofs_dir}/boot/memtest86+/" # rename for PXE: https://wiki.archlinux.org/title/Syslinux#Using_memtest - install -m 0644 -- "${pacstrap_dir}/boot/memtest86+/memtest.bin" "${isofs_dir}/${install_dir}/boot/memtest" - install -d -m 0755 -- "${isofs_dir}/${install_dir}/boot/licenses/memtest86+/" - install -m 0644 -- "${pacstrap_dir}/usr/share/licenses/common/GPL2/license.txt" \ - "${isofs_dir}/${install_dir}/boot/licenses/memtest86+/" + install -m 0644 -- "${pacstrap_dir}/boot/memtest86+/memtest.bin" "${isofs_dir}/boot/memtest86+/memtest" + install -m 0644 -- "${pacstrap_dir}/usr/share/licenses/common/GPL2/license.txt" "${isofs_dir}/boot/memtest86+/" fi _msg_info "Done! SYSLINUX set up for BIOS booting from a disk successfully." } @@ -722,10 +721,9 @@ _make_bootmode_uefi-x64.grub.esp() { # Add other aditional/extra files to ${install_dir}/boot/ if [[ -e "${pacstrap_dir}/boot/memtest86+/memtest.efi" ]]; then - install -m 0644 -- "${pacstrap_dir}/boot/memtest86+/memtest.efi" "${isofs_dir}/${install_dir}/boot/memtest.efi" - install -d -m 0755 -- "${isofs_dir}/${install_dir}/boot/licenses/memtest86+/" - install -m 0644 -- "${pacstrap_dir}/usr/share/licenses/common/GPL2/license.txt" \ - "${isofs_dir}/${install_dir}/boot/licenses/memtest86+/" + 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/common/GPL2/license.txt" "${isofs_dir}/boot/memtest86+/" fi _msg_info "Done! GRUB set up for UEFI booting successfully." diff --git a/configs/releng/grub/grub.cfg b/configs/releng/grub/grub.cfg index ddf71e7..eb45a00 100644 --- a/configs/releng/grub/grub.cfg +++ b/configs/releng/grub/grub.cfg @@ -55,7 +55,7 @@ if [ "${grub_platform}" == "efi" ]; then if [ "${grub_cpu}" == "x86_64" ]; then menuentry "Run Memtest86+ (RAM test)" --class memtest86 --class gnu --class tool { set gfxpayload=800x600,1024x768 - linux /%INSTALL_DIR%/boot/memtest.efi + linux /boot/memtest86+/memtest.efi } menuentry "UEFI Shell" { insmod chain diff --git a/configs/releng/syslinux/archiso_tail.cfg b/configs/releng/syslinux/archiso_tail.cfg index dcbb413..e84897c 100644 --- a/configs/releng/syslinux/archiso_tail.cfg +++ b/configs/releng/syslinux/archiso_tail.cfg @@ -10,7 +10,7 @@ APPEND hd0 0 # https://www.memtest.org/ LABEL memtest MENU LABEL Run Memtest86+ (RAM test) -LINUX /%INSTALL_DIR%/boot/memtest +LINUX /boot/memtest86+/memtest # https://wiki.syslinux.org/wiki/index.php/Hdt_(Hardware_Detection_Tool) LABEL hdt -- cgit v1.2.3-70-g09d2 From 7c6f266ec94e3eff23466ed8d0c45e4bee0ddae4 Mon Sep 17 00:00:00 2001 From: nl6720 Date: Sat, 28 Jan 2023 20:54:32 +0200 Subject: configs/*/profiledef.sh: honor SOURCE_DATE_EPOCH Ensure the **correct** date is used in `iso_label` and `iso_version`. --- CHANGELOG.rst | 1 + configs/baseline/profiledef.sh | 4 ++-- configs/releng/profiledef.sh | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'configs') diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2b0d90f..d55c15d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -19,6 +19,7 @@ Changed - Identify the ISO volume via a UUID instead of a file system label to avoid collisions of multiple ISOs created in the same month. +- Honor ``SOURCE_DATE_EPOCH`` in the ``date`` command used by ``profiledef.sh`` of the shipped profiles. Removed ------- diff --git a/configs/baseline/profiledef.sh b/configs/baseline/profiledef.sh index ed486ca..63acce1 100644 --- a/configs/baseline/profiledef.sh +++ b/configs/baseline/profiledef.sh @@ -2,10 +2,10 @@ # shellcheck disable=SC2034 iso_name="archlinux-baseline" -iso_label="ARCH_$(date +%Y%m)" +iso_label="ARCH_$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y%m)" iso_publisher="Arch Linux " iso_application="Arch Linux baseline" -iso_version="$(date +%Y.%m.%d)" +iso_version="$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y.%m.%d)" install_dir="arch" buildmodes=('iso') bootmodes=('bios.syslinux.mbr' 'bios.syslinux.eltorito' diff --git a/configs/releng/profiledef.sh b/configs/releng/profiledef.sh index 4b4e68c..4154816 100644 --- a/configs/releng/profiledef.sh +++ b/configs/releng/profiledef.sh @@ -2,10 +2,10 @@ # shellcheck disable=SC2034 iso_name="archlinux" -iso_label="ARCH_$(date +%Y%m)" +iso_label="ARCH_$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y%m)" iso_publisher="Arch Linux " iso_application="Arch Linux Live/Rescue CD" -iso_version="$(date +%Y.%m.%d)" +iso_version="$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y.%m.%d)" install_dir="arch" buildmodes=('iso') bootmodes=('bios.syslinux.mbr' 'bios.syslinux.eltorito' -- cgit v1.2.3-70-g09d2 From f7502001b0e538bd443cb7ab82539f5aaa7afddb Mon Sep 17 00:00:00 2001 From: nl6720 Date: Sat, 28 Jan 2023 14:04:15 +0200 Subject: configs/*/grub/grub.cfg: reuse ARCHISO_HINT and ARCHISO_UUID passed from the embedded grub.cfg The `grub.cfg` embedded in the GRUB binaries already sets `ARCHISO_HINT` and `ARCHISO_UUID` in most cases. To avoid performing the same searches multiple times, use the existing variables. --- configs/baseline/grub/grub.cfg | 10 +++++++--- configs/releng/grub/grub.cfg | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'configs') diff --git a/configs/baseline/grub/grub.cfg b/configs/baseline/grub/grub.cfg index d606b10..e855ea9 100644 --- a/configs/baseline/grub/grub.cfg +++ b/configs/baseline/grub/grub.cfg @@ -25,9 +25,13 @@ if serial --unit=0 --speed=115200; then fi # Search for the ISO volume -regexp --set=1:ARCHISO_HINT '^\(([^)]+)\)' "${cmdpath}" -search --no-floppy --set=root --file '/.disk/%UUID_SEARCH_FILENAME%.uuid' --hint "${ARCHISO_HINT}" -probe --set ARCHISO_UUID --fs-uuid "${root}" +if [ -z "${ARCHISO_UUID}" ]; then + if [ -z "${ARCHISO_HINT}" ]; then + regexp --set=1:ARCHISO_HINT '^\(([^)]+)\)' "${cmdpath}" + fi + search --no-floppy --set=root --file '/.disk/%UUID_SEARCH_FILENAME%.uuid' --hint "${ARCHISO_HINT}" + probe --set ARCHISO_UUID --fs-uuid "${root}" +fi # Set default menu entry default=archlinux diff --git a/configs/releng/grub/grub.cfg b/configs/releng/grub/grub.cfg index eb45a00..88a5d60 100644 --- a/configs/releng/grub/grub.cfg +++ b/configs/releng/grub/grub.cfg @@ -25,9 +25,13 @@ if serial --unit=0 --speed=115200; then fi # Search for the ISO volume -regexp --set=1:ARCHISO_HINT '^\(([^)]+)\)' "${cmdpath}" -search --no-floppy --set=root --file '/.disk/%UUID_SEARCH_FILENAME%.uuid' --hint "${ARCHISO_HINT}" -probe --set ARCHISO_UUID --fs-uuid "${root}" +if [ -z "${ARCHISO_UUID}" ]; then + if [ -z "${ARCHISO_HINT}" ]; then + regexp --set=1:ARCHISO_HINT '^\(([^)]+)\)' "${cmdpath}" + fi + search --no-floppy --set=root --file '/.disk/%UUID_SEARCH_FILENAME%.uuid' --hint "${ARCHISO_HINT}" + probe --set ARCHISO_UUID --fs-uuid "${root}" +fi # Set default menu entry default=archlinux -- cgit v1.2.3-70-g09d2 From c8474f8dbe2df8fa9af11e4b3d0bde24bb8b54f9 Mon Sep 17 00:00:00 2001 From: nl6720 Date: Thu, 9 Feb 2023 11:16:52 +0200 Subject: Move the .uuid file to /boot/grub/YYYY-mm-dd-HH-MM-SS-00.uuid To prevent the file from being accidentally missed when someone copies the ISO's contents, let's not place it in a directory that starts with a dot. Since all GRUB related files are in /boot/grub/, put it there too. Instead of using a more unique UUID for the file name, use `YYYY-mm-dd-HH-MM-SS-00.uuid` which matches the ISO's modification date in UTC,i.e. its "UUID". If multiple ISOs would be generated in the exact same second, the ISO 9660 modification date (i.e. its "UUID") would be the same, so there would be not way to distinguish between the volumes anyway. This also makes the file look less suspicious to the casual glance. --- CHANGELOG.rst | 2 +- archiso/mkarchiso | 28 +++++++++++++++------------- configs/baseline/grub/grub.cfg | 2 +- configs/releng/grub/grub.cfg | 2 +- 4 files changed, 18 insertions(+), 16 deletions(-) (limited to 'configs') diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 0196770..7a83622 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,7 +10,7 @@ Added - Support *file system transposition* to simplify boot medium preparation for UEFI boot via extracting the ISO image contents to a drive. ``grub.cfg`` does not hardcode the ISO volume label anymore, instead GRUB will search for volume - with a ``/.disk/%UUID_SEARCH_FILENAME%.uuid`` file on it. + with a ``/boot/grub/YYYY-mm-dd-HH-MM-SS-00.uuid`` file on it. - Preload GRUB's NTFS modules for UEFI that allegedly have native NTFS support. GRUB's exFAT and UDF modules are also preloaded in case someone finds them useful. diff --git a/archiso/mkarchiso b/archiso/mkarchiso index 0ffe0ca..a543280 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -558,22 +558,24 @@ _make_common_bootmode_grub_copy_to_isofs() { # Prepare GRUB configuration files _make_common_bootmode_grub_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" + local _cfg archiso_uuid 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" + # Fill GRUB configuration files 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|%UUID_SEARCH_FILENAME%|${uuid_search_filename}|g" \ + s|%ARCHISO_SEARCH_FILENAME%|${search_filename}|g" \ "${_cfg}" > "${work_dir}/grub/${_cfg##*/}" done @@ -596,13 +598,13 @@ if [ -z "${ARCHISO_HINT}" ]; then fi # Search for the ISO volume -if search --no-floppy --set=archiso_device --file '/.disk/%UUID_SEARCH_FILENAME%.uuid' --hint "${ARCHISO_HINT}"; then +if search --no-floppy --set=archiso_device --file '%ARCHISO_SEARCH_FILENAME%' --hint "${ARCHISO_HINT}"; then set ARCHISO_HINT="${archiso_device}" if probe --set ARCHISO_UUID --fs-uuid "${ARCHISO_HINT}"; then export ARCHISO_UUID fi else - echo "Could not find a volume with a '/.disk/%UUID_SEARCH_FILENAME%.uuid' file on it!" + echo "Could not find a volume with a '%ARCHISO_SEARCH_FILENAME%' file on it!" fi # Load grub.cfg @@ -616,18 +618,18 @@ else echo "File '(${ARCHISO_HINT})/boot/grub/grub.cfg' not found!" fi EOF - grubembedcfg="${grubembedcfg//'%UUID_SEARCH_FILENAME%'/"${uuid_search_filename}"}" + grubembedcfg="${grubembedcfg//'%ARCHISO_SEARCH_FILENAME%'/"${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' \ + "$(printf '# GRUB Environment Block\nNAME=%s\nVERSION=%s\nARCHISO_LABEL=%s\nINSTALL_DIR=%s\nARCH=%s\nARCHISO_SEARCH_FILENAME=%s\n%s' \ "${iso_name}" \ "${iso_version}" \ "${iso_label}" \ "${install_dir}" \ "${arch}" \ - "${uuid_search_filename}" \ + "${search_filename}" \ "$(printf '%0.1s' "#"{1..1024})")" \ > "${work_dir}/grub/grubenv" } diff --git a/configs/baseline/grub/grub.cfg b/configs/baseline/grub/grub.cfg index e855ea9..13043b3 100644 --- a/configs/baseline/grub/grub.cfg +++ b/configs/baseline/grub/grub.cfg @@ -29,7 +29,7 @@ if [ -z "${ARCHISO_UUID}" ]; then if [ -z "${ARCHISO_HINT}" ]; then regexp --set=1:ARCHISO_HINT '^\(([^)]+)\)' "${cmdpath}" fi - search --no-floppy --set=root --file '/.disk/%UUID_SEARCH_FILENAME%.uuid' --hint "${ARCHISO_HINT}" + search --no-floppy --set=root --file '%ARCHISO_SEARCH_FILENAME%' --hint "${ARCHISO_HINT}" probe --set ARCHISO_UUID --fs-uuid "${root}" fi diff --git a/configs/releng/grub/grub.cfg b/configs/releng/grub/grub.cfg index 88a5d60..c4478e8 100644 --- a/configs/releng/grub/grub.cfg +++ b/configs/releng/grub/grub.cfg @@ -29,7 +29,7 @@ if [ -z "${ARCHISO_UUID}" ]; then if [ -z "${ARCHISO_HINT}" ]; then regexp --set=1:ARCHISO_HINT '^\(([^)]+)\)' "${cmdpath}" fi - search --no-floppy --set=root --file '/.disk/%UUID_SEARCH_FILENAME%.uuid' --hint "${ARCHISO_HINT}" + search --no-floppy --set=root --file '%ARCHISO_SEARCH_FILENAME%' --hint "${ARCHISO_HINT}" probe --set ARCHISO_UUID --fs-uuid "${root}" fi -- cgit v1.2.3-70-g09d2 From cedb3d142c470511ba1bb86fa987fd9bb39501d2 Mon Sep 17 00:00:00 2001 From: nl6720 Date: Wed, 22 Feb 2023 10:57:27 +0200 Subject: configs/*/grub/grub.cfg: replace /dev/disk/by-uuid/ with UUID= Use the shorter and more nicer looking `UUID=` *tags* instead of the `/dev/disk/by-uuid/` paths. This requires mkinitcpio-archiso v68. Related to #202 --- configs/baseline/grub/grub.cfg | 2 +- configs/releng/grub/grub.cfg | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'configs') diff --git a/configs/baseline/grub/grub.cfg b/configs/baseline/grub/grub.cfg index 13043b3..ed56578 100644 --- a/configs/baseline/grub/grub.cfg +++ b/configs/baseline/grub/grub.cfg @@ -43,6 +43,6 @@ timeout_style=menu menuentry "Arch Linux (x86_64, UEFI)" --class arch --class gnu-linux --class gnu --class os --id 'archlinux' { set gfxpayload=keep - linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux archisobasedir=%INSTALL_DIR% archisodevice=/dev/disk/by-uuid/${ARCHISO_UUID} + linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux archisobasedir=%INSTALL_DIR% archisodevice=UUID=${ARCHISO_UUID} initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux.img } diff --git a/configs/releng/grub/grub.cfg b/configs/releng/grub/grub.cfg index c4478e8..1882e49 100644 --- a/configs/releng/grub/grub.cfg +++ b/configs/releng/grub/grub.cfg @@ -45,13 +45,13 @@ play 600 988 1 1319 4 menuentry "Arch Linux install medium (x86_64, UEFI)" --class arch --class gnu-linux --class gnu --class os --id 'archlinux' { set gfxpayload=keep - linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux archisobasedir=%INSTALL_DIR% archisodevice=/dev/disk/by-uuid/${ARCHISO_UUID} + linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux archisobasedir=%INSTALL_DIR% archisodevice=UUID=${ARCHISO_UUID} initrd /%INSTALL_DIR%/boot/intel-ucode.img /%INSTALL_DIR%/boot/amd-ucode.img /%INSTALL_DIR%/boot/x86_64/initramfs-linux.img } menuentry "Arch Linux install medium with speakup screen reader (x86_64, UEFI)" --hotkey s --class arch --class gnu-linux --class gnu --class os --id 'archlinux-accessibility' { set gfxpayload=keep - linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux archisobasedir=%INSTALL_DIR% archisodevice=/dev/disk/by-uuid/${ARCHISO_UUID} accessibility=on + linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux archisobasedir=%INSTALL_DIR% archisodevice=UUID=${ARCHISO_UUID} accessibility=on initrd /%INSTALL_DIR%/boot/intel-ucode.img /%INSTALL_DIR%/boot/amd-ucode.img /%INSTALL_DIR%/boot/x86_64/initramfs-linux.img } -- cgit v1.2.3-70-g09d2