4 ms·
I'd quite like UEFI to be able to pass some kind of argv[0] to the direct-loaded kernel, so the kernel knows exactly which file on which partition of which disk
by londons_explore 3y ago
I'd quite like UEFI to be able to pass some kind of argv[0] to the direct-loaded kernel, so the kernel knows exactly which file on which partition of which disk it was loaded from. That would then become the default root filesystem.
That effectively removes all config from the process - and means that any disk with a uefi executable kernel can be booted without the mystery step of "lets try to figure out where we're booting from".
- hackmiester 3y agoThis does work inside of rEFInd, which can load a kernel EFI blob directly, and supply it args.
- bpye 3y ago> I'd quite like UEFI to be able to pass some kind of argv[0] to the direct-loaded kernel, so the kernel knows exactly which file on which partition of which disk it was loaded from. That would then become the default root filesystem. I think UEFI gives an EFI application (such as the Linux kernel) everything it would need for this already - but I guess Linux doesn't use it. The EFI application entry point includes a handle to your own image [0], and the EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID [1] protocol allows you to query the path it was loaded from. It is possible for an image to be loaded without a path, but it looks like EDK2 provides it at least [2]. [0] - https://uefi.org/specs/UEFI/2.10/07_Services_Boot_Services.html#efi-image-entry-point https://uefi.org/specs/UEFI/2.10/07_Services_Boot_Services.h... [1] - https://uefi.org/specs/UEFI/2.10/09_Protocols_EFI_Loaded_Image.html#efi-loaded-image-device-path-protocol https://uefi.org/specs/UEFI/2.10/09_Protocols_EFI_Loaded_Ima... [2] - https://github.com/tianocore/edk2/blob/991515a0583f65a64b3a6fa354409c64e670a762/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c#L1932 https://github.com/tianocore/edk2/blob/991515a0583f65a64b3a6...
- CameronNemo 3y agoI think discoverable partitions are intended to solve this problem. https://uapi-group.org/specifications/specs/discoverable_partitions_specification/ https://uapi-group.org/specifications/specs/discoverable_par...