Skip to content

Commit

Permalink
Merge pull request #108 from flatcar/kai/omaha-sha256
Browse files Browse the repository at this point in the history
flatcar-update: Provide hash_sha256 attribute for OEM packages
  • Loading branch information
pothos authored Sep 28, 2023
2 parents 53b0aa5 + e98bfdc commit 1b5a096
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 1b5a096

Please sign in to comment.