summaryrefslogtreecommitdiff
path: root/build_files
diff options
context:
space:
mode:
Diffstat (limited to 'build_files')
-rwxr-xr-xbuild_files/image-info10
1 files changed, 6 insertions, 4 deletions
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