From nobody Tue Aug 16 12:15:16 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 4M6VTk08rMz4YxQh for ; Tue, 16 Aug 2022 12:15:22 +0000 (UTC) (envelope-from tsoome@me.com) Received: from ci74p00im-qukt09082101.me.com (ci74p00im-qukt09082101.me.com [17.57.156.10]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4M6VTj2ndPz4FBW for ; Tue, 16 Aug 2022 12:15:21 +0000 (UTC) (envelope-from tsoome@me.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1660652120; bh=rxVghl1y5JylAB7bJdVgfP7YT4inshOfUEAfwV9DFaw=; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date:To; b=1K4oJaq7TL8A4Tgwk3dFxe9HtvL/PHzu3Q7nRFV3wNDjbqRpJUsuOUiLyHSKJbAo9 CfLTLeGb2s2Ha/QCRLk6GW0GIcmidmDbQ7LoLoCoCujcdUGIoFHSClUYyN8YkTpXcd dO71SocNirUs6AECiGN+Tlagz+X+5A6EeshByrqn/1S2DdZiV5ubMTd70tjusVnLRF C+AjDq1gfbLd6xp6YCnHg0fUDJoJ/dQ2ylV5cFk6Oy9sj2v+BQ1cLcJZ3iQHEKkGM0 nbqoKnsuUOO0YXBHfGKrEd9JvJx51Pj33BkCLzVhd+07Kkzlf698KYf5qbtKZ3z8jm XSNG8N5w5hYGA== Received: from smtpclient.apple (ci77p00im-dlb-asmtp-mailmevip.me.com [17.57.156.26]) by ci74p00im-qukt09082101.me.com (Postfix) with ESMTPSA id 378225600480; Tue, 16 Aug 2022 12:15:18 +0000 (UTC) From: Toomas Soome Message-Id: <6C8EFCAC-52EF-4037-A6A6-BB9DF76AD905@me.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_BBF3FCEA-2E07-4D64-BF71-626A44949F83" 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 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: 24.3. Updating Bootcode Date: Tue, 16 Aug 2022 15:15:16 +0300 In-Reply-To: Cc: FreeBSD CURRENT To: Nuno Teixeira References: <62B26DE1-0E26-40BA-8647-E591E9ACEB7A@me.com> X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Proofpoint-GUID: TESewU1tIQchtx7-hRkl4VuZCNsnAdzb X-Proofpoint-ORIG-GUID: TESewU1tIQchtx7-hRkl4VuZCNsnAdzb X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= =?UTF-8?Q?2903e8d5c8f:6.0.138,18.0.572,17.0.605.474.0000000_definitions?= =?UTF-8?Q?=3D2020-02-14=5F11:2020-02-14=5F02,2020-02-14=5F11,2020-01-23?= =?UTF-8?Q?=5F02_signatures=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=958 malwarescore=0 suspectscore=0 spamscore=0 mlxscore=0 bulkscore=0 phishscore=0 clxscore=1015 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2208160046 X-Rspamd-Queue-Id: 4M6VTj2ndPz4FBW X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=me.com header.s=1a1hai header.b=1K4oJaq7; dmarc=pass (policy=quarantine) header.from=me.com; spf=pass (mx1.freebsd.org: domain of tsoome@me.com designates 17.57.156.10 as permitted sender) smtp.mailfrom=tsoome@me.com X-Spamd-Result: default: False [-3.60 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; DMARC_POLICY_ALLOW(-0.50)[me.com,quarantine]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:17.57.156.0/24]; R_DKIM_ALLOW(-0.20)[me.com:s=1a1hai]; RCVD_IN_DNSWL_LOW(-0.10)[17.57.156.10:from]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; FREEFALL_USER(0.00)[tsoome]; FROM_HAS_DN(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[17.57.156.10:from]; ARC_NA(0.00)[]; ASN(0.00)[asn:714, ipnet:17.57.156.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DKIM_TRACE(0.00)[me.com:+]; TO_DN_ALL(0.00)[]; FREEMAIL_FROM(0.00)[me.com]; DWL_DNSWL_NONE(0.00)[me.com:dkim]; RCPT_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[me.com]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_BBF3FCEA-2E07-4D64-BF71-626A44949F83 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 16. Aug 2022, at 15:01, Nuno Teixeira wrote: >=20 > Hi Toomas, >=20 > For better OS support, the UEFI specification (UEFI 2.8A Feb 14, page = 499) is suggesting to use structure like: >=20 > /efi//=E2=80=A6 >=20 > And to use this suggestion, it means the UEFI Boot Manager needs to be = configured (see efibootmgr(8)). >=20 > 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. >=20 > FreeBSD have /efi/freebsd/... but it's not configured in = efibootmgr: >=20 > efibootmgr -v: > --- > BootOrder : 0004, 0000, 2002, 2003, 2001 > Boot0004* Windows Boot Manager = HD(1,GPT,8c497825-1db2-41f8-8924-85dfd0bb7283,0x800,0x82000)/File(\EFI\Mic= rosoft\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 <> Yes, Boot0000 does not specify file name, so it is using default path = there. >=20 > 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. >=20 > In this case I will need only update /efi/freebsd/loader.efi. >=20 > 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? >=20 Boot loader update does not touch kernel, but when you do installkernel, = that one will create backup copy for you. And, if you are using zfs = root, you really should use boot environments. rgds, toomas --Apple-Mail=_BBF3FCEA-2E07-4D64-BF71-626A44949F83 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On 16. Aug 2022, at 15:01, 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:

efibootmgr -v:
---
BootOrder  : 0004, 0000, 2002, 2003, 2001
Boot0004* Windows Boot Manager = HD(1,GPT,8c497825-1db2-41f8-8924-85dfd0bb7283,0x800,0x82000)/File(\EFI\Mic= rosoft\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

Yes, Boot0000 does not specify file name, so it is = using default path there.

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.

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 backup old boot like /boot/kernel -> = /boot/kernel.old?


Boot = loader update does not touch kernel, but when you do installkernel, that = one will create backup copy for you. And, if you are using zfs root, you = really should use boot environments.

rgds,
toomas

= --Apple-Mail=_BBF3FCEA-2E07-4D64-BF71-626A44949F83--