Re: The state of UEFI support in the Kernel and installer

2016-09-06 Thread Warner Losh
On Tue, Sep 6, 2016 at 10:26 AM, Allan Jude  wrote:
>> The other problem is that as far as I can tell, there is no code that 
>> creates the EFI boot entry in any case.  By default, the installer just 
>> moves either boot1.efi or loader.efi (not sure) to:
>> (ESP)/EFI/bootx64.efi,
>> which is the default location for EFI firmware.  I was wondering if the 
>> kernel has the requisite API/driver for adding EFI boot entries yet.  On 
>> (Arch) Linux, you can add an entry to the NVRAM with a tool called bootctl, 
>> which is part of the sd-boot package.
>>
>> Also, wondering if FreeBSD has any plan to add something like 
>> initramfs/EFIStub booting, which allows for much easier bootloader 
>> configuration with sd-boot than the current FreeBSD EFI bootloader, which 
>> must be chainloaded and has its configuration stored off of the ESP.
>>
>
> For historic reasons, users expect to configure the loader via
> /boot/loader.conf not by modifying files on the ESP.

Not entirely true.

We need to support the EFI boot manager protocol (the EFI boot
entries) to properly support next boot, as well as supporting booting
off any partition. The boot manager protocol is done with EFI
environment variables, so there's nothing to change in the ESP. The
rub is to set a EFI variable you have to call runtime services, and to
do that you have to setup a mapping table before calling
ExitBootServices and that's trickier than it sounds. I've been working
on this, but haven't finished.

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: The state of UEFI support in the Kernel and installer

2016-09-06 Thread Allan Jude
On 2016-09-06 12:16, fpqc ?? wrote:
> I was reading this article from the 2013 Dev summit on UEFI:
> 
> https://wiki.freebsd.org/201305DevSummit/UEFI
> 
> In particular, I wanted to ask what is the status on these two goals (from 
> the article):
> 
> The following issues exist:
> - The installer needs to be taught about creating EFI System Partitions (if 
> needed) or selecting an EFI System Partition to install our first- and 
> second-stage boot code.

The installer (both partedit and zfs auto mode), creates and EFI system
partition as required. Currently, this is an 800kb partition that has
/boot/boot1.efifat written to it as an image.

We would like to change this to a larger partition and deal with it as a
filesystem rather than as a slot for a small bootcode file to be written to.

> - The installer needs to be taught about creating EFI boot entries for our 
> boot code once the kernel has an API for this.
> 
> Right now, as of the latest -Current image, the installer does not ask if an 
> EFI System partition already exists, which is rather scary.  When doing a 
> manual (expert) partitioning scheme, the installer should ask for the 
> location of the ESP if it exists, and if no ESP is specified for mounting, 
> the installer should warn that no bootloader will be installed.  

This is rather complicated for the FreeBSD installer. If there is no ESP
on the current drive, it is left to the user to install boot1.efi manually.

The same goes for if the user wishes to reuse an existing ESP.

If bsdinstall creates the ESP for you (it does if you boot the installer
under UEFI and do not tell it otherwise), then it will install the
proper bootcode to the ESP.

> 
> The other problem is that as far as I can tell, there is no code that creates 
> the EFI boot entry in any case.  By default, the installer just moves either 
> boot1.efi or loader.efi (not sure) to:
> (ESP)/EFI/bootx64.efi,
> which is the default location for EFI firmware.  I was wondering if the 
> kernel has the requisite API/driver for adding EFI boot entries yet.  On 
> (Arch) Linux, you can add an entry to the NVRAM with a tool called bootctl, 
> which is part of the sd-boot package.  
> 
> Also, wondering if FreeBSD has any plan to add something like 
> initramfs/EFIStub booting, which allows for much easier bootloader 
> configuration with sd-boot than the current FreeBSD EFI bootloader, which 
> must be chainloaded and has its configuration stored off of the ESP.  
> 

For historic reasons, users expect to configure the loader via
/boot/loader.conf not by modifying files on the ESP.

> ___
> 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"
> 


-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


The state of UEFI support in the Kernel and installer

2016-09-06 Thread fpqc ??
I was reading this article from the 2013 Dev summit on UEFI:

https://wiki.freebsd.org/201305DevSummit/UEFI

In particular, I wanted to ask what is the status on these two goals (from the 
article):

The following issues exist:
- The installer needs to be taught about creating EFI System Partitions (if 
needed) or selecting an EFI System Partition to install our first- and 
second-stage boot code.
- The installer needs to be taught about creating EFI boot entries for our boot 
code once the kernel has an API for this.

Right now, as of the latest -Current image, the installer does not ask if an 
EFI System partition already exists, which is rather scary.  When doing a 
manual (expert) partitioning scheme, the installer should ask for the location 
of the ESP if it exists, and if no ESP is specified for mounting, the installer 
should warn that no bootloader will be installed.  

The other problem is that as far as I can tell, there is no code that creates 
the EFI boot entry in any case.  By default, the installer just moves either 
boot1.efi or loader.efi (not sure) to:
(ESP)/EFI/bootx64.efi,
which is the default location for EFI firmware.  I was wondering if the kernel 
has the requisite API/driver for adding EFI boot entries yet.  On (Arch) Linux, 
you can add an entry to the NVRAM with a tool called bootctl, which is part of 
the sd-boot package.  

Also, wondering if FreeBSD has any plan to add something like initramfs/EFIStub 
booting, which allows for much easier bootloader configuration with sd-boot 
than the current FreeBSD EFI bootloader, which must be chainloaded and has its 
configuration stored off of the ESP.  

___
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"