Skip to content

Commit aa70fc9

Browse files
committed
Delay generating test update payload in official builds
The update payload needs the kernel, which isn't signed during the image job. Secure Boot is not currently enabled for update tests, but we may as well do this properly. The production update upload is generated manually at the end after everything has already been signed. Signed-off-by: James Le Cuirot <[email protected]>
1 parent bda73d4 commit aa70fc9

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

build_image

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ if [[ "${PROD_IMAGE}" -eq 1 ]]; then
177177
if [[ ${FLAGS_extract_update} -eq ${FLAGS_TRUE} ]]; then
178178
extract_update "${FLATCAR_PRODUCTION_IMAGE_NAME}" "${DISK_LAYOUT}"
179179
fi
180-
if [[ ${FLAGS_generate_update} -eq ${FLAGS_TRUE} ]]; then
180+
if [[ ${FLAGS_generate_update} -eq ${FLAGS_TRUE} && ${COREOS_OFFICIAL:-0} -ne 1 ]]; then
181181
generate_update "${FLATCAR_PRODUCTION_IMAGE_NAME}" "${DISK_LAYOUT}"
182182
fi
183183
if [[ "${PROD_TAR}" -eq 1 ]]; then

ci-automation/sbsign_image.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ function _sbsign_image_impl() {
9191
--only_store_compressed
9292

9393
# Delete uncompressed generic image before signing and upload
94-
rm "${images_local}/flatcar_production_image.bin"
94+
# Also delete update image because it will be unchanged
95+
rm "${images_local}"/flatcar_production_{image,update}.bin
9596
create_digests "${SIGNER}" "${images_local}"/*
9697
sign_artifacts "${SIGNER}" "${images_local}"/*
9798
copy_to_buildcache "${images_remote}"/ "${images_local}"/*

sbsign_image

+4-1
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,11 @@ switch_to_strict_mode
6161
# Create the output directory and temporary mount points.
6262
mkdir -p "${BUILD_DIR}"
6363

64+
DISK_LAYOUT="${FLAGS_disk_layout:-base}"
65+
6466
fix_mtab
65-
sbsign_prod_image "${FLATCAR_PRODUCTION_IMAGE_NAME}" "${FLAGS_disk_layout:-base}"
67+
sbsign_prod_image "${FLATCAR_PRODUCTION_IMAGE_NAME}" "${DISK_LAYOUT}"
68+
generate_update "${FLATCAR_PRODUCTION_IMAGE_NAME}" "${DISK_LAYOUT}"
6669

6770
echo "Done. ${FLATCAR_PRODUCTION_IMAGE_NAME} and associated files are now signed for Secure Boot in ${BUILD_DIR}."
6871
command_completed

0 commit comments

Comments
 (0)