From owner-freebsd-net Mon Apr 29 4:41:37 2002 Delivered-To: freebsd-net@freebsd.org Received: from mk-smarthost-2.mail.uk.tiscali.com (mk-smarthost-2.mail.uk.worldonline.com [212.74.112.72]) by hub.freebsd.org (Postfix) with ESMTP id 173CB37B41B; Mon, 29 Apr 2002 04:41:32 -0700 (PDT) Received: from [212.139.129.125] (helo=bloodhound.uk.worldonline.com) by mk-smarthost-2.mail.uk.tiscali.com with esmtp (Exim 3.35 #1) id 1729WY-000HaN-00; Mon, 29 Apr 2002 12:40:54 +0100 Received: from brian by bloodhound.uk.worldonline.com with local (Exim 3.22 #1) id 1729X7-0000vS-00; Mon, 29 Apr 2002 12:41:29 +0100 Date: Mon, 29 Apr 2002 12:41:29 +0100 From: Brian Candler To: freebsd-fs@freebsd.org, freebsd-net@freebsd.org Subject: Re: NFS clearing attribute cache in nfs_open Message-ID: <20020429124129.A3409@linnet.org> References: <20020426181535.B2748@linnet.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020426181535.B2748@linnet.org>; from B.Candler@pobox.com on Fri, Apr 26, 2002 at 06:15:35PM +0100 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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-net" in the body of the message