From nobody Fri Aug 19 18:42:36 2022 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4M8VxN2PL2z4YqNf for ; Fri, 19 Aug 2022 18:42:48 +0000 (UTC) (envelope-from eduardo@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M8VxN2Dcrz3TKT for ; Fri, 19 Aug 2022 18:42:48 +0000 (UTC) (envelope-from eduardo@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660934568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LbP3uWf4FMKipOWXh2YpyvHBTsLRGDpaBQ+B3akju+I=; b=h3oCeM/U+CjFWq6E1GxDuaKPMTDAUPx2wx+yjvca1T88xIX/fMrHGnF25hV2N4Jq+B+Lb9 /YkSf0d2wn/SfUVjTB4YgGNa/9gWaQQpY9c/uozRfphhhCPKDBKxD51EYUC0ZmDXGnF6uV D+/xzr3S9vmDe9O9O83/5CZ039qKGffYxTCRdWNfDyulmPIi1R02UE2fOy48D/McmU0UMW tf2GtMdoQdSgrNNOtRnUqYR2Fvhr/frEu2ZVip3scohYmCDI8EP8CV8EyoO+IJBf/WryCt f35/g76cZ7eO9tl+wzOBDVhC7jlDRFWqhWLsCTustF0Ot9A0ChEZjvackdYQ4Q== Received: from mail-ua1-f45.google.com (mail-ua1-f45.google.com [209.85.222.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) (Authenticated sender: eduardo) by smtp.freebsd.org (Postfix) with ESMTPSA id 4M8VxN17mpz1J9s for ; Fri, 19 Aug 2022 18:42:48 +0000 (UTC) (envelope-from eduardo@freebsd.org) Received: by mail-ua1-f45.google.com with SMTP id s5so2109362uar.1 for ; Fri, 19 Aug 2022 11:42:48 -0700 (PDT) X-Gm-Message-State: ACgBeo18nqUXijw1mJI71MdGM5LCxg3TlDArJ+i/SLn9ZIlNuyinT87J tPDtWzki+hBrLh1O4FrvBP8BHEjBjhZqxG1RSlk= X-Google-Smtp-Source: AA6agR7CLJKZ1OYPlRh45OzexEU8zA2XwRUylFyTzbprR3VjmrZUZ2aLSyhxSYtDTctL2rj8AuFsmJf1GK0JvxIWzqQ= X-Received: by 2002:a9f:358c:0:b0:387:9de3:6c8a with SMTP id t12-20020a9f358c000000b003879de36c8amr3457830uad.94.1660934567579; Fri, 19 Aug 2022 11:42:47 -0700 (PDT) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 References: <62B26DE1-0E26-40BA-8647-E591E9ACEB7A@me.com> In-Reply-To: From: Nuno Teixeira Date: Fri, 19 Aug 2022 19:42:36 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: 24.3. Updating Bootcode To: Warner Losh Cc: Toomas Soome , FreeBSD CURRENT Content-Type: multipart/alternative; boundary="000000000000e5586605e69c7634" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660934568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LbP3uWf4FMKipOWXh2YpyvHBTsLRGDpaBQ+B3akju+I=; b=Qg7tZYIjgtT+i+xC65DtBsaQe42pTMOMSdwxm495MWC9ar4am+0vKUKN+7/f8ilMQVKq70 1yG1Q6ufWovTlN/V7rDZ49n7bEHqbA94BJiSGVt7SBC8UIVJzcq8oxZOcPIwUXWHKvHgAK Azwbd8KLLhhp8KjVgJR9+2fDoo6KFF3xBevVPwm2Fet6CCaAyxnuvYzROS2kOmMIshPtTf TE6cjujPs7/svH6nA+uZRHGrOEA5RkPHazON6XmtRzSyIGTKHRwgUE8rTpRfjdYEnu9wYR wItMGp7BmnDVE2u46YoBOHYNY4xmAXM4NWmbrC09pMlU/RKSwJN5AJwhX28FuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660934568; a=rsa-sha256; cv=none; b=Q/pNhCNoYTvkANo83ov3w6KWc24I2IVE3jav00stWWlIXL2QocJopO93hkBoFqhhw71f3U B66osyW/R2wtrxLT8YL+XbdqPQ244NG9g7BzHnw3GJiMArQEIiXXXoDGTX2IPvnCmogo7Q t1budafvppdft39W0+yt+2fbPsr2efST7iaJMRZtTcC88oDDn0J3/cfHaBqr2ZslZM6F8m WcFLSlc3lG8BAWOnBdvfrSFBjhyHh+L1rCS7H7wgF2Xe4e4mkGuAMGyi15xHh6vweynN1U FkcQrD7x7waRPIPt/gzno65ziEhgNu7dhi3q4cBtYpniRjPV1qrfUSvKqdnPAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N --000000000000e5586605e69c7634 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable @ main-n257521-97be6fced7db Clean boot without warnings. OK. Thanks, Nuno Teixeira escreveu no dia quinta, 18/08/2022 =C3= =A0(s) 12:04: > Forgot to send a screenshot > for > loader.efi @ main-n257458-ef8b872301c5 > ( +Boot0007* FreeBSD-14 > HD(1,GPT,73acd1b2-de41-11eb-8156-002b67dfc673,0x28,0x82000)/File(\efi\fre= ebsd\loader.efi) > nvd0p1:/efi/freebsd/loader.efi > /boot/efi//efi/freebsd/loader.efi ) > > Someone talked about this warnings earlier: > --- > Attempted extraction of recovery data from stadard superblock: failed > Attempt to find boot zone recovery data: failed > (...) > --- > But it boots ok. > > Cheers, > > Nuno Teixeira escreveu no dia quarta, 17/08/2022 > =C3=A0(s) 19:18: > >> *** and "EFI Hard Drive"(legacy /efi/boot/bootx64.efi) from BIOS. >> ^^^^ >> >> Nuno Teixeira escreveu no dia quarta, 17/08/2022 >> =C3=A0(s) 19:14: >> >>> Hi, >>> >>> And it's done: >>> --- >>> Boot0007* FreeBSD-14 >>> HD(1,GPT,73acd1b2-de41-11eb-8156-002b67dfc673,0x28,0x82000)/File(\efi\f= reebsd\loader.efi) >>> nvd0p1:/efi/freebsd/loader.efi >>> /boot/efi//efi/freebsd/loader.efi >>> +Boot0006* FreeBSD-14_old >>> HD(1,GPT,73acd1b2-de41-11eb-8156-002b67dfc673,0x28,0x82000)/File(\efi\f= reebsd\loader-old.efi) >>> nvd0p1:/efi/freebsd/loader-old.efi >>> /boot/efi//efi/freebsd/loader-old.efi >>> Boot0004* Windows Boot Manager >>> HD(1,GPT,8c497825-1db2-41f8-8924-85dfd0bb7283,0x800,0x82000)/File(\EFI\= Microsoft\Boot\bootmgfw.efi) >>> >>> da1p1:/EFI/Microsoft/Boot/bootmgfw.efi (null) >>> Boot0000* EFI Hard Drive (SAMSUNG MZVLB1T0HBLR-000L2) >>> PciRoot(0x0)/Pci(0x1d,0x0)/Pci(0x0,0x0)/NVMe(0x1,39-f9-b8-01-81-38-25-0= 0)/HD(1,GPT,73acd1b2-de41-11eb-8156-002b67dfc673,0x28,0x82000) >>> --- >>> and I can choose "FreeBSD-14"(/efi/freebsd/loader.efi), >>> "FreeBSD-14_old"(/efi/freebsd/loader-old.efi) and "EFI Hard >>> Drive"(legacy /efi/bootx64.efi) from BIOS. >>> >>> NOTE: efibootmgr(8) example is: >>> --- >>> efibootmgr -a -c -l /boot/efi/EFI/freebsd/loader.efi -L FreeBSD-11 >>> ^^^ >>> --- >>> But I choosed "efi" instead of "EFI"... >>> >>> Thanks all for helping me understand it! >>> >>> Cheers, >>> >>> >>> Warner Losh escreveu no dia ter=C3=A7a, 16/08/2022 =C3= =A0(s) >>> 18:19: >>> >>>> >>>> >>>> On Tue, Aug 16, 2022 at 6:01 AM Nuno Teixeira >>>> wrote: >>>> >>>>> Hi Toomas, >>>>> >>>>> For better OS support, the UEFI specification (UEFI 2.8A Feb 14, page >>>>>> 499) is suggesting to use structure like: >>>>>> >>>>>> /efi//=E2=80=A6 >>>>>> >>>>>> And to use this suggestion, it means the UEFI Boot Manager needs to >>>>>> be configured (see efibootmgr(8)). >>>>>> >>>>>> Therefore, once you have set up OS specific setup, there is no use >>>>>> for default (/efi/boot/=E2=80=A6) and you need to update one or= another, but >>>>>> not both. >>>>>> >>>>> >>>>> FreeBSD have /efi/freebsd/... but it's not configured in >>>>> efibootmgr: >>>>> >>>> >>>> The current default installer will do this, but older upgraded systems >>>> don't do this by default. Likely you are looking at an older >>>> system and/or one of the 'bad actors' that reset this stuff between >>>> boots. >>>> >>>> >>>>> efibootmgr -v: >>>>> --- >>>>> BootOrder : 0004, 0000, 2002, 2003, 2001 >>>>> Boot0004* Windows Boot Manager >>>>> HD(1,GPT,8c497825-1db2-41f8-8924-85dfd0bb7283,0x800,0x82000)/File(\EF= I\Microsoft\Boot\bootmgfw.efi) >>>>> >>>>> da0p1:/EFI/Microsoft/Boot/bootmgfw.efi (null) >>>>> +Boot0000* EFI Hard Drive (SAMSUNG MZVLB1T0HBLR-000L2) >>>>> PciRoot(0x0)/Pci(0x1d,0x0)/Pci(0x0,0x0)/NVMe(0x1,39-f9-b8-01-81-38-25= -00)/HD(1,GPT,73acd1b2-de41-11eb-8156-002b67dfc673,0x28,0x82000) >>>>> Boot2002* EFI DVD/CDROM >>>>> Boot2003* EFI Network >>>>> Boot2001* EFI USB Device >>>>> --- >>>>> so boot is definitely using /efi/boot/bootx64.efi @Boot0000 >>>>> >>>> >>>> In your case, that's true. The "EFI Hard Drive" is a default entry the >>>> UEFI BIOS created for you. >>>> >>>> >>>>> I think I can create a new boot: >>>>> --- >>>>> efibootmgr -a -c -l /boot/efi/efi/freebsd/loader.efi -L FreeBSD-14 >>>>> (and make it active) >>>>> efibootmgr -a -b NNNN >>>>> --- >>>>> and create other for loader.efi.old in case of problems. >>>>> >>>> >>>> Yes. >>>> >>>> >>>>> In this case I will need only update /efi/freebsd/loader.efi. >>>>> >>>>> Q: for what has been said in mailing, boot is compiled in >>>>> /usr/src/stand, isn't a good idea that when it install new boot it ba= ckup >>>>> old boot like /boot/kernel -> /boot/kernel.old? >>>>> >>>> >>>> Yes. In fact that's what's done, but only for the BIOS version. We >>>> should do the same for efi but don't seem to do so currently. But that= 's >>>> likely tied up behind issues of installing things automatically into t= he >>>> ESP on 'installworld'. >>>> >>>> Warner >>>> >>> >>> >>> -- >>> Nuno Teixeira >>> FreeBSD Committer (ports) >>> >> >> >> -- >> Nuno Teixeira >> FreeBSD Committer (ports) >> > > > -- > Nuno Teixeira > FreeBSD Committer (ports) > --=20 Nuno Teixeira FreeBSD Committer (ports) --000000000000e5586605e69c7634 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
@ main-n257521-97be6fced7db

= Clean boot without warnings.
OK.

Tha= nks,

Nuno Teixeira <ed= uardo@freebsd.org> escreveu no dia quinta, 18/08/2022 =C3=A0(s) 12:0= 4:
Forgot to send a screenshot for loader.efi @ m= ain-n257458-ef8b872301c5
( +Boot0007* FreeBSD-14 HD(1,GPT,73acd1b= 2-de41-11eb-8156-002b67dfc673,0x28,0x82000)/File(\efi\freebsd\loader.efi)=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0nvd0p1:/efi/freebsd/loader.efi /boot/efi//efi/freebsd/load= er.efi )

Someone talked about this warnings earlie= r:
---
Attempted extraction of recovery data from stada= rd superblock: failed
Attempt to find boot zone recovery data: fa= iled
(...)
---
But it boots ok.

=
Cheers,

Nuno Teixeira <eduardo@freebsd.org> escreveu no dia quarta, 1= 7/08/2022 =C3=A0(s) 19:18:
*** and "EFI Hard Drive"(legacy = <ESP>/efi/boot/bootx64.efi) from BIOS.
=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 ^^^^

Nuno Teixeira <eduardo@freebsd.org> escreveu no dia quarta, 17/08= /2022 =C3=A0(s) 19:14:
Hi,

And it's done= :
---
=C2=A0Boot0007* FreeBSD-14 HD(1,GPT,73acd1b2-de41= -11eb-8156-002b67dfc673,0x28,0x82000)/File(\efi\freebsd\loader.efi)
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0nvd0p1:/efi/freebsd/loader.efi /boot/efi//efi/freebsd/loader.e= fi
+Boot0006* FreeBSD-14_old HD(1,GPT,73acd1b2-de41-11eb-8156-002b67dfc6= 73,0x28,0x82000)/File(\efi\freebsd\loader-old.efi)
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0nvd0p1:/efi/freebsd/loader-old.efi /boot/efi//efi/freebsd/loader-= old.efi
=C2=A0Boot0004* Windows Boot Manager HD(1,GPT,8c497825-1db2-41f8= -8924-85dfd0bb7283,0x800,0x82000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0da1p1:/EFI/Microsoft/Bo= ot/bootmgfw.efi (null)
=C2=A0Boot0000* EFI Hard Drive (SAMSUNG MZVLB1T0H= BLR-000L2) PciRoot(0x0)/Pci(0x1d,0x0)/Pci(0x0,0x0)/NVMe(0x1,39-f9-b8-01-81-= 38-25-00)/HD(1,GPT,73acd1b2-de41-11eb-8156-002b67dfc673,0x28,0x82000)
=
---
and I can choose "FreeBSD-14"(<ESP>/efi/= freebsd/loader.efi), "FreeBSD-14_old"(<ESP>/efi/freebsd/loa= der-old.efi) and "EFI Hard Drive"(legacy <ESP>/efi/bootx64.= efi) from BIOS.

NOTE: efibootmgr(8) example is:
---
efibootmgr -a -c -l /boot/efi/EFI/freebsd/loader.efi = -L FreeBSD-11
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^^^
---
But I choosed "efi" instead of "EFI"...

Thanks all for helping me understand it!

Cheers,


Warner Losh <imp@bsdimp.com> escreveu no dia ter= =C3=A7a, 16/08/2022 =C3=A0(s) 18:19:


On Tue, Aug 16, = 2022 at 6:01 AM Nuno Teixeira <eduardo@freebsd.org> wrote:
Hi Toomas,

For better OS support, the UEFI specification (UEFI 2.8A Feb 14, page 499) = is suggesting to use structure like:

<ESP>/efi/<OS>/=E2=80=A6

And to use this suggestion, it means the UEFI Boot Manager needs to be conf= igured (see efibootmgr(8)).

Therefore, once you have set up OS specific setup, there is no use for defa= ult (<ESP>/efi/boot/=E2=80=A6) and you need to update one or another,= but not both.

FreeBSD have <E= SP>/efi/freebsd/... but it's not configured in efibootmgr:

The current default installer will do th= is, but older upgraded systems don't do this by default. Likely you are= looking at an older
system and/or one of the 'bad actors'= ; that reset this stuff between boots.
=C2=A0
efibootmgr -v:
---
BootOrder =C2=A0: 0004, 0000, 2002, 2003, 2001
<= div>Boot0004* Windows Boot Manager HD(1,GPT,8c497825-1db2-41f8-8924-85dfd0b= b7283,0x800,0x82000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0da0p1:/EFI/Microsoft/Boot/bootmgfw= .efi (null)
+Boot0000* EFI Hard Drive (SAMSUNG MZVLB1T0HBLR-000L2) PciRo= ot(0x0)/Pci(0x1d,0x0)/Pci(0x0,0x0)/NVMe(0x1,39-f9-b8-01-81-38-25-00)/HD(1,G= PT,73acd1b2-de41-11eb-8156-002b67dfc673,0x28,0x82000)
=C2=A0Boot2= 002* EFI DVD/CDROM
=C2=A0Boot2003* EFI Network
=C2=A0Boot2001* EFI US= B Device
---
so boot is definitely using <ESP>/ef= i/boot/bootx64.efi @Boot0000

In your case, that's true. The= "EFI Hard Drive" is a default entry the UEFI BIOS created for yo= u.
=C2=A0
=
I think I can create a new boot:
---
efibootmgr -a -c -l /boot/efi/efi/freebsd/loader.efi -L Free= BSD-14
(and make it active)
efibootmgr -a -b NNNN
=
---
and create other for loader.efi.old in case of problems.=

Yes.
=C2=A0
In thi= s case I will need only update <ESP>/efi/freebsd/loader.efi.

Q: for what has been said in mailing, boot is compiled= in /usr/src/stand, isn't a good idea that when it install new boot it = backup old boot like /boot/kernel -> /boot/kernel.old?

Yes. In fact that's what's done, but onl= y for the BIOS version. We should do the same for efi but don't seem to= do so currently. But that's likely tied up behind issues of installing= things automatically into the ESP on 'installworld'.
Warner=C2=A0


--
Nuno Teixeira
FreeBSD Co= mmitter (ports)


--
Nuno Teixeira
FreeBSD Co= mmitter (ports)


--
Nuno Teixeira
FreeBSD Co= mmitter (ports)


--
Nun= o Teixeira
FreeBSD Committer (ports)
--000000000000e5586605e69c7634--