NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Building PXE/XIP environment

Bonjour Jean-Yves,

On 4/21/2011 3:38 AM, Jean-Yves Migeon wrote:
On 21.04.2011 09:05, Scrap Happy wrote:
I need to be able to boot a "standalone" environment
for some applications (i.e., one the image is loaded,
there are no remaining dependencies on the "server"...
no nfs mounts, etc.).

Since this is probably an interactive/iterative process
(i.e., port some part of the system, determine any
dependencies that must be removed, remove them, lather,
rinse, repeat), I wonder if there is a straightforward
way to create a kernel+filesystem image and then "package"
this once it works properly.

Any pointers to guides that might facilitate this?

Once you have your system ready to be packaged:
- use makefs(8) to create the filesystem image:
     makefs<image file>  <image root directory>

So, if I've built a filesystem "/foo" and verified
everything works as expected after 'chroot /foo',
this (makefs foo.image /foo) will bundle it up for
me?  (presumably, that filesystem should be *quiescent*
when I do this?)

- note down the resulting file system image file, then compile a kernel

options MEMORY_DISK_IS_ROOT     # root on memory disk
options MEMORY_DISK_ROOT_SIZE=40000   # size of fs image in blocks

Is this *literally* the number of blocks in the "foo.image" file?
(i.e., any "overhead" in that file is refected in this count)

I assume you don't want this number too exceed the image's size
as that just wastes memory that could be used for run-time?

OTOH, if the memory disk image will be treated as r/w at run time,
can padding this number give you "extra space" in the resulting file

- mdsetimage(8) to embed the image in the resulting kernel:

     mdsetimage<kernel>  <image file>

Boot with the resulting<kernel>. If your host system is not NetBSD,
build these tools via

Can I just pass this entire image to the device via PXE?  Or, am
I better off getting the kernel to the device and *then* having
the kernel drag over the image?


Home | Main Index | Thread Index | Old Index