Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Sep 2022 14:36:02 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
Cc:        "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org>
Subject:   Re: following -current on rpi4 with zfs-on-root
Message-ID:  <CANCZdfq-RkVTMYk5ZW-LShU6XzNTdKk0TvrNWrmC4jgaC31cUA@mail.gmail.com>
In-Reply-To: <d30f002b-08d0-e697-55b3-49d848a2edd1@plan-b.pwste.edu.pl>
References:  <YykmFkdqKKW30dM9@void.f-m.fm> <CANCZdfq%2Bm3iFpbU%2BLu12nCvvtT5Swx=MYrC1FkOj5ZhfN%2BocmA@mail.gmail.com> <YymzEH3bUWmtvPUB@void.f-m.fm> <d30f002b-08d0-e697-55b3-49d848a2edd1@plan-b.pwste.edu.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
--0000000000007f0fe905e921c7eb
Content-Type: text/plain; charset="UTF-8"

On Tue, Sep 20, 2022 at 10:29 AM Marek Zarychta <
zarychtam@plan-b.pwste.edu.pl> wrote:

> W dniu 20.09.2022 o 14:33, void pisze:
> > On Mon, Sep 19, 2022 at 09:48:42PM -0600, Warner Losh wrote:
> >
> >> I've updated UPDATING in https://reviews.freebsd.org/D36629. Please
> >> review.
> >
> >> For EFI, there are many choices. The default installation places
> >> loader.efi into the ESP in EFI\FREEBSD\LOADER.EFI. The following
> >> updates it (assuming the ESP is on p1, and isn't already mounted):
> >> mount -t msdos /dev/ada0p1 /boot/efi
> >> cp /boot/efi/loader.efi /boot/efi/efi/freebsd
> >> If you have a non-standard setup, please see the EFI notes section.
> >
> > My non-expert opinion:
> >
> > 1. ideally there should be an indication in what circumstances
> >     the above is required, because it might not be possible to infer
> >     for the non-expert (with regards to the above) user
>
> While following CURRENT branch, updates of the ESP loader have to be
> done quite often. For STABLE branches, it might not be required at all
> for the whole lifecycle. Reading UPDATING and commit messages could help.
>

They are only ever needed after 'zfs upgrade' on the zpool that you are
booting from.


> > 2. if it needs to happen, where in the buildworld/kernel/install/
> >     etcupdate/reboot sequence is it required? I would guess after
> >     etcupdate and before reboot, but guessing isn't the same as knowing.
> >     It would be great if this was in the Source of Truth(tm).
>

Yes, the order should be:

buildworld, buildkernel, installkernel, reboot, installworld, install new
ESP
loader, zfs upgrade. You don't need to do the last two steps if you don't
do the last step.


> There is no official HOWTO upgrade for arm64 on ZFS. Upgrading from
> sources is a pretty straightforward and standard procedure described in
> the handbook[1]. Usually, such an upgrade is done not in-place, but by
> cross-building and cross-instaling on amd64 machine, so rebooting is not
> required.
>
> To upgrade the loader, you need to copy _newly_ built file
> /boot/loader_lua.efi to EFI/BOOT/bootaa64.efi on ESP partition. So
> upgrading loader on ESP partition can be performed no earlier than after
> completing installworld, which is too late if you are going to strictly
> follow[1] and reboot between installkernel and installworld steps. If
> you are going to follow the handbook, you can find in the OBJDIR freshly
> built loader
> (/usr/obj/usr/src/arm64.aarch64/stand/efi/loader_lua/loader_lua.efi) and
> copy it to the ESP prior to rebooting as described in review D36629[2].
>

My order doesn't require copying from the objtree :).

Warner


> [1] https://docs.freebsd.org/en/books/handbook/cutting-edge/#makeworld
> [2] https://reviews.freebsd.org/D36629
>
> --
> Marek Zarychta
>

--0000000000007f0fe905e921c7eb
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Tue, Sep 20, 2022 at 10:29 AM Mare=
k Zarychta &lt;<a href=3D"mailto:zarychtam@plan-b.pwste.edu.pl">zarychtam@p=
lan-b.pwste.edu.pl</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote=
" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);=
padding-left:1ex">W dniu 20.09.2022 o=C2=A014:33, void pisze:<br>
&gt; On Mon, Sep 19, 2022 at 09:48:42PM -0600, Warner Losh wrote:<br>
&gt; <br>
&gt;&gt; I&#39;ve updated UPDATING in <a href=3D"https://reviews.freebsd.or=
g/D36629" rel=3D"noreferrer" target=3D"_blank">https://reviews.freebsd.org/=
D36629</a>. Please <br>
&gt;&gt; review.<br>
&gt; <br>
&gt;&gt; For EFI, there are many choices. The default installation places<b=
r>
&gt;&gt; loader.efi into the ESP in EFI\FREEBSD\LOADER.EFI. The following<b=
r>
&gt;&gt; updates it (assuming the ESP is on p1, and isn&#39;t already mount=
ed):<br>
&gt;&gt; mount -t msdos /dev/ada0p1 /boot/efi<br>
&gt;&gt; cp /boot/efi/loader.efi /boot/efi/efi/freebsd<br>
&gt;&gt; If you have a non-standard setup, please see the EFI notes section=
.<br>
&gt; <br>
&gt; My non-expert opinion:<br>
&gt; <br>
&gt; 1. ideally there should be an indication in what circumstances<br>
&gt;=C2=A0 =C2=A0=C2=A0 the above is required, because it might not be poss=
ible to infer<br>
&gt;=C2=A0 =C2=A0=C2=A0 for the non-expert (with regards to the above) user=
 <br>
<br>
While following CURRENT branch, updates of the ESP loader have to be <br>
done quite often. For STABLE branches, it might not be required at all <br>
for the whole lifecycle. Reading UPDATING and commit messages could help.<b=
r></blockquote><div><br></div><div>They are only ever needed after &#39;zfs=
 upgrade&#39; on the zpool that you are</div><div>booting from.=C2=A0</div>=
<div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px =
0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
&gt; 2. if it needs to happen, where in the buildworld/kernel/install/<br>
&gt;=C2=A0 =C2=A0=C2=A0 etcupdate/reboot sequence is it required? I would g=
uess after<br>
&gt;=C2=A0 =C2=A0=C2=A0 etcupdate and before reboot, but guessing isn&#39;t=
 the same as knowing.<br>
&gt;=C2=A0 =C2=A0=C2=A0 It would be great if this was in the Source of Trut=
h(tm).<br></blockquote><div><br></div><div>Yes, the order should be:</div><=
div><br></div><div>buildworld, buildkernel, installkernel, reboot, installw=
orld, install new ESP</div><div>loader, zfs upgrade. You don&#39;t need to =
do the last two steps if you don&#39;t</div><div>do the last step.</div><di=
v><br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0=
.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
There is no official HOWTO upgrade for arm64 on ZFS. Upgrading from <br>
sources is a pretty straightforward and standard procedure described in <br=
>
the handbook[1]. Usually, such an upgrade is done not in-place, but by <br>
cross-building and cross-instaling on amd64 machine, so rebooting is not <b=
r>
required.<br>
<br>
To upgrade the loader, you need to copy _newly_ built file <br>
/boot/loader_lua.efi to EFI/BOOT/bootaa64.efi on ESP partition. So <br>
upgrading loader on ESP partition can be performed no earlier than after <b=
r>
completing installworld, which is too late if you are going to strictly <br=
>
follow[1] and reboot between installkernel and installworld steps. If <br>
you are going to follow the handbook, you can find in the OBJDIR freshly <b=
r>
built loader <br>
(/usr/obj/usr/src/arm64.aarch64/stand/efi/loader_lua/loader_lua.efi) and <b=
r>
copy it to the ESP prior to rebooting as described in review D36629[2].<br>=
</blockquote><div><br></div><div>My order doesn&#39;t require copying from =
the objtree :).</div><div><br></div><div>Warner</div><div><br></div><blockq=
uote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1p=
x solid rgb(204,204,204);padding-left:1ex">
<br>
[1] <a href=3D"https://docs.freebsd.org/en/books/handbook/cutting-edge/#mak=
eworld" rel=3D"noreferrer" target=3D"_blank">https://docs.freebsd.org/en/bo=
oks/handbook/cutting-edge/#makeworld</a><br>
[2] <a href=3D"https://reviews.freebsd.org/D36629" rel=3D"noreferrer" targe=
t=3D"_blank">https://reviews.freebsd.org/D36629</a><br>;
<br>
-- <br>
Marek Zarychta<br>
</blockquote></div></div>

--0000000000007f0fe905e921c7eb--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfq-RkVTMYk5ZW-LShU6XzNTdKk0TvrNWrmC4jgaC31cUA>