From owner-freebsd-arch Wed Jun 19 12: 3:13 2002 Delivered-To: freebsd-arch@freebsd.org Received: from is2.mh.itc.u-tokyo.ac.jp (is2.mh.itc.u-tokyo.ac.jp [133.11.205.12]) by hub.freebsd.org (Postfix) with ESMTP id 1CA6337B404 for ; Wed, 19 Jun 2002 12:02:27 -0700 (PDT) Received: from is2.mh.itc.u-tokyo.ac.jp (is2.mh.itc.u-tokyo.ac.jp [127.0.0.1]) by is2.mh.itc.u-tokyo.ac.jp (Postfix) with ESMTP id 4E650378076 for ; Thu, 20 Jun 2002 04:02:26 +0900 (JST) Received: from mailhosting.itc.u-tokyo.ac.jp (IDENT:mirapoint@mailhosting.itc.u-tokyo.ac.jp [133.11.205.3]) by is2.mh.itc.u-tokyo.ac.jp (8.11.3/8.11.3) with ESMTP id g5JJ2QL09207 for ; Thu, 20 Jun 2002 04:02:26 +0900 Received: from amulet.ht.myn.rcast.u-tokyo.ac.jp (YahooBB219001110022.bbtec.net [219.1.110.22]) by mailhosting.itc.u-tokyo.ac.jp (Mirapoint Messaging Server MOS 2.9.3.2) with ESMTP id AGL27946; Thu, 20 Jun 2002 04:02:24 +0900 (JST) Date: Thu, 20 Jun 2002 04:02:41 +0900 Message-ID: From: Hiroharu Tamaru To: freebsd-arch@FreeBSD.ORG Subject: Re: Configuration management In-Reply-To: <20020619031533.2c302e68.makonnen@pacbell.net> References: <20020619031533.2c302e68.makonnen@pacbell.net> User-Agent: Wanderlust/2.8.1 (Something) Emacs/21.2 Mule/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: multipart/mixed; boundary="Multipart_Thu_Jun_20_04:02:41_2002-1" Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --Multipart_Thu_Jun_20_04:02:41_2002-1 Content-Type: text/plain; charset=US-ASCII Hi, At Wed, 19 Jun 2002 03:15:33 -0700, Mike Makonnen wrote: > I am of a different opinion. I happen to like plain-text configuration files. > The problem is not that we need an easier way to _edit_ the files, > but rather we need a better way to manage all those files and the changes > we make to them. For example, I have a haphazard collection of rcs files I totally agree. In fact I have been using cvs for this task since FreeBSD 2.2.x days. I track -stable every several months. As the buildworld Makefiles evolve, things has become easier, and never harder. I am not using mergemaster at all in the process (no offense here too; I just adopted a way without it before it appeared). I have always found the "cvs diff" abilty invaluable. For what it's worth, I will attach my helper scripts (mainly for bootstraping the repository on a newly installed machine) to give you an idea. It's not fully automated nor complete nor clean, but has served me quite well for a long time. These is no script for automating updates; I type them manually following my memo: # cvsup the source, then cd /usr/src make -j4 buildworld < /dev/null >& build.2001.02.02 & make -j4 buildkernel < /dev/null >& kernel.2001.02.02 & cd /w/4src rm -rf config mkdir config cd /usr/src/etc make distrib-dirs distribution DESTDIR=/w/4src/config cd /w/4src/config /w/4src/tools/clean-etc-distrib-check | less /w/4src/tools/clean-etc-distrib cvs -d /var/cvs import -m "import after cvsup" config FreeBSD_core RELENG_4_20010202 suspend cd ~ mkdir cvstmp chmod go-rwx cvstmp cd cvstmp cvs -d /var/cvs co -jFreeBSD_core:yesterday -jFreeBSD_core config .... cd ~/cvstmp/config/ cvs diff -u cvs commit -m "merged after cvsup" fg cd /usr/src make installworld < /dev/null >& install.2001.02.02 & make installkernel < /dev/null >>& install.2001.02.02 & cd / cvs update cd /dev ./MAKEDEV all shutdown -r +1 Oh, by the way, on my machines, the following links exist: /usr/src -> /w/4src/src /usr/obj -> /w/4src/i386 or /w/4src/alpha and I have /w/4src/config as the teporary install space for /etc stuff and /w/4src/tools for the scripts I have. /w is nfs mounted all around the place and the clients simple use what the build machine has built here. The repository is at /var/cvs with the module name "config" The clean-etc-distrib stuff was mainly for the very old days when "make distribution" installed binary programs in /w/4src/config/ . I was too lazy to update my scripts. -- Hiroharu Tamaru --Multipart_Thu_Jun_20_04:02:41_2002-1 Content-Type: text/plain; charset=US-ASCII Content-Disposition: attachment; filename="bootstrap-etc-cvs" Content-Transfer-Encoding: 7bit #!/bin/sh ERR=0 if [ ! -d /w/4src/config/etc -o -e /w/4src/config/dev/null ]; then cat < ../files.list filelist=`cat ../files.list` echo "copying all CVS controlled files for / to $DIR/config/" echo "diffs are available at $DIR/files.diff" for i in ${filelist}; do diff -u $i /$i >> ../files.diff cp /$i $i done echo "change dir to $DIR/config/etc" cd etc echo "rm passwd master.passwd pwd.db spwd.db" rm passwd master.passwd pwd.db spwd.db echo "cvs remove passwd master.passwd pwd.db spwd.db" cvs remove passwd master.passwd pwd.db spwd.db echo "" echo "Invoking /bin/csh" echo "You can check up using cvs commands now." echo "Exit this shell to continue." echo "Commit will follow exit and then $DIR will be removed." csh cd $DIR/config echo "==================================================================" cvs commit -m "newly installed" echo "==================================================================" rm -rf $DIR || exit mkdir $DIR || exit cd $DIR || exit echo "==================================================================" cvs -d /var/cvs checkout config echo "==================================================================" cd config || exit cp -RPpv . / rm -rf $DIR || exit echo "everything is copyed to /" echo "try cvs update at / and also run 'recover.modes'" --Multipart_Thu_Jun_20_04:02:41_2002-1 Content-Type: text/plain; charset=US-ASCII Content-Disposition: attachment; filename="clean-etc-distrib-check" Content-Transfer-Encoding: 7bit #!/bin/sh - rm -f ./root/distribution.files find . -ls \ | awk '{if ($7~/,/){print $3,$4,$5,$6,$7$8,$12}else if($12~/-/){print $3,$4,$5,$6,$7,$11,$12,$13}else{print $3,$4,$5,$6,$7,$11}}' \ | sort +5 > ./root/distribution.files echo "===== differences in distribution files" diff -u0 /root/distribution.files ./root/distribution.files echo "===== everything but files and dirs" find . \! \( -type d -o -type f \) | xargs ls -dl echo "===== empty files" find . -type f -size 0 | xargs ls -dl echo "===== executable binaries" find . -type f -perm -100 | xargs file | grep 'executable$' | grep -v ' text ' --Multipart_Thu_Jun_20_04:02:41_2002-1 Content-Type: text/plain; charset=US-ASCII Content-Disposition: attachment; filename="clean-etc-distrib" Content-Transfer-Encoding: 7bit #!/bin/sh - echo "===== generate ./root/distribution.files" rm -f ./root/distribution.files find . -ls \ | awk '{if ($7~/,/){print $3,$4,$5,$6,$7$8,$12}else if($12~/-/){print $3,$4,$5,$6,$7,$11,$12,$13}else{print $3,$4,$5,$6,$7,$11}}' \ | sort +5 > ./root/distribution.files echo "===== remove everything but files and dirs" find . \! \( -type d -o -type f \) | xargs rm -f echo "===== remove empty files" find . -type f -size 0 | xargs rm -f echo "===== remove executable binaries" find . -type f -perm -100 | xargs file | grep 'executable$' | grep -v ' text '\ | sed 's/:[^:]*$//' | xargs rm -f echo "===== remove empty directories .. don't bother about the errors!" find . -type d | sort -r | xargs rmdir echo "===== generate ./root/mtree.modes" mtree -c -kuid,gid,mode > ./root/mtree.modes echo "===== done" --Multipart_Thu_Jun_20_04:02:41_2002-1 Content-Type: text/plain; charset=US-ASCII Content-Disposition: attachment; filename="recover.modes" Content-Transfer-Encoding: 7bit #!/bin/sh - # execute this from root directory, or where ever you want it to root at. cd / mtree -U -e -f ./root/mtree.modes # --Multipart_Thu_Jun_20_04:02:41_2002-1-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message