From owner-doc-jp@jp.freebsd.org  Sun Oct 31 15:41:16 1999
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id PAA67790;
	Sun, 31 Oct 1999 15:41:16 +0900 (JST)
	(envelope-from owner-doc-jp@jp.FreeBSD.org)
Received: from sv01.geocities.co.jp (sv01.geocities.co.jp [210.153.89.155])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id PAA67785
	for <doc-jp@jp.freebsd.org>; Sun, 31 Oct 1999 15:41:16 +0900 (JST)
	(envelope-from hrs@geocities.co.jp)
Received: from mail.geocities.co.jp (mail.geocities.co.jp [210.153.89.137]) by sv01.geocities.co.jp (8.9.3+3.2W/3.7W) with ESMTP id PAA17591 for <doc-jp@jp.freebsd.org>; Sun, 31 Oct 1999 15:41:16 +0900 (JST)
Received: from mail.hrs.jp (sutnmax1-ppp45.ed.noda.sut.ac.jp [133.31.173.55]) by mail.geocities.co.jp (1.3G-GeocitiesJ-3.3) with ESMTP id PAA07642 for <doc-jp@jp.freebsd.org>; Sun, 31 Oct 1999 15:41:14 +0900 (JST)
Message-Id: <199910310641.PAA07642@mail.geocities.co.jp>
Received: from localhost (alph.hrs.jp [192.168.0.10])
	by mail.hrs.jp (8.9.3/3.7W/DomainMaster) with ESMTP id PAA77429
	for <doc-jp@jp.freebsd.org>; Sun, 31 Oct 1999 15:36:10 +0900 (JST)
	(envelope-from hrs@hrs.jp)
To: FreeBSD-doc-jp <doc-jp@jp.freebsd.org>
X-Mailer: Mew version 1.94 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Date: Sun, 31 Oct 1999 15:35:24 +0900
From: Hiroki Sato <hrs@geocities.co.jp>
X-Dispatcher: imput version 990905(IM130)
Lines: 171
Reply-To: doc-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+990727
X-Sequence: doc-jp 6821
Subject: [doc-jp 6821] <handbook> cutting-edge/chapter.sgml 1.30 -> 1.32 (part 4/7)
Errors-To: owner-doc-jp@jp.freebsd.org
Sender: owner-doc-jp@jp.freebsd.org
X-Originator: hrs@geocities.co.jp

$B:4F#!wEl5~M}2JBg3X$G$9!#(B

$B;M$DL\!#(B

+    <sect2>
+      <title>Update <filename>/etc</filename></title>
+      
+      <para>Remaking the world will not update certain directories (in
+	particular, <filename>/etc</filename>, <filename>/var</filename> and
+	<filename>/usr</filename>) with new or changed configuration files.
+	This is something you have to do by hand, eyeball, and judicious use
+	of &man.diff.1;.</para>
+    
+      <para>You cannot just copy over the files from
+	<filename>/usr/src/etc</filename> to <filename>/etc</filename> and
+	have it work.  Some of these files must be <quote>installed</quote>
+	first.  This is because the <filename>/usr/src/etc</filename>
+	directory <emphasis>is not</emphasis> a copy of what your
+	<filename>/etc</filename> directory should look like.  In addition,
+	there  are files that should be in <filename>/etc</filename> that are
+	not in <filename>/usr/src/etc</filename>.</para>
+    
+      <para>The simplest way to do this is to install the files into a new
+	directory, and then work through them looking for differences.</para>
+    
+      <warning>
+	<title>Backup your existing <filename>/etc</filename></title>
+	
+	<para>Although, in theory, nothing is going to touch this directory
+	  automatically, it is always better to be sure.  So copy your
+	  existing <filename>/etc</filename> directory somewhere safe.
+	  Something like:</para>
+	
+	<screen>&prompt.root; <userinput>cp -Rp /etc /etc.old</userinput></screen>
+	
+	<para><option>-R</option> does a recursive copy, <option>-p</option>
+	  preserves times, ownerships on files and suchlike.</para>
+      </warning>
+      
+      <para>You need to build a dummy set of directories to install the new
+	<filename>/etc</filename> and other files into.  I generally choose to
+	put this dummy directory in <filename>/var/tmp/root</filename>, and
+	there are a number of subdirectories required under this as
+	well.</para>
+	
+      <screen>&prompt.root; <userinput>mkdir /var/tmp/root</userinput>
+&prompt.root; <userinput>cd /usr/src/etc</userinput>
+&prompt.root; <userinput>make DESTDIR=/var/tmp/root distrib-dirs distribution</userinput></screen>
+	
+      <para>This will build the necessary directory structure and install the
+	files.  A lot of the subdirectories that have been created under
+	<filename>/var/tmp/root</filename> are empty and should be deleted.
+	The simplest way to do this is to:</para>
+      
+      <screen>&prompt.root; <userinput>cd /var/tmp/root</userinput>
+&prompt.root; <userinput>find -d .  -type d | /usr/bin/perl -lne \
+    'opendir(D,$_);@f=readdir(D);rmdir if $#f == 1;closedir(D);'</userinput></screen>
+      
+      <para>This does a depth first search, examines each directory, and if
+	the number of files in that directory is 2 (<quote/1/ is not a typo in
+	the script) i.e., <quote/<filename/.// and <quote/<filename/..// then
+	it removes the directory.</para>
+    
+      <para><filename>/var/tmp/root</filename> now contains all the files that
+	should be placed in appropriate locations below
+	<filename>/</filename>.  You now have to go through each of these
+	files, determining how they differ with your existing files.</para>
+    
+      <para>Note that some of the files that will have been installed in
+	<filename>/var/tmp/root</filename> have a leading <quote/./.  At the
+	time of writing the only files like this are shell startup files in
+	<filename>/var/tmp/root/</filename> and
+	<filename>/var/tmp/root/root/</filename>, although there may be others
+	(depending on when you are reading this.  Make sure you use
+	<command/ls -a/ to catch them.</para>
+    
+      <para>The simplest way to do this is to use &man.diff.1; to compare the
+	two files.</para>
+    
+      <screen>&prompt.root; <userinput>diff /etc/shells /var/tmp/root/etc/shells</userinput></screen>
+      
+      <para>This will show you the differences between your
+	<filename>/etc/shells</filename> file and the new
+	<filename>/etc/shells</filename> file.  Use these to decide whether to
+	merge in changes that you have made or whether to copy over your old
+	file.</para>
+    
+      <tip>
+	<title>Name the new root directory
+	  (<filename>/var/tmp/root</filename>)with a timestamp, so you can
+	  easily compare differences between versions</title>
+	
+	<para>Frequently remaking the world means that you have to update
+	<filename>/etc</filename> frequently as well, which can be a bit of
+	  a chore.</para>
+	
+	<para>You can speed this process up by keeping a copy of the last set
+	  of changed files that you merged into <filename>/etc</filename>.
+	  The  following procedure gives one idea of how to do this.</para>
+	
+	<procedure>
+	  <step>
+	    <para>Make the world as normal.  When you want to update
+	      <filename>/etc</filename> and the other directories, give the
+	      target directory a name based on the current date.  If you were
+	      doing this on the 14th of February 1998 you could do the
+	      following.</para>
+	  
+	    <screen>&prompt.root; <userinput>mkdir /var/tmp/root-19980214</userinput>
+&prompt.root; <userinput>cd /usr/src/etc</userinput>
+&prompt.root; <userinput>make DESTDIR=/var/tmp/root-19980214 \
+    distrib-dirs distribution</userinput></screen>
+	  </step>
+	  
+	  <step>
+	    <para>Merge in the changes from this directory as outlined
+	      above.</para>
+	    
+	    <para><emphasis>Do not</emphasis> remove the
+	      <filename>/var/tmp/root-19980214</filename> directory when you
+	      have finished.</para>
+	  </step>
+	  
+	  <step>
+	    <para>When you have downloaded the latest version of the source
+	      and remade it, follow step 1.  This will give you a new
+	      directory, which might be called
+	      <filename>/var/tmp/root-19980221</filename> (if you wait a week
+	      between doing updates).</para>
+	  </step>
+	  
+	  <step>
+	    <para>You can now see the differences that have been made in the
+	      intervening week using &man.diff.1; to create a recursive diff
+	      between the two directories.</para>
+	      
+	    <screen>&prompt.root; <userinput>cd /var/tmp</userinput>
+&prompt.root; <userinput>diff -r root-19980214 root-19980221</userinput></screen>
+	  
+	    <para>Typically, this will be a much smaller set of differences
+	      than those between
+	      <filename>/var/tmp/root-19980221/etc</filename> and
+	      <filename>/etc</filename>.  Because the set of differences is
+	      smaller, it is easier to migrate those changes across into your
+	      <filename>/etc</filename> directory.</para>
+	  </step>
+	  
+	  <step>
+	    <para>You can now remove the older of the two
+	      <filename>/var/tmp/root-*</filename> directories.</para>
+	      
+	    <screen>&prompt.root; <userinput>rm -rf /var/tmp/root-19980214</userinput></screen>
+	  </step>
+	  
+	  <step>
+	    <para>Repeat this process every time you need to merge in changes
+	      to  <filename>/etc</filename>.</para>
+	  </step>
+	</procedure>
+	
+	<para>You can use &man.date.1; to automate the  generation of the
+	  directory names.</para>
+	  
+	<screen>&prompt.root; <userinput>mkdir /var/tmp/root-`date "+%Y%m%d"`</userinput></screen>
+      </tip>
+    </sect2>

--
| $B:4F#(B $B9-@8!wEl5~M}2JBg3X(B <hrs@geocities.co.jp>
|                         mailto:j7397067@ed.noda.sut.ac.jp
|
