Skip to content

Commit 08684c3

Browse files
committed
efibootmgr: downgrade missing boot entry in order to warning
Some firmware adds entries to BootOrder that don't have corresponding Boot#### variables. Previously this caused a fatal error when using -o to set the boot order. Downgrade to a warning so users can still set the boot order in this case.
1 parent 0a85e9b commit 08684c3

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

src/efibootmgr.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -809,16 +809,11 @@ parse_order(const char *prefix, char *buffer, uint16_t **order, size_t *length)
809809
exit(8);
810810
}
811811

812-
/* make sure this is an existing entry */
813-
if (!is_current_entry(result)) {
814-
off_t offset = (intptr_t)buf - (intptr_t)buffer;
815-
print_error_arrow(buffer, offset,
816-
"Invalid %s order entry value",
817-
prefix);
812+
/* warn if this entry doesn't exist, but allow it since
813+
* firmware may add entries to the boot order that don't
814+
* have corresponding Boot#### variables */
815+
if (!is_current_entry(result))
818816
warnx("entry %04lX does not exist", result);
819-
free(data);
820-
exit(8);
821-
}
822817

823818
data[i++] = result;
824819
buf[comma] = ',';

0 commit comments

Comments
 (0)