From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 1 22:55:32 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 47AA916A400 for ; Sun, 1 Jul 2007 22:55:32 +0000 (UTC) (envelope-from ticso@cicely12.cicely.de) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) by mx1.freebsd.org (Postfix) with ESMTP id 2449213C45A for ; Sun, 1 Jul 2007 22:55:30 +0000 (UTC) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de ([10.1.1.7]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id l61MtS2q094501; Mon, 2 Jul 2007 00:55:28 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [10.1.1.14]) by cicely5.cicely.de (8.13.4/8.13.4) with ESMTP id l61MtNUU036285 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 2 Jul 2007 00:55:23 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.13.4/8.13.3) with ESMTP id l61MtMrE061074; Mon, 2 Jul 2007 00:55:22 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.13.4/8.13.3/Submit) id l61MtM4Z061073; Mon, 2 Jul 2007 00:55:22 +0200 (CEST) (envelope-from ticso) Date: Mon, 2 Jul 2007 00:55:22 +0200 From: Bernd Walter To: Martin Cracauer Message-ID: <20070701225522.GB50157@cicely12.cicely.de> References: <20070701181334.GA77427@cons.org> <20070701193640.GW50157@cicely12.cicely.de> <20070701213540.GA83788@cons.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070701213540.GA83788@cons.org> X-Operating-System: FreeBSD cicely12.cicely.de 5.4-STABLE alpha User-Agent: Mutt/1.5.9i X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED=-1.8, BAYES_00=-2.599 autolearn=ham version=3.1.7 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on cicely12.cicely.de Cc: freebsd-hackers@freebsd.org, ticso@cicely.de Subject: Re: pxeboot and /boot filesystem, share /boot/kernel X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2007 22:55:32 -0000 On Sun, Jul 01, 2007 at 05:35:40PM -0400, Martin Cracauer wrote: > Bernd Walter wrote on Sun, Jul 01, 2007 at 09:36:41PM +0200: > > On Sun, Jul 01, 2007 at 02:13:34PM -0400, Martin Cracauer wrote: > > 4) Use different / on the same server filesystem with hardlinked /boot. > > Hmm, directory hardlinks through NFS server? But might do. I ment the files in it hardlinked. > I also considered hacking up the NFS server code to resolve individual > symlinks of my choice. I like this feature a lot when serving samba > shares to Windows clients to make stupid applications actually place > stuff where I want it. But this solution is bad news if you rebase > your NFS server. Yes - too easy to forget. > %% > > It has been pointed out to me that BSD used to have > /etc/fstab. back in the day. That seems to be easy enough > to re-introduce given that pxeboot already set the IP address. > > However, it is somewhat hackey since in effect your first root > filesystem (common for all clients) gets used only once for /etc/fstab > and is only used to redirect to a new (indivual) root filesystem. I have something quite similar with a bunch of NetBSD hosts. Common / with different var partitions mounted by custom scripts and not by fstab. Since hostname was already set by dhcp at this point it worked. > > 5) Use two / - one common for booting and a client specific. > > loader.rc in common will overwrite rootfs. > > But I'm unshure if you can get host specific data, e.g. MAC from net > > interface. > > That is somewhat similar to /etc/fstab. but would require the > 4th to know about networking. It does know the bootdev and I just checked the soruce and it even sets variables: common/dev_net.c: setenv("boot.netif.ip", inet_ntoa(myip), 1); common/dev_net.c: setenv("boot.netif.netmask", intoa(netmask), 1); common/dev_net.c: setenv("boot.netif.gateway", inet_ntoa(gateip), 1); common/dev_net.c: setenv("boot.netif.hwaddr", temp, 1); common/dev_net.c: setenv("boot.nfsroot.server", inet_ntoa(rootip), 1); common/dev_net.c: setenv("boot.nfsroot.path", rootpath, 1); No hostname, but IP and MAC. You just have to use the variables in your own loader.rc to overwrite the path. You can fetch them with getenv: s" boot.netif.ip" getenv Well - my forth is too rusty, so I can't help on the if/setenv part. > > 6) Don't install *.symbols and live with multiple file space usage for > > the rest. > > Right but not sportish :-) :-) > Overall, I also need to keep in mind that some but but all of my > diskless clients will have individual kernels and that I want the most > elegant way to express this. If you want you can select the kernel in your loader.rc as well... > Or a per-host kernel setting in loader.rc which normally points to the > common kernel but can point to an individual one. But as mentioned > earlier, this is difficult to do if you / is already unshared, unless > the loader can deal with NFS or tftp to load from a > address:/boot/... location. It can at least read any file from the already mounted NFS path. No problem to read /boot/kernel.hostx/ instead of default. Don't know if you can switch to another NFS path. -- B.Walter http://www.bwct.de http://www.fizon.de bernd@bwct.de info@bwct.de support@fizon.de