From 99c47421bdb444e2eb799c1db1fe11a8ea91dee3 Mon Sep 17 00:00:00 2001 From: tranch Date: Tue, 25 Aug 2026 09:51:14 +0800 Subject: Document local live ISO reproduction path --- installer/build.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'installer/build.sh') diff --git a/installer/build.sh b/installer/build.sh index 205f18c..dda0706 100755 --- a/installer/build.sh +++ b/installer/build.sh @@ -157,6 +157,24 @@ fi /usr/libexec/aerocore-configure-target-gpt-root \${target_root} %end +# Do not let stale Fedora boot files from an earlier installation collide with +# the bootc payload being installed. This matches the upstream Bazzite +# installer behavior; other vendor EFI directories are left untouched. +%pre-install --erroronfail --log=/tmp/aerocore-efi-cleanup.log +set -eux +efi_root= +for root in /mnt/sysroot /mnt/sysimage /var/mnt/sysroot /var/mnt/sysimage; do + if mountpoint -q \${root}/boot/efi; then + efi_root=\${root}/boot/efi + break + fi +done +if [ x\${efi_root} = x ]; then + echo No mounted EFI system partition found for cleanup >&2 + exit 1 +fi +rm -rf \${efi_root}/EFI/fedora +%end ostreecontainer --url=${INSTALL_IMAGE_PAYLOAD} --transport=containers-storage --no-signature-verification # The local containers-storage deployment is intentionally unverified because -- cgit v1.2.3 From ed4bd0d089d41c5d95fe74937acc2a779c6de6d4 Mon Sep 17 00:00:00 2001 From: tranch Date: Tue, 25 Aug 2026 10:44:18 +0800 Subject: fix(installer): validate ISO payload metadata Rewrite system-release atomically and reject stale or NUL-bearing payload metadata before it reaches Anaconda bootupd. --- installer/build.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'installer/build.sh') diff --git a/installer/build.sh b/installer/build.sh index dda0706..dd7b7f5 100755 --- a/installer/build.sh +++ b/installer/build.sh @@ -115,6 +115,33 @@ else podman pull "${INSTALL_IMAGE_PAYLOAD}" fi +# Refuse to build an ISO with a payload that still carries Bazzite release +# bytes. bootupd derives its EFI label from system-release during installation; +# a trailing NUL there makes efibootmgr fail before Anaconda can run %post. +podman run --rm --entrypoint /usr/bin/bash "${INSTALL_IMAGE_PAYLOAD}" -ceu ' + system_release=/etc/system-release + system_release_target=$(readlink -f "$system_release") + + if od -An -v -tx1 "$system_release_target" | awk '\''{ for (i = 1; i <= NF; i++) if ($i == "00") found = 1 } END { exit(found ? 0 : 1) }'\''; then + echo "Install payload has a NUL byte in ${system_release_target}" >&2 + od -An -v -tx1 "$system_release_target" >&2 + exit 1 + fi + + expected_prefix="AeroCore OS release $(rpm -E %fedora) (" + system_release_value=$(<"$system_release_target") + case "$system_release_value" in + "$expected_prefix"*) ;; + *) + echo "Install payload has an unexpected system-release: ${system_release_value@Q}" >&2 + exit 1 + ;; + esac + + jq -e '\''.["image-name"] == "aerocore-os" and .["image-vendor"] == "aerocore-io"'\'' \ + /usr/share/ublue-os/image-info.json >/dev/null +' + # Tell Anaconda to install the bootc container that was loaded above. mkdir -p /var/lib/rpm-state cat >> /usr/share/anaconda/interactive-defaults.ks < Date: Tue, 25 Aug 2026 11:41:20 +0800 Subject: fix(installer): validate payload on build host Move payload inspection out of the nested Podman build so local ISO builds do not require /dev/fuse. Normalize local registry references. --- installer/build.sh | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'installer/build.sh') diff --git a/installer/build.sh b/installer/build.sh index dd7b7f5..dda0706 100755 --- a/installer/build.sh +++ b/installer/build.sh @@ -115,33 +115,6 @@ else podman pull "${INSTALL_IMAGE_PAYLOAD}" fi -# Refuse to build an ISO with a payload that still carries Bazzite release -# bytes. bootupd derives its EFI label from system-release during installation; -# a trailing NUL there makes efibootmgr fail before Anaconda can run %post. -podman run --rm --entrypoint /usr/bin/bash "${INSTALL_IMAGE_PAYLOAD}" -ceu ' - system_release=/etc/system-release - system_release_target=$(readlink -f "$system_release") - - if od -An -v -tx1 "$system_release_target" | awk '\''{ for (i = 1; i <= NF; i++) if ($i == "00") found = 1 } END { exit(found ? 0 : 1) }'\''; then - echo "Install payload has a NUL byte in ${system_release_target}" >&2 - od -An -v -tx1 "$system_release_target" >&2 - exit 1 - fi - - expected_prefix="AeroCore OS release $(rpm -E %fedora) (" - system_release_value=$(<"$system_release_target") - case "$system_release_value" in - "$expected_prefix"*) ;; - *) - echo "Install payload has an unexpected system-release: ${system_release_value@Q}" >&2 - exit 1 - ;; - esac - - jq -e '\''.["image-name"] == "aerocore-os" and .["image-vendor"] == "aerocore-io"'\'' \ - /usr/share/ublue-os/image-info.json >/dev/null -' - # Tell Anaconda to install the bootc container that was loaded above. mkdir -p /var/lib/rpm-state cat >> /usr/share/anaconda/interactive-defaults.ks <