Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jun 2015 22:18:11 -0700
From:      NGie Cooper <yaneurabeya@gmail.com>
To:        Don whY <Don.whY@gmx.com>
Cc:        FreeBSD-Hackers Mailing List <freebsd-hackers@freebsd.org>
Subject:   Re: PXE boot an XIP image?
Message-ID:  <CAGHfRMA_gVL4e3HWxbd_cSch0W_TwTT-61xHY4DjXRMX-bRBVg@mail.gmail.com>
In-Reply-To: <557C073E.1060702@gmx.com>
References:  <557C073E.1060702@gmx.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jun 13, 2015 at 3:34 AM, Don whY <Don.whY@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).



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGHfRMA_gVL4e3HWxbd_cSch0W_TwTT-61xHY4DjXRMX-bRBVg>