From e98bfdce0d2232945a011b61fc99f8484df7b752 Mon Sep 17 00:00:00 2001 From: Kai Lueke Date: Wed, 27 Sep 2023 15:41:10 +0200 Subject: [PATCH] flatcar-update: Provide hash_sha256 attribute for OEM packages The newer Omaha 3.1 hash_sha256 attribute is now supported by Nebraska and should be used for OEM payloads. Provide it in addition to the old "hash" attribute for OEM packages (the generic payload uses the Omaha Flatcar extension with the SHA256 hash). --- bin/flatcar-update | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/flatcar-update b/bin/flatcar-update index d6e6c4f..e2b9a58 100755 --- a/bin/flatcar-update +++ b/bin/flatcar-update @@ -222,13 +222,17 @@ for DOWNLOAD_FILE in "$PAYLOAD" "${EXTENSIONS[@]}"; do SIZE=$(stat -L --printf='%s\n' "${DOWNLOAD_FILE}") BASEFILENAME="$(basename -- "${DOWNLOAD_FILE}" | sed 's/flatcar_test_update-//g')" REQUIRED="false" + OPTHASH256="" if [ "${DOWNLOAD_FILE}" = "${PAYLOAD}" ]; then # In case a local payload is given we have to use the correct name BASEFILENAME="flatcar_production_update.gz" REQUIRED="true" + else + HASH256=$(sha256sum -b "${DOWNLOAD_FILE}" | cut -d " " -f 1) + OPTHASH256="hash_sha256=\"${HASH256}\"" fi tee -a /tmp/response > /dev/null <<-EOF - + EOF done