Revisiting EFI boot stub config file support
Hi all,
In March last year, I submitted a patch to enable the EFI boot stub to read its config arguments from a file on the ESP, both to help with booting from livecds and to avoid having to use efibootmgr every time you change your boottime arguments. I ended up dropping the submission because I ended up coming to the conclusion that tools like rEFInd and gummiboot were better suited to the task of boot managing than the kernel itself.
Since then, however, I've received enough emails asking about the status of the patch that I think there is room for a simpler entrant into the field of linux EFI boot management. This could be in-kernel, as per my original patch, or a very simple out-of-kernel (but maybe distributed in-tree?) efi image that simply reads linux.conf and boots linux with those parameters. My personal bias is still toward handling this functionality outside of the kernel itself, but before I started the work I thought I'd ask here if anyone thought I should instead bring my old patch up-to-date.
Thoughts?
Thanks,
Shea Levy
P.S. I am subscribed to linux-efi but not lkml, please include me in any replies to lkml.
Quoted 10 lines · Shea Levy
Hi all,
In March last year, I submitted a patch to enable the EFI boot stub to read its config arguments from a file on the ESP, both to help with booting from livecds and to avoid having to use efibootmgr every time you change your boottime arguments. I ended up dropping the submission because I ended up coming to the conclusion that tools like rEFInd and gummiboot were better suited to the task of boot managing than the kernel itself.
Quoted 10 lines
Since then, however, I've received enough emails asking about the status of the patch that I think there is room for a simpler entrant into the field of linux EFI boot management. This could be in-kernel, as per my original patch, or a very simple out-of-kernel (but maybe distributed in-tree?) efi image that simply reads linux.conf and boots linux with those parameters. My personal bias is still toward handling this functionality outside of the kernel itself, but before I started the work I thought I'd ask here if anyone thought I should instead bring my old patch up-to-date.
I am willing to accept this (but I am not the first-line maintainer, Matt is) in the kernel EFI stub as long as there are no hard-coded filenames involved, no automatic behavior, and no "scanning". Those are showstoppers, as is adding to the boot time for nonusers.
-hpa
Quoted 21 lines · H. Peter Anvin
Quoted 10 lines · Shea Levy
Hi all,
In March last year, I submitted a patch to enable the EFI boot stub to read its config arguments from a file on the ESP, both to help with booting from livecds and to avoid having to use efibootmgr every time you change your boottime arguments. I ended up dropping the submission because I ended up coming to the conclusion that tools like rEFInd and gummiboot were better suited to the task of boot managing than the kernel itself.
Quoted 9 lines
Since then, however, I've received enough emails asking about the status of the patch that I think there is room for a simpler entrant into the field of linux EFI boot management. This could be in-kernel, as per my original patch, or a very simple out-of-kernel (but maybe distributed in-tree?) efi image that simply reads linux.conf and boots linux with those parameters. My personal bias is still toward handling this functionality outside of the kernel itself, but before I started the work I thought I'd ask here if anyone thought I should instead bring my old patch up-to-date.
Quoted 4 lines
I am willing to accept this (but I am not the first-line maintainer, Matt is) in the kernel EFI stub as long as there are no hard-coded filenames involved, no automatic behavior, and no "scanning". Those are showstoppers, as is adding to the boot time for nonusers.
Hm, ok. Does the boot stub have access to CONFIG_CMDLINE? Or could another compile-time setting be added so that distros can ship livecds that automatically use a config file found at a hard-coded location?
Quoted 4 lines
-hpa
Quoted 3 lines · Shea Levy
Hm, ok. Does the boot stub have access to
CONFIG_CMDLINE? Or could another compile-time setting be added so that distros can ship livecds that automatically use a config file found at a hard-coded location?
Just pass the config file as the first argument?
Signature · 1 line
Matthew Garrett | [email protected]
Quoted 8 lines · Matthew Garrett
Quoted 3 lines · Shea Levy
Hm, ok. Does the boot stub have access to
CONFIG_CMDLINE? Or could another compile-time setting be added so that distros can ship livecds that automatically use a config file found at a hard-coded location?Just pass the config file as the first argument?
But you can't set args when booting from external media (using e.g. \boot\efi\bootx64.efi), at least not on any system I've seen. And even if you could, that'd over complicate the install process for new users.
Quoted 6 lines
Signature · 5 lines
Matthew Garrett | [email protected] -- To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 4 lines · Shea Levy
But you can't set args when booting from external media (using e.g. \boot\efi\bootx64.efi), at least not on any system I've seen. And even if you could, that'd over complicate the install process for new users.
So have an initial wrapper that launches the kernel and passes an argument. You're going to need something equivalent if you want to support Secure Boot.
Signature · 1 line
Matthew Garrett | [email protected]
Quoted 8 lines · Matthew Garrett
Quoted 3 lines · Shea Levy
Hm, ok. Does the boot stub have access to
CONFIG_CMDLINE? Or could another compile-time setting be added so that distros can ship livecds that automatically use a config file found at a hard-coded location?Just pass the config file as the first argument?
CONFIG_CMDLINE can certainly become available to the stub... it's a compile-time constant.
-hpa