Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Apr 2002 12:41:29 +0100
From:      Brian Candler <B.Candler@pobox.com>
To:        freebsd-fs@freebsd.org, freebsd-net@freebsd.org
Subject:   Re: NFS clearing attribute cache in nfs_open
Message-ID:  <20020429124129.A3409@linnet.org>
In-Reply-To: <20020426181535.B2748@linnet.org>; from B.Candler@pobox.com on Fri, Apr 26, 2002 at 06:15:35PM %2B0100
References:  <20020426181535.B2748@linnet.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Thanks for comments so far.

It looks like the best solution for me is going to be to boot diskless into
a ramdisk. It's been quite a job finding out how to do that; there doesn't
seem to be much in the way of documentation.

Reverse-engineering the source suggests that the following methods exist:

(1) Including an MD image within the kernel itself

options MD_ROOT
options MD_ROOT_SIZE n     # kilobytes

then use usr/src/release/write_mfs_in_kernel.c to patch the image into the
kernel. Trouble is you must reserve sufficient space for the image, and
repatch a clean kernel every time you wish to change the ramdisk.

(2) Module preload mechanism

dev/md/md.c calls preload_search_info(mod, MODINFO_NAME)
This accepts a 'module' of type "md_image" or "mfs_root"

It then creates a ramdisk using data at MODINFO_ADDR of MODINFO_SIZE.
These in turn come from sys/kern/subr_module.c which uses a block of
"preload_metadata"

As far as I can tell, either I can put something like
    load -t md_image myfile
in boot/loader.rc, or do what release/Makefile does, which is to put

mfsroot_load="YES"
mfsroot_type="mfs_root"
mfsroot_name="/boot/mfsroot"

in boot/loader.conf. I'm not sure if that's sufficient to replace the NFS
root, or if I have to recompile the kernel _without_ options BOOTP and
BOOTP_NFSROOT for this to work, but I'll give it a go later on...

Cheers,

Brian.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-fs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020429124129.A3409>