From aa9ab96dda33e2e2f5d2c584972ff9ccca585422 Mon Sep 17 00:00:00 2001 From: Li Zhijian Date: Thu, 28 May 2026 13:24:11 +0900 Subject: [PATCH] build_image: export FLATCAR_BUILD_ID to ensure consistency If FLATCAR_BUILD_ID is not exported, child processes or subsequent scripts may not inherit the variable. This can lead to mismatched build IDs between ${BUILD_DIR}/version.txt and ${rootfs}/lib/os-release, causing the generated QEMU image to fail to start. Export the variable so that all related contexts share the same FLATCAR_BUILD_ID. Link: https://github.com/flatcar/Flatcar/issues/2041 Signed-off-by: Li Zhijian --- build_image | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build_image b/build_image index 77926096531..bafe37db495 100755 --- a/build_image +++ b/build_image @@ -12,6 +12,12 @@ SCRIPT_ROOT=$(dirname $(readlink -f "$0")) . "${SCRIPT_ROOT}/common.sh" || exit 1 +# Ensure all contexts share the same FLATCAR_BUILD_ID. Otherwise, +# ${BUILD_DIR}/version.txt and ${rootfs}/lib/os-release could have different +# FLATCAR_BUILD_ID values, causing the QEMU image to fail to start. +# https://github.com/flatcar/Flatcar/issues/2041 +export FLATCAR_BUILD_ID + # Script must run inside the chroot assert_inside_chroot