From owner-freebsd-current Mon Apr 2 9:28:39 2001 Delivered-To: freebsd-current@freebsd.org Received: from earth.backplane.com (earth-nat-cw.backplane.com [208.161.114.67]) by hub.freebsd.org (Postfix) with ESMTP id 0DEF237B720 for ; Mon, 2 Apr 2001 09:28:37 -0700 (PDT) (envelope-from dillon@earth.backplane.com) Received: (from dillon@localhost) by earth.backplane.com (8.11.2/8.9.3) id f32GSTb26609; Mon, 2 Apr 2001 09:28:29 -0700 (PDT) (envelope-from dillon) Date: Mon, 2 Apr 2001 09:28:29 -0700 (PDT) From: Matt Dillon Message-Id: <200104021628.f32GSTb26609@earth.backplane.com> To: Brian Dean Cc: Falco , Mathew KANNER , freebsd-current@FreeBSD.ORG Subject: Re: new rc.diskless{1,2} files References: <3AC4C496.60861EB6@fokus.gmd.de> <20010330125701.C17585@cs.mcgill.ca> <3AC4EFD9.585ECC77@fokus.gmd.de> <200103302253.f2UMrPY05575@earth.backplane.com> <20010401231536.F486@vger.bsdhome.com> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG :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 :... Oops. That was broken allright. It's definitely correct to copy the files in reverse order so the network files override the defaults, and the per-host files override the network files. -Matt :-Brian :-- :Brian Dean To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message