Skip to content

Commit 157efc6

Browse files
kexec-select-boot: Fix test for basic mode
The CONFIG_BASIC test was backwards, as a result it skipped the LUKS disk unlock logic if basic mode was _not_ enabled. This wasn't observed in the PureBoot distribution because we disable the LUKS disk unlock feature. CONFIG_BOOT_REQ_ROLLBACK and CONFIG_BOOT_REQ_HASH logic was also skipped incorrectly, though neither of these are enabled on any board so this had no effect in the PureBoot distribution either. Test basic with each bit of logic to eliminate duplication of the kexec-boot call and fix the LUKS disk unlock feature. Signed-off-by: Jonathon Hall <[email protected]>
1 parent 252efc6 commit 157efc6

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

Diff for: initrd/bin/kexec-select-boot

+3-8
Original file line numberDiff line numberDiff line change
@@ -321,20 +321,15 @@ user_select() {
321321

322322
do_boot()
323323
{
324-
if [ "$CONFIG_BASIC" != "y" ]; then
325-
kexec-boot -b "$bootdir" -e "$option" -a "$add" -r "$remove" \
326-
|| die "!!! Failed to boot w/ options: $option"
327-
fi
328-
329-
if [ "$CONFIG_BOOT_REQ_ROLLBACK" = "y" -a "$valid_rollback" = "n" ]; then
324+
if [ "$CONFIG_BASIC" != y ] && [ "$CONFIG_BOOT_REQ_ROLLBACK" = "y" ] && [ "$valid_rollback" = "n" ]; then
330325
die "!!! Missing required rollback counter state"
331326
fi
332327

333-
if [ "$CONFIG_BOOT_REQ_HASH" = "y" -a "$valid_hash" = "n" ]; then
328+
if [ "$CONFIG_BASIC" != y ] && [ "$CONFIG_BOOT_REQ_HASH" = "y" ] && [ "$valid_hash" = "n" ]; then
334329
die "!!! Missing required boot hashes"
335330
fi
336331

337-
if [ "$CONFIG_TPM" = "y" ] && [ -r "$TMP_KEY_DEVICES" ]; then
332+
if [ "$CONFIG_BASIC" != y ] && [ "$CONFIG_TPM" = "y" ] && [ -r "$TMP_KEY_DEVICES" ]; then
338333
INITRD=`kexec-boot -b "$bootdir" -e "$option" -i` \
339334
|| die "!!! Failed to extract the initrd from boot option"
340335
if [ -z "$INITRD" ]; then

0 commit comments

Comments
 (0)