Skip to content

Commit 299773a

Browse files
authored
Merge pull request #2550 from flatcar/chewi/sbsign-update-payload
Delay generating test update payload in official builds
2 parents f8bf613 + 29a5131 commit 299773a

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

build_image

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ 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+
# TODO: Un-nobble this later when we have passed the shim review.
181+
if [[ ${FLAGS_generate_update} -eq ${FLAGS_TRUE} ]]; then # && ${COREOS_OFFICIAL:-0} -ne 1 ]]; then
181182
generate_update "${FLATCAR_PRODUCTION_IMAGE_NAME}" "${DISK_LAYOUT}"
182183
fi
183184
if [[ "${PROD_TAR}" -eq 1 ]]; then

build_library/build_image_util.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ generate_update() {
7979
local devkey="/usr/share/update_engine/update-payload-key.key.pem"
8080

8181
# Extract the partition if it isn't extracted already.
82-
[[ -s ${update} ]] || extract_update "${image_name}" "${disk_layout}"
82+
[[ -s ${update} ]] ||
83+
"${BUILD_LIBRARY_DIR}/disk_util" --disk_layout="${disk_layout}" \
84+
extract "${BUILD_DIR}/${image_name}" "USR-A" "${update}"
8385

8486
echo "Generating update payload, signed with a dev key"
8587
delta_generator \

ci-automation/sbsign_image.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,17 @@ function _sbsign_image_impl() {
8282
local sdk_image="$(docker_image_fullname "${sdk_name}" "${docker_sdk_vernum}")"
8383
echo "docker image rm -f '${sdk_image}'" >> ./ci-cleanup.sh
8484

85-
./run_sdk_container -x ./ci-cleanup.sh -v "${FLATCAR_VERSION}" -U -C "${sdk_image}" \
85+
local docker_vernum="$(vernum_to_docker_image_version "${FLATCAR_VERSION}")"
86+
local sbsign_container="flatcar-sbsign-image-${arch}-${docker_vernum}"
87+
./run_sdk_container -x ./ci-cleanup.sh -n "${sbsign_container}" -v "${FLATCAR_VERSION}" -U -C "${sdk_image}" \
8688
./sbsign_image --board="${arch}-usr" \
8789
--group="${channel}" --version="${FLATCAR_VERSION}" \
8890
--output_root="${CONTAINER_IMAGE_ROOT}" \
8991
--only_store_compressed
9092

9193
# Delete uncompressed generic image before signing and upload
92-
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
9396
create_digests "${SIGNER}" "${images_local}"/*
9497
sign_artifacts "${SIGNER}" "${images_local}"/*
9598
copy_to_buildcache "${images_remote}"/ "${images_local}"/*

sbsign_image

Lines changed: 4 additions & 1 deletion
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)