Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Apr 2001 23:50:24 +0200 (CEST)
From:      Luigi Rizzo <luigi@info.iet.unipi.it>
To:        Brian Dean <bsd@bsdhome.com>
Cc:        "David E. Cross" <crossd@cs.rpi.edu>, Sven Huster <sven.huster@mailsurf.com>, Jordan Hubbard <jkh@osd.bsdi.com>, stable@FreeBSD.org, developers@FreeBSD.org
Subject:   Re: FreeBSD 4.3-RC5 now on ftp.freebsd.org
Message-ID:  <200104202150.XAA74722@info.iet.unipi.it>
In-Reply-To: <20010420111151.A55293@vger.bsdhome.com> from Brian Dean at "Apr 20, 2001 11:11:51 am"

next in thread | previous in thread | raw e-mail | index | archive | help
> I'd be happy commit this if there is agreement.

yes please, go ahead.

I still do not know how does your approach work when you
override the (open) /etc/rc and /etc/rc.diskless1 with the newly
mounted ones, but let's hope the system does the right thing.

I only suggest one modification -- the second part (where the 3
locations for overriding files in /etc are checked) can be replaced
by the shorter and cleaner code below:

	for i in default ${bootp_ipbca} ${bootp_ipa} ; do
	    if [ -d /conf/${i}/etc ]; then
	       cp -Rp /conf/${i}/etc/* /etc
	    fi
	done

Also, for future: the initial copy from /etc to /tmp/etc would not
be necessary if /conf/default/etc already contained the necessary
files (and /etc only contains rc and rc.diskless1). So one could
also suggest that those willing to use diskless should make sure
that /conf/default/etc is properly populated, and save the
initial mount, copy and unmount.

	cheers
	luigi


> -Brian
> --
> Brian Dean
> bsd@FreeBSD.org
> bsd@bsdhome.com
> 
> 
> Index: rc.diskless1
> ===================================================================
> RCS file: /home/ncvs/src/etc/rc.diskless1,v
> retrieving revision 1.7
> diff -u -r1.7 rc.diskless1
> --- rc.diskless1	2001/04/03 00:24:01	1.7
> +++ rc.diskless1	2001/04/20 15:08:16
> @@ -87,39 +87,50 @@
>      fi
>  done
>  echo "Interface ${bootp_ifc} IP-Address ${bootp_ipa} Broadcast ${bootp_ipbca}"
> - 
> -# Files in /etc are copied to /conf/etc which is writable. Then
> -# per-machine configs from /conf/ip.address/etc are copied onto this
> -# directory. First choice is using the client's IP, then the client's
> -# broadcast address, then a default configuration.
> +
> +
> +
> +# Create an MFS /tmp to temporarily hold files from /etc until we
> +# can bootstrap /etc as an MFS.
> +
> +/sbin/mount_mfs -s 4096 -T qp120at dummy /tmp
> +chkerr $? "MFS mount on /tmp"
> +mkdir /tmp/etc
> +/bin/cp -Rp /etc /tmp
> +chkerr $? "cp /etc to /tmp/etc MFS"
> +
> +/sbin/mount_mfs -s 4096 -T qp120at dummy /etc
> +chkerr $? "MFS mount on /etc"
> +/bin/chmod 755 /etc
> +
> +/bin/cp -Rp /tmp/etc/* /etc
> +chkerr $? "cp /tmp/etc to /etc MFS"
> +
> +rm -rf /tmp/etc
> +/sbin/umount /tmp
> +
> +
> +# Allow for override files to replace files in /etc.  Use /conf/*/etc
> +# to find the override files.  First choice is default files that
> +# always override, then files that from the directory that matches the
> +# client's broadcast address, finally followed by overrides that match
> +# the client's IP address.
> +#
>  # This way we have some flexibility to handle clusters of machines
>  # on separate subnets.
>  #
> -# WARNING! null mounts cannot handle mmap, and since many programs
> -# use mmap (such as 'cp'), we have to copy.
> -#
> -mount_mfs -s 2048 -T qp120at dummy /conf/etc
> -cp -Rp /etc/* /conf/etc
> -chkerr $? "MFS mount on /conf/etc"
>  
> -# Pick up default, network-specific, and host-specific config, in that
> -# order
> -
>  if [ -d /conf/default/etc/ ]; then
> -	cp -Rp /conf/default/etc/* /conf/etc
> +	cp -Rp /conf/default/etc/* /etc
>  fi
>  
>  if [ -d /conf/${bootp_ipbca} ] ; then
> -	cp -Rp /conf/${bootp_ipbca}/etc/* /conf/etc
> +	cp -Rp /conf/${bootp_ipbca}/etc/* /etc
>  fi
>  
>  if [ -d /conf/${bootp_ipa} ] ; then
> -	cp -Rp /conf/${bootp_ipa}/etc/* /conf/etc
> +	cp -Rp /conf/${bootp_ipa}/etc/* /etc
>  fi
> -
> -# Make the new directory available as /etc
> -#
> -mount_null /conf/etc /etc
>  
>  # Tell /etc/rc to run the specified script after
>  # it does its mounts but before it does anything
> 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200104202150.XAA74722>