build_image: export FLATCAR_BUILD_ID to ensure consistency#4051
build_image: export FLATCAR_BUILD_ID to ensure consistency#4051zhijianli88 wants to merge 1 commit into
Conversation
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: flatcar/Flatcar#2041
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
|
I'd like to better understand how these got out of sync. I suspect you may be tripping up on a quoting issue we had a while back that I fixed in 874ed25. |
I'm not sure whether they are the same. because I'm building the flatcar based the the stable branch(4593.2.2), which encountered flatcar/Flatcar#2041 I will try to cherry-pick 874ed25 and try again. Let's share more details
|
It doesn't work for me on the stable branch after cherry-pick 874ed25 |
|
Okay, but you still haven't explained how or when they come to be different. |
everytime commom.sh is being sourced, it will generate a new |
|
|
https://github.com/flatcar/scripts/blob/main/common.sh#L309-L309 it's a timestamp |
|
I didn't find time for anything yet, sorry. My general sentiment is that we set / overwrite |
Thanks for the feedback. I'd like to clarify a point that might clear things up. The Back to this patch, export FLATCAR_BUILD_ID after the first sourcing common.sh in This ensures the entire build_image context sees the same FLATCAR_BUILD_ID |
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: flatcar/Flatcar#2041
Cc: stable branch