diff options
| author | tranch <tranch.xiao@gmail.com> | 2026-08-28 12:16:30 +0800 |
|---|---|---|
| committer | tranch <tranch.xiao@gmail.com> | 2026-08-28 12:16:36 +0800 |
| commit | 90c5e5ad9754825b7fbfb419f80a6816ec416e85 (patch) | |
| tree | 7c1ba21867a866d4bf9b04c3e1bf47d8646759c5 | |
| parent | 7889a92c2eea98189330ad1fbfbef4c33a7e3071 (diff) | |
| download | AeroCore-OS-90c5e5ad9754825b7fbfb419f80a6816ec416e85.tar.gz AeroCore-OS-90c5e5ad9754825b7fbfb419f80a6816ec416e85.zip | |
fix: avoid corrupted system-release in ISO
| -rw-r--r-- | .github/workflows/build.yml | 20 | ||||
| -rwxr-xr-x | build_files/image-info | 10 |
2 files changed, 26 insertions, 4 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 02a6055..f27a1bb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -163,6 +163,26 @@ jobs: "${IMAGE_NAME}" \ "${DEFAULT_TAG}" + - name: Verify image metadata before publishing + run: | + sudo podman run --rm --entrypoint /usr/bin/bash \ + "${IMAGE_NAME}:${DEFAULT_TAG}" -ceu ' + system_release=/etc/system-release + if od -An -v -tx1 "$system_release" | awk '\''{ for (i = 1; i <= NF; i++) if ($i == "00") found = 1 } END { exit(found ? 0 : 1) }'\''; then + echo "NUL byte in ${system_release}" >&2 + exit 1 + fi + case "$(<"$system_release")" in + "AeroCore OS release $(rpm -E %fedora) ("*) ;; + *) + echo "Unexpected system-release: $(<"$system_release")" >&2 + exit 1 + ;; + esac + jq -e '\''.["image-name"] == "aerocore-os" and .["image-vendor"] == "aerocore-io"'\'' \ + /usr/share/ublue-os/image-info.json >/dev/null + ' + # If you are feeling adventurous, use the new distro agnostic rechunker # https://github.com/coreos/chunkah # You can delete the Rechunk with rpm-ostree portion then if you use this diff --git a/build_files/image-info b/build_files/image-info index 46d4326..4e66bc1 100755 --- a/build_files/image-info +++ b/build_files/image-info @@ -71,13 +71,15 @@ sed -i "/^REDHAT_BUGZILLA_PRODUCT=/d; /^REDHAT_BUGZILLA_PRODUCT_VERSION=/d; /^RE sed -i "s|^VERSION_CODENAME=.*|VERSION_CODENAME=\"Deck\"|" /usr/lib/os-release # /etc/system-release is normally a symlink to the RPM-owned fedora-release. -# Write through that link and verify the final bytes: bootupd uses this value as -# the efibootmgr label, where even a trailing NUL makes Anaconda fail before -# any %post installer hook can run. +# Replace the directory entry instead of writing through that link. In the +# bootc/ostree build chain, an in-place write to the RPM-owned target can be +# lost while the final image is assembled, leaving Anaconda to read the +# upstream file (which may contain a trailing NUL). SYSTEM_RELEASE="/etc/system-release" -SYSTEM_RELEASE_TARGET="$(readlink -f "$SYSTEM_RELEASE")" EXPECTED_SYSTEM_RELEASE="$IMAGE_PRETTY_NAME release $FEDORA_VERSION (Deck)" +rm -f -- "$SYSTEM_RELEASE" printf '%s\n' "$EXPECTED_SYSTEM_RELEASE" > "$SYSTEM_RELEASE" +SYSTEM_RELEASE_TARGET="$SYSTEM_RELEASE" if ! cmp -s <(printf '%s\n' "$EXPECTED_SYSTEM_RELEASE") "$SYSTEM_RELEASE_TARGET"; then echo "Failed to write a clean AeroCore system-release to ${SYSTEM_RELEASE_TARGET}" >&2 |
