Date: Fri, 19 Aug 2022 19:42:36 +0100 From: Nuno Teixeira <eduardo@freebsd.org> To: Warner Losh <imp@bsdimp.com> Cc: Toomas Soome <tsoome@me.com>, FreeBSD CURRENT <freebsd-current@freebsd.org> Subject: Re: 24.3. Updating Bootcode Message-ID: <CAFDf7ULaUB8TWbbgAc8%2BLPJZjsUH4Du9bTSRBe0BxhaHVmMqTA@mail.gmail.com> In-Reply-To: <CAFDf7UJWgZFLyWok8POWiNCCfDtrwJnA_WqZiaMN=qem4W4Xgw@mail.gmail.com> References: <CAFDf7UJv9QCuD27XDs2ihLiN21Rn6PeZjbJtWVOAAfHb8HHnHw@mail.gmail.com> <62B26DE1-0E26-40BA-8647-E591E9ACEB7A@me.com> <CAFDf7UJrnL0RrPyto07-THmhPSBF%2BpbgqMmj%2BMmjUZpDotvjXQ@mail.gmail.com> <CANCZdfrUGxxXUrXPZ%2B9jHufQQaJdRQa2nVWviKOJzX%2B2mzJAvg@mail.gmail.com> <CAFDf7U%2Bb1FF2u_DJtXZmA4bdGgjS02ZFnovS7uwB6aP6T12ReA@mail.gmail.com> <CAFDf7UJ4y1Vsq5TSm8FxozndoF5sRy4Yzth5BfAELx0vmE43HA@mail.gmail.com> <CAFDf7UJWgZFLyWok8POWiNCCfDtrwJnA_WqZiaMN=qem4W4Xgw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000e5586605e69c7634 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable @ main-n257521-97be6fced7db Clean boot without warnings. OK. Thanks, Nuno Teixeira <eduardo@freebsd.org> escreveu no dia quinta, 18/08/2022 =C3= =A0(s) 12:04: > Forgot to send a screenshot > <https://people.freebsd.org/~eduardo/logs/boot%4020220817.JPG> 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 <eduardo@freebsd.org> escreveu no dia quarta, 17/08/2022 > =C3=A0(s) 19:18: > >> *** and "EFI Hard Drive"(legacy <ESP>/efi/boot/bootx64.efi) from BIOS. >> ^^^^ >> >> Nuno Teixeira <eduardo@freebsd.org> 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"(<ESP>/efi/freebsd/loader.efi), >>> "FreeBSD-14_old"(<ESP>/efi/freebsd/loader-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 >>> ^^^ >>> --- >>> 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 configured (see efibootmgr(8)). >>>>>> >>>>>> Therefore, once you have set up OS specific setup, there is no use >>>>>> for default (<ESP>/efi/boot/=E2=80=A6) and you need to update one or= another, but >>>>>> not both. >>>>>> >>>>> >>>>> FreeBSD have <ESP>/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 <ESP>/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 <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 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 <div dir=3D"ltr"><div>@ main-n257521-97be6fced7db</div><div><br></div><div>= Clean boot without warnings.<br></div><div>OK.</div><div><br></div><div>Tha= nks,<br></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class= =3D"gmail_attr">Nuno Teixeira <<a href=3D"mailto:eduardo@freebsd.org">ed= uardo@freebsd.org</a>> escreveu no dia quinta, 18/08/2022 =C3=A0(s) 12:0= 4:<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"><div dir=3D"l= tr"><div>Forgot to send a <a href=3D"https://people.freebsd.org/~eduardo/lo= gs/boot%4020220817.JPG" target=3D"_blank">screenshot</a> for loader.efi @ m= ain-n257458-ef8b872301c5</div><div>( +Boot0007* FreeBSD-14 HD(1,GPT,73acd1b= 2-de41-11eb-8156-002b67dfc673,0x28,0x82000)/File(\efi\freebsd\loader.efi)<b= r>=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 )</div><div><br></div><div>Someone talked about this warnings earlie= r:</div><div>---</div><div>Attempted extraction of recovery data from stada= rd superblock: failed</div><div>Attempt to find boot zone recovery data: fa= iled</div><div>(...)</div><div>---</div><div>But it boots ok.<br><br></div>= <div>Cheers,<br></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr"= class=3D"gmail_attr">Nuno Teixeira <<a href=3D"mailto:eduardo@freebsd.o= rg" target=3D"_blank">eduardo@freebsd.org</a>> escreveu no dia quarta, 1= 7/08/2022 =C3=A0(s) 19:18:<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"><div dir=3D"ltr"><div>*** and "EFI Hard Drive"(legacy = <ESP>/efi/boot/bootx64.efi) from BIOS.</div><div>=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 ^^^^<br></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" cla= ss=3D"gmail_attr">Nuno Teixeira <<a href=3D"mailto:eduardo@freebsd.org" = target=3D"_blank">eduardo@freebsd.org</a>> escreveu no dia quarta, 17/08= /2022 =C3=A0(s) 19:14:<br></div><blockquote class=3D"gmail_quote" style=3D"= margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-lef= t:1ex"><div dir=3D"ltr"><div>Hi,</div><div><br></div><div>And it's done= :</div><div>---</div><div>=C2=A0Boot0007* FreeBSD-14 HD(1,GPT,73acd1b2-de41= -11eb-8156-002b67dfc673,0x28,0x82000)/File(\efi\freebsd\loader.efi)<br>=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<br>+Boot0006* FreeBSD-14_old HD(1,GPT,73acd1b2-de41-11eb-8156-002b67dfc6= 73,0x28,0x82000)/File(\efi\freebsd\loader-old.efi)<br>=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<br>=C2=A0Boot0004* Windows Boot Manager HD(1,GPT,8c497825-1db2-41f8= -8924-85dfd0bb7283,0x800,0x82000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)<br= >=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)<br>=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)</div>= <div>---</div><div>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.</div><div><br></div><div>NOTE: efibootmgr(8) example is:</d= iv><div>---</div><div>efibootmgr -a -c -l /boot/efi/EFI/freebsd/loader.efi = -L FreeBSD-11</div><div>=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 ^^^<br></div><div>---</div><d= iv>But I choosed "efi" instead of "EFI"...<br></div><di= v><br></div><div>Thanks all for helping me understand it!</div><div><br></d= iv><div>Cheers,<br></div><div><br></div></div><br><div class=3D"gmail_quote= "><div dir=3D"ltr" class=3D"gmail_attr">Warner Losh <<a href=3D"mailto:i= mp@bsdimp.com" target=3D"_blank">imp@bsdimp.com</a>> escreveu no dia ter= =C3=A7a, 16/08/2022 =C3=A0(s) 18:19:<br></div><blockquote class=3D"gmail_qu= ote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,20= 4);padding-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div c= lass=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Tue, Aug 16, = 2022 at 6:01 AM Nuno Teixeira <<a href=3D"mailto:eduardo@freebsd.org" ta= rget=3D"_blank">eduardo@freebsd.org</a>> wrote:<br></div><blockquote cla= ss=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid = rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_quo= te"><div>Hi Toomas,</div><div><br></div><blockquote class=3D"gmail_quote" s= tyle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pad= ding-left:1ex"> For better OS support, the UEFI specification (UEFI 2.8A Feb 14, page 499) = is suggesting to use structure like:<br> <br> <ESP>/efi/<OS>/=E2=80=A6<br> <br> And to use this suggestion, it means the UEFI Boot Manager needs to be conf= igured (see efibootmgr(8)).<br> <br> 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.<br></blockquote></div><div><br></div><div>FreeBSD have <E= SP>/efi/freebsd/... but it's not configured in efibootmgr:</div></di= v></blockquote><div><br></div><div>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</div><div>system and/or one of the 'bad actors'= ; that reset this stuff between boots.</div><div>=C2=A0</div><blockquote cl= ass=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid= rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div>efibootmgr -v:</d= iv><div>---</div><div>BootOrder =C2=A0: 0004, 0000, 2002, 2003, 2001</div><= div>Boot0004* Windows Boot Manager HD(1,GPT,8c497825-1db2-41f8-8924-85dfd0b= b7283,0x800,0x82000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)<br>=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)<br>+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)</div><div>=C2=A0Boot2= 002* EFI DVD/CDROM<br>=C2=A0Boot2003* EFI Network<br>=C2=A0Boot2001* EFI US= B Device</div><div>---</div><div>so boot is definitely using <ESP>/ef= i/boot/bootx64.efi <a class=3D"gmail_plusreply" id=3D"gmail-m_5935565224862= 066734gmail-m_6411503456252177521gmail-m_-4717319298197336615gmail-m_-38622= 96962526431016gmail-m_2408750265426939096plusReplyChip-0">@Boot0000</a></di= v></div></blockquote><div><br></div><div>In your case, that's true. The= "EFI Hard Drive" is a default entry the UEFI BIOS created for yo= u.</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">= <div dir=3D"ltr"><div></div><div>I think I can create a new boot:</div><div= >---</div><div>efibootmgr -a -c -l /boot/efi/efi/freebsd/loader.efi -L Free= BSD-14</div><div>(and make it active)</div><div>efibootmgr -a -b NNNN</div>= <div>---</div><div>and create other for loader.efi.old in case of problems.= </div></div></blockquote><div><br></div><div>Yes.</div><div>=C2=A0</div><bl= ockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-lef= t:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div>In thi= s case I will need only update <ESP>/efi/freebsd/loader.efi.<br></div= ><div><br></div><div>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?</div></div></bloc= kquote><div><br></div><div>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'.</div><div><br= ></div><div>Warner=C2=A0</div></div></div> </blockquote></div><br clear=3D"all"><br>-- <br><div dir=3D"ltr"><div dir= =3D"ltr"><span style=3D"color:rgb(102,102,102)">Nuno Teixeira<br>FreeBSD Co= mmitter (ports)</span></div></div> </blockquote></div><br clear=3D"all"><br>-- <br><div dir=3D"ltr"><div dir= =3D"ltr"><span style=3D"color:rgb(102,102,102)">Nuno Teixeira<br>FreeBSD Co= mmitter (ports)</span></div></div> </blockquote></div><br clear=3D"all"><br>-- <br><div dir=3D"ltr"><div dir= =3D"ltr"><span style=3D"color:rgb(102,102,102)">Nuno Teixeira<br>FreeBSD Co= mmitter (ports)</span></div></div> </blockquote></div><br clear=3D"all"><br>-- <br><div dir=3D"ltr" class=3D"g= mail_signature"><div dir=3D"ltr"><span style=3D"color:rgb(102,102,102)">Nun= o Teixeira<br>FreeBSD Committer (ports)</span></div></div> --000000000000e5586605e69c7634--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFDf7ULaUB8TWbbgAc8%2BLPJZjsUH4Du9bTSRBe0BxhaHVmMqTA>