Skip to content

Commit

Permalink
flatcar-update: Provide hash_sha256 attribute for OEM packages
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
pothos committed Sep 27, 2023
1 parent 53b0aa5 commit e98bfdc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bin/flatcar-update
Original file line number Diff line number Diff line change
Expand Up @@ -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
<package name="${BASEFILENAME}" hash="${HASH}" size="${SIZE}" required="${REQUIRED}"></package>
<package name="${BASEFILENAME}" hash="${HASH}" ${OPTHASH256} size="${SIZE}" required="${REQUIRED}"></package>
EOF
done

Expand Down

0 comments on commit e98bfdc

Please sign in to comment.