Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate HMAC for kernel on build #187

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions twoliter/embedded/rpm2img
Original file line number Diff line number Diff line change
Expand Up @@ -451,15 +451,20 @@ mkdir -p "${ROOT_MOUNT}/boot/grub"
# Now that we're done messing with /, move /boot out of it
mv "${ROOT_MOUNT}/boot"/* "${BOOT_MOUNT}"

pushd "${BOOT_MOUNT}" >/dev/null

vmlinuz="vmlinuz"
if [ "${UEFI_SECURE_BOOT}" == "yes" ] ; then
pushd "${BOOT_MOUNT}" >/dev/null
vmlinuz="vmlinuz"
pesign -i "${vmlinuz}" -o "${vmlinuz}.signed" -s "${CODE_SIGN_KEY[@]}"
mv "${vmlinuz}.signed" "${vmlinuz}"
pesigcheck -i "${vmlinuz}" -n 0 -c "${SBKEYS}/vendor.cer"
popd >/dev/null
fi

# Generate an HMAC for the kernel after signing.
sha512hmac "${vmlinuz}" > ".${vmlinuz}.hmac"

popd >/dev/null

# Set the Bottlerocket variant, version, and build-id
SYS_ROOT="${ARCH}-bottlerocket-linux-gnu/sys-root"
VERSION="${VERSION_ID} (${VARIANT})"
Expand Down
Loading