puzzleos / stubby

UEFI bootloader stub
GNU Lesser General Public License v2.1
12 stars 8 forks source link

Add testcase for shim builtin cmdline with no runtime and no marker #44

Closed raharper closed 6 months ago

raharper commented 7 months ago

Test out the path where kernel.efi has a built-in value, without a marker, and no runtime args are supplied.

raharper commented 7 months ago

OK, now it fails with the expected output: we should be able to boot via the builtin cmdline, but we cant due to the kcmdline parsing, which has a bug around this scenario.

I'm going to attempt to fix it and if successful then this will pass.

hallyn commented 7 months ago

Thanks - yes, I think the bug is in kcmdline.c:181. That else block should always happen, so that part1 gets the builtin cmdline.

raharper commented 7 months ago

OK, cool! There are quite a few fixes in this PR. So before we merge, let's sit down and talk about the changes and desired behavior.

raharper commented 7 months ago

I realized that the c files use tabs -- is that policy for stubby? If so, let me know and I can fix up my changes to .c files to use tabs.

hallyn commented 7 months ago

I realized that the c files use tabs -- is that policy for stubby? If so, let me know and I can fix up my changes to .c files to use tabs.

I don't see where that was stated as a policy, but changing your diff is probably easiest.

hallyn commented 7 months ago

(I assume this is just coming from the kernel source, since Paul started this)

raharper commented 7 months ago

After offline discussion, I'm going:

1) add test-case to catch the case: builtin=true, marker=false, secure=true, runtime=true 2) add test-case to catch the case: builtin=false, marker=false, secure=true, runtime=true -- here we will require built-in to have the marker if runtime is to be used 3) add test-case to confirm the case: builtin=true, marker=true, secure=true, runtime=true -- confirm this passes and uses runtime args