From 34de43d9b35cc4eb7d129709704ed28073fa7f8a Mon Sep 17 00:00:00 2001 From: h8d13 Date: Sun, 26 Jul 2026 12:40:43 +0200 Subject: [PATCH 1/2] fix(disk): aarch64 root partition type GUID * PartitionGUID.linux_root() picks by SysInfo.arch() ==> aarch64 root was stamped with the x86_64 GUID, so systemd-gpt-auto-generator could not find / * port of upstream archinstall e8ffccc8, adapted: mapping lives on the enum instead of a linux_root_guid() helper in disk/utils.py, since device.py already imports SysInfo and there is one call site Assisted-By: Flint --- archinstoo/archinstoo/lib/disk/device_handler.py | 2 +- archinstoo/archinstoo/lib/models/device.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/archinstoo/archinstoo/lib/disk/device_handler.py b/archinstoo/archinstoo/lib/disk/device_handler.py index ca2ccba3..293b3377 100644 --- a/archinstoo/archinstoo/lib/disk/device_handler.py +++ b/archinstoo/archinstoo/lib/disk/device_handler.py @@ -542,7 +542,7 @@ def _setup_partition( if disk.type == PartitionTable.GPT.value: if part_mod.is_root(): - partition.type_uuid = PartitionGUID.LINUX_ROOT_X86_64.bytes + partition.type_uuid = PartitionGUID.linux_root().bytes elif PartitionFlag.LINUX_HOME not in part_mod.flags and part_mod.is_home(): partition.setFlag(PartitionFlag.LINUX_HOME.flag_id) diff --git a/archinstoo/archinstoo/lib/models/device.py b/archinstoo/archinstoo/lib/models/device.py index ed811115..66150afa 100644 --- a/archinstoo/archinstoo/lib/models/device.py +++ b/archinstoo/archinstoo/lib/models/device.py @@ -835,8 +835,17 @@ def from_string(cls, s: str) -> Self | None: class PartitionGUID(Enum): # A list of Partition type GUIDs (lsblk -o+PARTTYPE) can be found here: https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs + LINUX_ROOT_AARCH64 = 'B921B045-1DF0-41C3-AF44-4C6F280D3FAE' LINUX_ROOT_X86_64 = '4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709' + @classmethod + def linux_root(cls) -> Self: + # discoverable partitions spec keys root by arch: the wrong GUID + # leaves systemd-gpt-auto-generator unable to find / + if SysInfo.arch() == 'aarch64': + return cls.LINUX_ROOT_AARCH64 + return cls.LINUX_ROOT_X86_64 + @property def bytes(self) -> builtins.bytes: return uuid.UUID(self.value).bytes From cecfdd21f009c485a7601ed7edc4ea649fa5c884 Mon Sep 17 00:00:00 2001 From: h8d13 Date: Sun, 26 Jul 2026 12:40:54 +0200 Subject: [PATCH 2/2] chore(installer): LPath for custom user command scripts * f-string concat ==> installation.target / script_path.relative_to_root() * with open(w) ==> write_text, drop chroot_path_p alias * fixes ///var/tmp/... in live mode where target is / * port of upstream archinstall fe162389; fork keeps its try/except warn + finally unlink and _arch_chroot_prefix (foreign host has no arch-chroot -S) Assisted-By: Flint --- archinstoo/archinstoo/lib/installer.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/archinstoo/archinstoo/lib/installer.py b/archinstoo/archinstoo/lib/installer.py index aa651d3d..210efd75 100644 --- a/archinstoo/archinstoo/lib/installer.py +++ b/archinstoo/archinstoo/lib/installer.py @@ -2552,18 +2552,16 @@ def run_grimoire_installation( def run_custom_user_commands(commands: list[str], installation: Installer) -> None: for index, command in enumerate(commands): - script_path = f'/var/tmp/user-command.{index}.sh' # noqa: S108 - path inside install target, not host /tmp - chroot_path = f'{installation.target}/{script_path}' + script_path = LPath(f'/var/tmp/user-command.{index}.sh') # noqa: S108 - path inside install target, not host /tmp + chroot_path = installation.target / script_path.relative_to_root() # Do not throw error instead warn info(f'Executing custom command "{command}" ...') - chroot_path_p = Path(chroot_path) - with chroot_path_p.open('w') as user_script: - user_script.write(command) + chroot_path.write_text(command) try: SysCommand(f'{" ".join(installation._arch_chroot_prefix)} bash {script_path}') except SysCallError as e: warn(f'Custom command "{command}" failed: {e}') finally: - chroot_path_p.unlink() + chroot_path.unlink()