From owner-freebsd-current Sun Apr 1 20:15:46 2001 Delivered-To: freebsd-current@freebsd.org Received: from smtp.bsdhome.com (unknown [24.25.2.193]) by hub.freebsd.org (Postfix) with ESMTP id 8E0E137B71C for ; Sun, 1 Apr 2001 20:15:40 -0700 (PDT) (envelope-from bsd@bsdhome.com) Received: from vger.bsdhome.com (vger [192.168.220.2]) by smtp.bsdhome.com (8.11.2/8.11.2) with ESMTP id f323FbE26859; Sun, 1 Apr 2001 23:15:38 -0400 (EDT) (envelope-from bsd@bsdhome.com) Received: (from bsd@localhost) by vger.bsdhome.com (8.11.3/8.11.1) id f323Fa302741; Sun, 1 Apr 2001 23:15:36 -0400 (EDT) (envelope-from bsd) Date: Sun, 1 Apr 2001 23:15:36 -0400 From: Brian Dean To: Matt Dillon Cc: Falco , Mathew KANNER , freebsd-current@FreeBSD.ORG Subject: Re: new rc.diskless{1,2} files Message-ID: <20010401231536.F486@vger.bsdhome.com> References: <3AC4C496.60861EB6@fokus.gmd.de> <20010330125701.C17585@cs.mcgill.ca> <3AC4EFD9.585ECC77@fokus.gmd.de> <200103302253.f2UMrPY05575@earth.backplane.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200103302253.f2UMrPY05575@earth.backplane.com>; from dillon@earth.backplane.com on Fri, Mar 30, 2001 at 02:53:25PM -0800 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, Mar 30, 2001 at 02:53:25PM -0800, Matt Dillon wrote: > > P.S. To anyone who wants to cleanup the rc.diskless files, > please be my guest! I wrote them originally and they worked > 'ok', but then some people mangled them and ever since they > haven't worked right. I don't have time to clean them up > myself. They could use a complete rewriting, IMHO. > > -Matt I've used these to set up a NFS root area for a bunch of servers, but each server has a local disk where I put /var, swap, and a /local mount point for things that need to be accessed a lot. I found rc.diskless1 was fine, but I needed to hack up rc.diskless2 pretty thoroughly for my own situation. It provided a good template, though :) However, there was one area that I thought you did kind've backwards. That was the sucking in of the /etc files. I'm referring to the following in rc.diskless1 where you check for host-specific files, followed by network, then a default config: if [ -d /conf/${bootp_ipa} ] ; then cp -Rp /conf/${bootp_ipa}/etc/* /conf/etc elif [ -d /conf/${bootp_ipbca} ] ; then cp -Rp /conf/${bootp_ipbca}/etc/* /conf/etc else cp -Rp /conf/default/etc/* /conf/etc fi I've found that one can reduce a lot of common file duplication by reversing that logic, going after "default" first, then "network-specific", finally followed by "host-specific" files: if [ -d /conf/default/etc/ ]; then cp -Rp /conf/default/etc/* /conf/etc fi if [ -d /conf/${bootp_ipbca} ] ; then cp -Rp /conf/${bootp_ipbca}/etc/* /conf/etc fi if [ -d /conf/${bootp_ipa} ] ; then cp -Rp /conf/${bootp_ipa}/etc/* /conf/etc fi The idea of this being that most /etc files go into "default", and only overrides go into the "network" and "host-specific" directories. Would folks support and agree to a change like this? -Brian -- Brian Dean bsd@FreeBSD.org bsd@bsdhome.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message