]> git.ipfire.org Git - thirdparty/systemd.git/commit
stub: Detect empty LoadOptions when run from EFI shell 25222/head
authorJan Janssen <medhefgo@web.de>
Wed, 2 Nov 2022 09:25:32 +0000 (10:25 +0100)
committerJan Janssen <medhefgo@web.de>
Sun, 27 Nov 2022 16:13:04 +0000 (17:13 +0100)
commitb17f3b3d8077ab6827549a123ac636d655fe8d4d
treecb6c05dd57902f5d90fc15f905a37f1c77398c78
parent927ebebe588970fa2dd082a0daaef246229f009b
stub: Detect empty LoadOptions when run from EFI shell

The EFI shell will pass the entire command line to the application it
starts, which includes the file path of the stub binary. This prevents
us from using the built-in cmdline if the command line is otherwise
empty.

Fortunately, the EFI shell registers a protocol on any images it starts
this way. The protocol even lets us access the args individually, making
it easy to strip the stub path off.

Fixes: #25201
src/boot/efi/missing_efi.h
src/boot/efi/stub.c