Re: EFI boot: can we make loader.efi work as BOOT{x64, aa64, arm, ia32}.efi?

2016-08-01 Thread Warner Losh
On Sun, Jul 31, 2016 at 12:20 AM, Xin Li  wrote:
> Hi,
>
> I finally got some time to explore the UEFI boot process (kudos to
> everyone who made this work!) and getting myself familiarize with the
> basics.
>
> One quick question -- Is there some technical restriction that prevents
> us from merging boot1.efi and loader.efi into one binary?

Yes. There's many technical reasons. Don't do it.

loader.efi loads all the forth stuff from the partition it was loaded from.
If you merge, it cannot do that.

boot.efi should implement the UEFI boot manager protocol, but doesn't.
Once it does, it can't be merged with loader.efi.

We have deep issues with loader.efi if you have any system that's
even a little complex. As these issues have come up, some have
been fixed, but others haven't. It hasn't been possible, without
ugly hacks, to boot off ping / pong partitions on the same disk
for example.

Please do not do this. It is a really bad idea.

Warner
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: EFI boot: can we make loader.efi work as BOOT{x64, aa64, arm, ia32}.efi?

2016-08-01 Thread Warner Losh
On Sun, Jul 31, 2016 at 12:51 AM, Nathan Whitehorn
 wrote:
>
>
> On 07/30/16 23:20, Xin Li wrote:
>>
>> Hi,
>>
>> I finally got some time to explore the UEFI boot process (kudos to
>> everyone who made this work!) and getting myself familiarize with the
>> basics.
>>
>> One quick question -- Is there some technical restriction that prevents
>> us from merging boot1.efi and loader.efi into one binary?
>>
>> Cheers,
>>
>
> No technical reason (and, in fact, when you boot from CD, that's how it
> works). The reason they are different is that we traditionally don't mount
> the EFI partition and so make installworld can't replace things there.
> boot1.efi is a basically static piece of code that doesn't need updates and
> can load loader, which does get updates, from a UFS/ZFS system.

boot1.efi is anything *BUT* a static piece of code. It was written to be
such, but it's functionality is so limited that it is severely limiting what
we can do on systems that want to, for example, boot off one partition
after updating from another. That cannot be in loader.efi since that's part
of the installed package.

> loader.efi additionally assumes that it is started from the same partition
> that contains the kernel, loader.conf, fstab, etc., which are also generally
> not on the EFI partition (except in the CD case).

That's likely one of several issues. Our EFI support is immature still. It
works great if you have one disk that you want to boot off of. Once you
stray far beyond that, there are many dragons. I think trying to merge
the two is premature.

Warner
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: EFI boot: can we make loader.efi work as BOOT{x64, aa64, arm, ia32}.efi?

2016-07-31 Thread Andrew Turner
On Sat, 30 Jul 2016 23:20:55 -0700
Xin Li  wrote:

> Hi,
> 
> I finally got some time to explore the UEFI boot process (kudos to
> everyone who made this work!) and getting myself familiarize with the
> basics.
> 
> One quick question -- Is there some technical restriction that
> prevents us from merging boot1.efi and loader.efi into one binary?

The only issue I know about is loader.efi will use the wrong partition
to load the kernel. This is because it assumes the kernel is to be
loaded from the same filesystem as it was.

Andrew
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: EFI boot: can we make loader.efi work as BOOT{x64, aa64, arm, ia32}.efi?

2016-07-30 Thread Nathan Whitehorn



On 07/30/16 23:20, Xin Li wrote:

Hi,

I finally got some time to explore the UEFI boot process (kudos to
everyone who made this work!) and getting myself familiarize with the
basics.

One quick question -- Is there some technical restriction that prevents
us from merging boot1.efi and loader.efi into one binary?

Cheers,



No technical reason (and, in fact, when you boot from CD, that's how it 
works). The reason they are different is that we traditionally don't 
mount the EFI partition and so make installworld can't replace things 
there. boot1.efi is a basically static piece of code that doesn't need 
updates and can load loader, which does get updates, from a UFS/ZFS system.


loader.efi additionally assumes that it is started from the same 
partition that contains the kernel, loader.conf, fstab, etc., which are 
also generally not on the EFI partition (except in the CD case).

-Nathan
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"