* Proposal: EFI boot stub configuration file
@ 2012-03-16 21:25 Shea Levy
2012-03-16 21:28 ` H. Peter Anvin
2012-03-16 21:32 ` Shea Levy
0 siblings, 2 replies; 4+ messages in thread
From: Shea Levy @ 2012-03-16 21:25 UTC (permalink / raw)
To: linux-kernel; +Cc: matt.fleming, H. Peter Anvin
Hello,
In some EFI boot environments (e.g. booting from an external medium or
non-standard systems where tools like efibootmgr don't work), it is
currently impossible to pass the right arguments to the kernel unless an
EFI shell is launched. To ameliorate this, I propose that if
image->load_options_size is 0 (indicating no arguments were passed) AND
image->parent_handle is NULL (indicating that the image was loaded
automatically by the firmware), then the kernel looks for a file in some
fixed, possibly configurable place (e.g. \efi\linux\params), sets
image->load_options_size to its size, and sets image->load_options to
its contents. On any error whatsoever (finding the file, reading it,
getting its size, whatever), any allocated memory would be freed and
load_options_size would be set back to 0. Since the arguments are
already converted to ASCII and parsed during the boot process, the file
would be expected to be in UCS-2 format and no validation would be done
in the configuration loading code. I'll write something up over the next
week or so and submit it as an RFC patch series, but I thought I'd post
this here first in case anyone has immediate feedback based on this
description.
Cheers,
Shea Levy
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Proposal: EFI boot stub configuration file
2012-03-16 21:25 Proposal: EFI boot stub configuration file Shea Levy
@ 2012-03-16 21:28 ` H. Peter Anvin
2012-03-16 21:36 ` Shea Levy
2012-03-16 21:32 ` Shea Levy
1 sibling, 1 reply; 4+ messages in thread
From: H. Peter Anvin @ 2012-03-16 21:28 UTC (permalink / raw)
To: Shea Levy; +Cc: linux-kernel, matt.fleming
On 03/16/2012 02:25 PM, Shea Levy wrote:
> Hello,
>
> In some EFI boot environments (e.g. booting from an external medium or
> non-standard systems where tools like efibootmgr don't work), it is
> currently impossible to pass the right arguments to the kernel unless an
> EFI shell is launched. To ameliorate this, I propose that if
> image->load_options_size is 0 (indicating no arguments were passed) AND
> image->parent_handle is NULL (indicating that the image was loaded
> automatically by the firmware), then the kernel looks for a file in some
> fixed, possibly configurable place (e.g. \efi\linux\params), sets
> image->load_options_size to its size, and sets image->load_options to
> its contents. On any error whatsoever (finding the file, reading it,
> getting its size, whatever), any allocated memory would be freed and
> load_options_size would be set back to 0. Since the arguments are
> already converted to ASCII and parsed during the boot process, the file
> would be expected to be in UCS-2 format and no validation would be done
> in the configuration loading code. I'll write something up over the next
> week or so and submit it as an RFC patch series, but I thought I'd post
> this here first in case anyone has immediate feedback based on this
> description.
>
A file in UCS-2 seems messed up.
Otherwise, seems like a reasonable idea, with a major caveat... since
the whole point of this is to do something when it isn't possible to set
NVRAM variables, it would make most sense to me if the configuration
file could be founin a specific location relative to the kernel image
itself.
-hpa
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Proposal: EFI boot stub configuration file
2012-03-16 21:28 ` H. Peter Anvin
@ 2012-03-16 21:36 ` Shea Levy
0 siblings, 0 replies; 4+ messages in thread
From: Shea Levy @ 2012-03-16 21:36 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: linux-kernel, matt.fleming
On 3/16/12 5:28 PM, H. Peter Anvin wrote:
> A file in UCS-2 seems messed up.
Yeah, it seemed like a good way to let the code be dumb but upon
reflection it'd just be a confusing inefficiency.
> Otherwise, seems like a reasonable idea, with a major caveat... since
> the whole point of this is to do something when it isn't possible to
> set NVRAM variables, it would make most sense to me if the
> configuration file could be founin a specific location relative to the
> kernel image itself.
OK. I'll try both approaches to see if the code complexity is greatly
increased in the relative path case.
Cheers,
Shea
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Proposal: EFI boot stub configuration file
2012-03-16 21:25 Proposal: EFI boot stub configuration file Shea Levy
2012-03-16 21:28 ` H. Peter Anvin
@ 2012-03-16 21:32 ` Shea Levy
1 sibling, 0 replies; 4+ messages in thread
From: Shea Levy @ 2012-03-16 21:32 UTC (permalink / raw)
To: linux-kernel; +Cc: matt.fleming, H. Peter Anvin
On 3/16/12 5:25 PM, Shea Levy wrote:
> the file would be expected to be in UCS-2 format
Actually, on second thought I could just add a check to see if the
parent handle is NULL in an else if after the already-existing check to
see if the command line options are NULL. Then the file can be expected
to be ASCII.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-03-16 21:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-16 21:25 Proposal: EFI boot stub configuration file Shea Levy
2012-03-16 21:28 ` H. Peter Anvin
2012-03-16 21:36 ` Shea Levy
2012-03-16 21:32 ` Shea Levy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox