PXE boot an XIP image?

NGie Cooper yaneurabeya at gmail.com
Tue Jun 16 05:18:12 UTC 2015


On Sat, Jun 13, 2015 at 3:34 AM, Don whY <Don.whY at gmx.com> wrote:
> Hi,
>
> Apologies as to whether this belongs here... or on -embedded.  :<
>
> I'd like to PXE boot a kernel then fetch (any choice of protocol)
> a *single* image to load into RAM thereafter not requiring any
> access to external media to operate.  I.e., as if the image
> had resided in the device all along.
>
> A crude approach *might* be something like crunchgen'ing init
> with all of the (static linked) binaries that are required
> and letting the loaded kernel NFS read (load) that init(1).
> Obviously, I'd trim the kernel and other binaries down to the
> bare essentials to minimize RAM requirements (as there would be no
> swap, etc.)
>
> [I.e., creating a tiny filesystem that simply links every executable
> back to this *one* image]
>
> In practice, this won't (?) really work as hoped.  Any pointers on
> a proven technique to achieve these results?
>
> Thanks!

This may or may not be helpful:
http://blog.hostileadmin.com/2012/05/04/pxe-booting-into-a-freebsd-installation/
(note: it's using grub). If you do are using loader(8) though, `load
-t mfs_root /path/to/mfsroot.gz`, will load the mfsroot into RAM.

You could employ tricks used by NanoBSD-based platforms, etc to say
"boot diskless" as well (look for rc.initdiskless). You don't need to
boot over NFS.

That and you could use what kib described later on, but that requires
additional scripting.

There's mdconfig as well, but some folks I know didn't care for it
because it "wasn't really well documented".

Cheers!
-NGie

PS Thank you for the reminder about documenting -t mfs_root in loader(8).


More information about the freebsd-hackers mailing list