From nobody Fri Dec 22 09:09:12 2023
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 4SxM1g0HYtz5506Q
	for <freebsd-current@mlmmj.nyi.freebsd.org>; Fri, 22 Dec 2023 09:09:27 +0000 (UTC)
	(envelope-from marklmi@yahoo.com)
Received: from sonic310-20.consmr.mail.gq1.yahoo.com (sonic310-20.consmr.mail.gq1.yahoo.com [98.137.69.146])
	(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 did not present a certificate)
	by mx1.freebsd.org (Postfix) with ESMTPS id 4SxM1d6bPzz4JBr
	for <freebsd-current@freebsd.org>; Fri, 22 Dec 2023 09:09:25 +0000 (UTC)
	(envelope-from marklmi@yahoo.com)
Authentication-Results: mx1.freebsd.org;
	dkim=pass header.d=yahoo.com header.s=s2048 header.b=FHyTC0J8;
	spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.69.146 as permitted sender) smtp.mailfrom=marklmi@yahoo.com;
	dmarc=pass (policy=reject) header.from=yahoo.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1703236163; bh=QtfF28HO3ICdiD+ZPauuUUL19PcF6ecB1HSiaHUokGA=; h=From:Subject:Date:To:References:From:Subject:Reply-To; b=FHyTC0J89a/nzYzoseVxyocxVhdcnpuWxUmS9zHxKGwZlB8gJiemD7phx9x2HOBF6OkklDMcjTgY6vAP9lo5iEGCYbdWn/Q54FldViwTybUBPEzDnlzjj7jw9yLaeRbK8kT392wOg7vyL75DRr+/h/HkSh/6j0v6kTOcv4IrsLYUfULobevu00uf22lxI+7dBQAZJkQ+dJCyVCoXJRQnR6kEEOYE7v3q26Usgipp65QjzuArBMsFqS7Mu1UXghnSAKDQec2eGlXfErMYVA6ss7yk/PvyL4tR8AB/M0QD9lGukQFUEGsrn2yx9c8TohrRBu409d0ZSb9ZuYu30zK9zQ==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1703236163; bh=QOLVFyVJcTZb7zzDuiMouPdSROOOI1t9jLqekZw6eqZ=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=hroX3F4J/D+v1WLOlQCoN1s67MxLxs9SL0bVNKJJ+eAL5gxmTGbksp592NxtLcAr1sxw1bx7VQmQ+TyuKb7DTCG5O9Txno1Ksj1rNMY9iy7i7Crq9PdP7wwmsq6UnQYv6ib3m4+wfQA780cGScHOTk2vKYCZISu78Z7ypZQJsV+KslFPcOwwutY8CtcfYnfML+6zqoEehgCn8HYr7vdjwjiRXW+mcQIyTntsU02aj1zyaIdCO5EjihemjAiF2EAtSknKHiKb+QMFe2axAuNVYA2Sr7x/SaA/k6UmpEwHFRL6mFw7PuyIjr15eZ3MhLGa24/EY++n2vh0giawMsRpdw==
X-YMail-OSG: d6YLH7kVM1l9CZ.ajADVwh2zmE4NR23hWfJdU3oCw5XGvP1CBCat0WEcjFfvkZE
 VAh3DwCUAwv2m3DdP9YH9Op2zrvVRSbNlAjeYDihJyFxltbLyT5qz20E8pX1HXRhmso623Z_bKy4
 sJZJcmPU8uTlMpCUPRNbe8s3Yj0EEyMo8YX8WxZ8iM5imHseDuqcdAtZF.MKXNcATgs40Q3OghTM
 F89zxJavKe07rwshLfclOkYNtm5b5_ToIiJwPHhXvJcmIfKiityNcsrvbBIOfgSRMx78hOwGBbOU
 jZgcEosLY6OEIbhbS1PnFRPOcbQAZubUuUVwgb6zAnE1ElbgQAHRy9krByzGC86CVM5gaBZLztJR
 FpF30404vFyDVW5m8sgDDXO2Zsh1KAOJO9.R91wDCjL1gkZ21ZjtWsHrbarvNdZJ64HgYTM5oG1P
 ZTawI0WYSPiatj4D_vMVTDTZ.eTFlVvp4OwovwKJ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y6kFXZj6bUXCofXH6y.uUDhO6K._K7sh1swst7Pn8z0R3J72ttHMUvvR7p
 NiiqJx74Ky4BYOwB2VtrjKW_A7qEhaaZfpVBI1SfaKNtia3Yc_FMFuVjpz9mVFq3io_W0LC76BYs
 3.Uby_PLFTU1aBiYka.FuPehRZ6LJsCjSrdEngw.VP7VWrToM8Xawn3ATd.17WMvprrkKfcKSQ4b
 dIYQ1suUkaBj9.hTeoFcJi6bfiI2ro_99UrkSLBGk5Zs09nNh8cXkg9NLCPu0i7WPV8pB1ZC3sSk
 3RuNvvu_Wpfu3sQGKBBR2fXOBu0iAy2P5BwL5AbxzdmYl.63sLBXj504FXKQmzQ1rI3jinZW3SKw
 aZ9QJMFJTmo6A_AoCbkKSSvWDM_K3995OnPp4XDfG_FazVT8fNo.OvjOyazYdgcmAyAoNzwEi0p7
 HrC1HJufVGDp0cEWaIYrx7vOWzuw1FNgQojSIy0yembLffa1qjZVAKFWpSbF3eosFbhpwxq2VeEs
 2Zrwn52Cb0j4Fixi0LzPdSjZVGoiIe03gNbrtpp8msbxQIDlNZ4ZOoJ6p9phqhPTOrGxf9PMM5a.
 FFSo2X02uw6hQUYZXyzkVr.lMX.R.0nF88shrv3tgMOWN9YBrBg4rIqiiY8nZoTBQomqAtaXCvNU
 QwghX8aJPR4HsvJSQ9qu9nJTxAqOZTu6xCyk1fwIgpD.Otr0Og6WaToilByC7QWRI_YQun1z6df2
 iFJ97RtLZr8GkAu68rX0KruaGin1kia_wTa.WoLKJRaMPyTOh44Qntzvd8Lo9wbaqg0Sd0iVRbnY
 2HA--
X-Sonic-MF: <marklmi@yahoo.com>
X-Sonic-ID: f3933671-ff4e-46b2-8d4c-4e46bc68f08a
Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.gq1.yahoo.com with HTTP; Fri, 22 Dec 2023 09:09:23 +0000
Received: by hermes--production-gq1-6949d6d8f9-ghhkt (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 78026209010c5c58cd08f76aef538544;
          Fri, 22 Dec 2023 09:09:23 +0000 (UTC)
From: Mark Millard <marklmi@yahoo.com>
Content-Type: text/plain;
	charset=us-ascii
Content-Transfer-Encoding: quoted-printable
List-Id: Discussions about the use of FreeBSD-current <freebsd-current.freebsd.org>
List-Archive: https://lists.freebsd.org/archives/freebsd-current
List-Help: <mailto:freebsd-current+help@freebsd.org>
List-Post: <mailto:freebsd-current@freebsd.org>
List-Subscribe: <mailto:freebsd-current+subscribe@freebsd.org>
List-Unsubscribe: <mailto:freebsd-current+unsubscribe@freebsd.org>
Sender: owner-freebsd-current@freebsd.org
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\))
Subject: Re: symlink to /boot/loader.efi
Message-Id: <AF65AD57-5D93-4FC2-84E8-58E1D7C0C3BC@yahoo.com>
Date: Fri, 22 Dec 2023 01:09:12 -0800
To: Tomoaki AOKI <junchoon@dec.sakura.ne.jp>,
 Current FreeBSD <freebsd-current@freebsd.org>
X-Mailer: Apple Mail (2.3774.300.61.1.2)
References: <AF65AD57-5D93-4FC2-84E8-58E1D7C0C3BC.ref@yahoo.com>
X-Spamd-Result: default: False [-3.49 / 15.00];
	NEURAL_HAM_MEDIUM(-1.00)[-1.000];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	NEURAL_HAM_SHORT(-0.99)[-0.987];
	DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject];
	MV_CASE(0.50)[];
	R_SPF_ALLOW(-0.20)[+ptr:yahoo.com];
	R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048];
	MIME_GOOD(-0.10)[text/plain];
	FROM_HAS_DN(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	TO_MATCH_ENVRCPT_SOME(0.00)[];
	ARC_NA(0.00)[];
	MLMMJ_DEST(0.00)[freebsd-current@freebsd.org];
	RCVD_IN_DNSWL_NONE(0.00)[98.137.69.146:from];
	DWL_DNSWL_NONE(0.00)[yahoo.com:dkim];
	RCVD_TLS_LAST(0.00)[];
	RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.69.146:from];
	DKIM_TRACE(0.00)[yahoo.com:+];
	TO_DN_ALL(0.00)[];
	FREEMAIL_FROM(0.00)[yahoo.com];
	MID_RHS_MATCH_FROM(0.00)[];
	RCPT_COUNT_TWO(0.00)[2];
	MIME_TRACE(0.00)[0:+];
	FROM_EQ_ENVFROM(0.00)[];
	ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US];
	FREEMAIL_ENVFROM(0.00)[yahoo.com];
	RCVD_COUNT_TWO(0.00)[2]
X-Rspamd-Queue-Id: 4SxM1d6bPzz4JBr
X-Spamd-Bar: ---

Tomoaki AOKI <junchoon_at_dec.sakura.ne.jp> wrote on
Date: Thu, 21 Dec 2023 23:21:00 UTC :

> On Thu, 21 Dec 2023 14:22:14 +0100
> Dimitry Andric <dim@FreeBSD.org> wrote:
>=20
> > Yeah, my procedure is the same as yours: I first copy =
/boot/efi/efi/freebsd/loader.efi to /boot/efi/efi/freebsd/loader.old, =
then copy the freshly built and installed /boot/loader.efi to =
/boot/efi/efi/freebsd/loader.efi. I don't see a technical reason why =
this could not be just another step in the installworld procedure.
> >=20
> > That said, I am unsure if the pathname /boot/efi/efi is always the =
same, at least for all UEFI systems. It is the default layout when you =
do a regular install with recent installer onto a UEFI system, but some =
users may use completely different mount points. So you should still =
have some way of configuring the default location for loader =
installation.
> >=20
> > Also, on default installations a fallback entry named =
/boot/efi/efi/boot/bootx64.efi is made, essentially another copy of =
loader.efi but with a different name. Namely, the default name that UEFI =
(on x86_64 at least) searches for, if it doesn't know anything else. =
I.e. if it isn't configured via efibootmgr(8), or the EFI variables have =
been junked for some reason. It might make sense to also update that =
file.
> >=20
> > -Dimitry
>=20
> Just an idea.
>=20
> It would be nice if loader.efi (hopefully, boot1.efi,too) could pass
> "where am I placed?" info, maybe via kenv.
>=20
> Would need boot1.efi to pass something (ideally, "where am I booted
> from?", but "boot1_used=3D1" is sufficient).
>=20
> To do so, loader.efi can confirm whether it was loaded via boot1.efi =
or
> directly from UEFI firmware. If nothing is passed to it, it can probe
> "where it is?" using UEFI call and set it, otherwise, it should
> be /boot/loader.efi, so nothing is needed to do.

To my knowledge aarch64 and armv7 never use the copy in
/boot/loader.efi during a boot. It has to have been copied
into the appropriate msdosfs such that it has an
appropriate path and name there. That is what is found
and used during the boot.

> If no related kenv is set and freebsd-boot partition exists, it should
> be booted with legacy (BIOS) boot.

If there even is a "legacy (BIOS) boot" is a platform
specific issue as far as I know.

> The easiest to be set by loader.efi and/or boot1.efi would be raw UEFI
> device path. So would need analyzing where actually is on booted
> FreeBBSD environment.

See the earlier point about aarch64 and armv7 not using
/boot/* files while loading the FreeBSD loader: the
FreeBSD loader variant used is the first stage able to
look inside UFS or ZFS file systems. Loading and
starting the FreeBSD loader happens before that stage
in those types of contexts.

> . . .

Also, to my knowledge, powerpc (32-bit), powerpc64, and
powerpc64le do not involve any variant of loader.efi or
UEFI/ACPI or UEFI/DeviceTriee in their boot sequnces.
Again: more platform specific rather than generic.

=3D=3D=3D
Mark Millard
marklmi at yahoo.com