Date: Mon, 2 Jul 2007 00:55:22 +0200 From: Bernd Walter <ticso@cicely12.cicely.de> To: Martin Cracauer <cracauer@cons.org> Cc: freebsd-hackers@freebsd.org, ticso@cicely.de Subject: Re: pxeboot and /boot filesystem, share /boot/kernel Message-ID: <20070701225522.GB50157@cicely12.cicely.de> In-Reply-To: <20070701213540.GA83788@cons.org> References: <20070701181334.GA77427@cons.org> <20070701193640.GW50157@cicely12.cicely.de> <20070701213540.GA83788@cons.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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.<hostname> 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.<host> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070701225522.GB50157>