Adding a new efi-update-loader script: need help understanding Makefile.inc1 for "make installworld"

Warner Losh imp at bsdimp.com
Mon Mar 25 15:06:00 UTC 2019


On Mon, Mar 25, 2019, 3:28 AM Rodney W. Grimes <
freebsd-rwg at gndrsh.dnsmgr.net> wrote:

> > On Sat, Mar 23, 2019 at 08:21:43PM -0600, Rebecca Cran via
> freebsd-hackers wrote:
> > > I've been working on EFI support, and have a review
> > > (https://reviews.freebsd.org/D19588) to add a script,
> efi-update-loader,
> > > which will update the ESP containing the FreeBSD boot1.efi or
> loader.efi.
> > >
> > > I'd like to integrate it into the build system so it gets run when
> users
> > > do a "make installworld", but I'm lost looking through Makefile.inc1 -
> I
> > > have no clue where to add the code.
> > >
> > > Does anyone understand where and what to add?
> >
> > Can we take use of the opportunity and finally stop installing loader
> > at installworld target at all, please ?
> >
> > Add e.g. installloader target which would do whatever needed to loader.
>
> +1  boot code and loaders should  always be seperated from the
> install target.  Historically this was casued by the fact that
> the boot code and loader lived outside the file system and
> required operations beyond updating /usr/mdec (very ancient)
> or /boot/boot* (historical).  Now that /boot/loader* is an
> immeditate effect on the bootability of the system it makes
> since to seperate this from the installworld target.
>

We started installing /boot/loader with install world in FreeBSD -3.x and
it has affected the boot ability that whole time... in the early days of
loader, the kernel loader handoff protocol was immature enough to need a
matched kernel. But that period lasted only a few months...  loader has
also been weird in other ways as well, since some embedded systems used the
one in its, while others needed an extra step. As UEFI support has matured
we're finding there are several issues around it as well where updating the
ESP needs to be tied to updating /boot for the system to work sometimes. It
has grown more complex over time, so we should separate. It's been a little
weird on all the non x86 platforms to different degrees, but now that our
main platform is affected it's become clear we may need to change.

But we need to do so carefully as this violates POLA in a huge way, as well
as needing doc changes in a bajillion places.

Warner

--
> Rod Grimes
> rgrimes at freebsd.org
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
>


More information about the freebsd-hackers mailing list