Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Nov 2024 13:50:16 -0700
From:      John Nielsen <lists@jnielsen.net>
To:        Peter Blok <pblok@bsd4all.org>
Cc:        freebsd-net@freebsd.org
Subject:   Re: EFI boot with iPXE
Message-ID:  <BB3917BD-6D54-4C69-B89E-9520FCF56A0F@jnielsen.net>
In-Reply-To: <0F7B3EDE-D3B4-4693-B84F-A68AD6089A76@bsd4all.org>
References:  <0F7B3EDE-D3B4-4693-B84F-A68AD6089A76@bsd4all.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail-FD65037E-1E61-4595-B6D0-C38506741881
Content-Type: text/plain;
	charset=utf-8
Content-Transfer-Encoding: quoted-printable



> On Nov 7, 2024, at 1:23=E2=80=AFPM, Peter Blok <pblok@bsd4all.org> wrote:
>=20
> I have tried to boot over iSCSI using PXE using the ports isboot-kmod. It w=
orked after many tries, but it is not automatic yet.
>=20
> At the loader.efi prompt I do:
> set currdev=3Dzfs:zroot/ROOT/default:
> load /boot/kernel/kernel
> load /boot/kernel/opensolaris.ko
> load /boot/kernel/zfs.ko
> load /boot/kernel/acpi_wmi.ko
> load /boot/kernel/smbus.ko
> load /boot/kernel/ichsmb.ko
> load /boot/kernel/uhid.ko
> load /boot/kernel/wmt.ko
> load /boot/kernel/iscsi.ko
> load /boot/modules/isboot.ko
> boot
>=20
> And it starts. There is no local storage so everything is really coming ov=
er the net.
>=20
> Obviously it doesn=E2=80=99t read what is in loader.conf and I=E2=80=99m p=
uzzled what the boot flow is once you have loader.efi loaded. I can put curr=
dev in loader.env but it doesn=E2=80=99t set it although set qqq=3Dsomething=
 shows up when I type show, so I have the right file.
>=20
> How can I boot without having to type the commands?

Typically all you need to do is add the following to /boot/loader.conf after=
 installing the isboot port:

isboot_load=3D"YES=E2=80=9D

=46rom there it=E2=80=99s up to the boot firmware (iPXE in your case) to mak=
e the initial connection to the target, populate the iBFT, load the boot blo=
cks and perform the early boot. The loader uses the iSCSI disk just like a l=
ocal disk to do its job including load the kernel and modules (including isb=
oot) in to memory.

When the kernel begins execution it probes devices and eventually gets to is=
boot. If isboot locates a valid iBFT it will parse it and use that informati=
on to re-establish the connection with the iSCSI target (as well as bring up=
 the needed network interface etc).

=46rom there the iSCSI volume(s) should be available as regular da(4) device=
s and boot continues like it would on any other type of storage.

The root volume being ZFS adds some moving parts but there=E2=80=99s no reas=
on it wouldn=E2=80=99t work. If you can, try to replicate your setup using l=
ocal storage. Once that is working then you just need to add iPXE and the si=
ngle line above to loader.conf.

JN




--Apple-Mail-FD65037E-1E61-4595-B6D0-C38506741881
Content-Type: text/html;
	charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; charset=3D=
utf-8"></head><body dir=3D"auto"><div dir=3D"ltr"></div><div dir=3D"ltr"><br=
></div><div dir=3D"ltr"><br><div dir=3D"ltr"></div><blockquote type=3D"cite"=
>On Nov 7, 2024, at 1:23=E2=80=AFPM, Peter Blok &lt;pblok@bsd4all.org&gt; wr=
ote:<br><br></blockquote></div><blockquote type=3D"cite"><div dir=3D"ltr"><s=
pan>I have tried to boot over iSCSI using PXE using the ports isboot-kmod. I=
t worked after many tries, but it is not automatic yet.</span><br><span></sp=
an><br><span>At the loader.efi prompt I do:</span><br><span>set currdev=3Dzf=
s:zroot/ROOT/default:</span><br><span>load /boot/kernel/kernel</span><br><sp=
an>load /boot/kernel/opensolaris.ko</span><br><span>load /boot/kernel/zfs.ko=
</span><br><span>load /boot/kernel/acpi_wmi.ko</span><br><span>load /boot/ke=
rnel/smbus.ko</span><br><span>load /boot/kernel/ichsmb.ko</span><br><span>lo=
ad /boot/kernel/uhid.ko</span><br><span>load /boot/kernel/wmt.ko</span><br><=
span>load /boot/kernel/iscsi.ko</span><br><span>load /boot/modules/isboot.ko=
</span><br><span>boot</span><br><span></span><br><span>And it starts. There i=
s no local storage so everything is really coming over the net.</span><br><s=
pan></span><br><span>Obviously it doesn=E2=80=99t read what is in loader.con=
f and I=E2=80=99m puzzled what the boot flow is once you have loader.efi loa=
ded. I can put currdev in loader.env but it doesn=E2=80=99t set it although s=
et qqq=3Dsomething shows up when I type show, so I have the right file.</spa=
n><br><span></span><br><span>How can I boot without having to type the comma=
nds?</span><br></div></blockquote><div><br></div>Typically all you need to d=
o is add the following to /boot/loader.conf after installing the isboot port=
:<div><span style=3D"caret-color: rgb(5, 5, 5); color: rgb(5, 5, 5); font-fa=
mily: var(--code-font); font-size: 12.75px;"><br></span></div><div><span sty=
le=3D"caret-color: rgb(5, 5, 5); color: rgb(5, 5, 5); font-family: var(--cod=
e-font); font-size: 12.75px;">isboot_load=3D"YES=E2=80=9D</span></div><div><=
span style=3D"caret-color: rgb(5, 5, 5); color: rgb(5, 5, 5); font-family: v=
ar(--code-font); font-size: 12.75px;"><br></span></div><div>=46rom there it=E2=
=80=99s up to the boot firmware (iPXE in your case) to make the initial conn=
ection to the target, populate the iBFT, load the boot blocks and perform th=
e early boot. The loader uses the iSCSI disk just like a local disk to do it=
s job including load the kernel and modules (including isboot) in to memory.=
</div><div><br></div><div>When the kernel begins execution it probes devices=
 and eventually gets to isboot. If isboot locates a valid iBFT it will parse=
 it and use that information to re-establish the connection with the iSCSI t=
arget (as well as bring up the needed network interface etc).</div><div><br>=
</div><div>=46rom there the iSCSI volume(s) should be available as regular d=
a(4) devices and boot continues like it would on any other type of storage.<=
/div><div><br></div><div>The root volume being ZFS adds some moving parts bu=
t there=E2=80=99s no reason it wouldn=E2=80=99t work. If you can, try to rep=
licate your setup using local storage. Once that is working then you just ne=
ed to add iPXE and the single line above to loader.conf.</div><div><br></div=
><div>JN</div><div><br></div><div><br></div><div><br></div></body></html>=

--Apple-Mail-FD65037E-1E61-4595-B6D0-C38506741881--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BB3917BD-6D54-4C69-B89E-9520FCF56A0F>