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

Fix invalid return statements in apply-dbx hostapp-update hook #3514

Merged
merged 1 commit into from
Sep 13, 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
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@ CURRENT_DB_ESL="/resin-boot/balena-keys/db.esl"

if [ ! -d "${EFI_DIR}" ]; then
# Not an EFI system, nothing to do
return
exit
fi

SECUREBOOT_VAL=$(efivar -p -n "${SECUREBOOT_VAR}" | tail -n 1 | sed -e "${EFIVAR_RE}")
if [ "${SECUREBOOT_VAL}" -ne 1 ]; then
# Secure boot disabled, nothing to do
return
exit
fi

if [ ! -d "${PENDING_DBX_DIR}" ]; then
# Unexpected state - the directory should have been created by HUP
# With it missing, there is nothing we can do
echo "Rollback: Directory '${PENDING_DBX_DIR}' should exist but it does not"
return
exit 1
fi

echo "Rollback: Applying pending DBX updates to prevent formerly allowed OS versions to boot"
Expand Down
Loading