*BSD News Article 11274


Return to BSD News archive

Received: by minnie.vk1xwt.ampr.org with NNTP
	id AA1489 ; Tue, 23 Feb 93 14:44:05 EST
Path: sserve!manuel.anu.edu.au!munnari.oz.au!sgiblab!zaphod.mps.ohio-state.edu!howland.reston.ans.net!paladin.american.edu!news.univie.ac.at!hp4at!mcsun!sun4nl!tuegate.tue.nl!rw8.urc.tue.nl!rcpt
From: rcpt@rw8.urc.tue.nl (Piet Tutelaers)
Newsgroups: comp.unix.bsd
Subject: [386 BSD] Running patchkit outside /usr/src
Message-ID: <rcpt.729818276@rw8.urc.tue.nl>
Date: 15 Feb 93 23:17:56 GMT
Sender: root@tuegate.tue.nl
Reply-To: rcpt@urc.tue.nl
Lines: 220


Hello 386-patchkitters,

Last weekend I have installed a fresh 386 BSD source tree on our PMO650
(Pinnacle Magneto Optical disk).  This disk is connected to our SUN so
it was necessary for me to run the patchkit from /pmo/386bsd-0.1 instead
of the default root directory.  Here is a summary of the steps I needed
to do in order to build a complete source tree on our SUN.  I hope that
the authors/maintainers of the patchkit will make it easier in a next
release!

Although the patchkit carefully checks if a patch does need other
patches it does not check if you have installed all needed distribution
sets.  So it took me quite a lot of time to discover that I not only
needed the source distribution (srcdist) but also the binary
distribution (bindist) because that contains the kernel sources.  Next
patches could not be installed because they rely on sources I still do not
seem to have:
	patch00504	/usr/othersrc
	patch00600	/usr/obj/games

Being super user on 386 is checked with `id -u'.  This test does not
work on SunOS4.1.2.  For the moment I have commented out the `exit' in
the script `patches' to avoid an early breakdown.  This has even the
benefit that I could test the patch kit procedure under my own usercode,
quite a happy feeling on the SUN.  There should be a neater solution. 

Next problem is more cumbersome.  A lot of patches are provided to the
source directory /sys.  This is a symbolic link to /usr/src/sys.386bsd. 
I have changed all supplied patch/ready/patch000???/PATCH files that
refer to /sys/ manuallly into /usr/src/sys.386bsd.  There were quite a
lot of PATCH files I needed to change.  I could also have linked
/pmo/386bsd-0.1/sys to /pmo/386bsd-0.1/usr/src/sys.386bsd before
patching and putting it back afterwards.  But I hope next patchkit
release will not accept patches on linked directories!

And last but not least I needed to change mkpatchdirs and patches in
order to handle my different patch directory (/pmo/386bsd-0.1/patch) and
rootdirectory (/pmo/386bsd-0.1).  I have included a shar-file containing
context diffs for both in case other people are interested too.

Best wishes,

--Piet

--------------------- patchkit.shar --------------------------
#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  mkpatchdirs.diff patches.diff
# Wrapped by rcpt@rw2.urc.tue.nl on Tue Feb 16 00:12:12 1993
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'mkpatchdirs.diff' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'mkpatchdirs.diff'\"
else
echo shar: Extracting \"'mkpatchdirs.diff'\" \(364 characters\)
sed "s/^X//" >'mkpatchdirs.diff' <<'END_OF_FILE'
X*** mkpatchdirs.orig	Fri Feb 12 17:16:23 1993
X--- mkpatchdirs	Fri Feb 12 17:17:46 1993
X***************
X*** 11,17 ****
X  # 12 Sep 92	Terry Lambert		Original
X  #
X  #
X! PATCHDIR=/patch
X  
X  #
X  # Find out where we were installed
X--- 11,17 ----
X  # 12 Sep 92	Terry Lambert		Original
X  #
X  #
X! PATCHDIR=/pmo/386bsd-0.1/patch
X  
X  #
X  # Find out where we were installed
END_OF_FILE
if test 364 -ne `wc -c <'mkpatchdirs.diff'`; then
    echo shar: \"'mkpatchdirs.diff'\" unpacked with wrong size!
fi
# end of 'mkpatchdirs.diff'
fi
if test -f 'patches.diff' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'patches.diff'\"
else
echo shar: Extracting \"'patches.diff'\" \(3075 characters\)
sed "s/^X//" >'patches.diff' <<'END_OF_FILE'
X*** patches.orig	Fri Feb 12 17:16:11 1993
X--- patches	Tue Feb 16 00:09:06 1993
X***************
X*** 58,64 ****
X  DONTWAIT=0
X  YESNO=0
X  
X! PATCHDIR=/patch
X  TMPDIR=$PATCHDIR/tmp
X  AVAILDIR=$PATCHDIR/ready
X  INSTDIR=$PATCHDIR/installed
X--- 58,65 ----
X  DONTWAIT=0
X  YESNO=0
X  
X! ROOTDIR=/pmo/386bsd-0.1
X! PATCHDIR=/pmo/386bsd-0.1/patch
X  TMPDIR=$PATCHDIR/tmp
X  AVAILDIR=$PATCHDIR/ready
X  INSTDIR=$PATCHDIR/installed
X***************
X*** 74,80 ****
X  then
X  	echo "You are not root."
X  	echo "This program will not run correctly if you are not root."
X! 	exit 7
X  fi
X  
X  
X--- 75,81 ----
X  then
X  	echo "You are not root."
X  	echo "This program will not run correctly if you are not root."
X! #	exit 7
X  fi
X  
X  
X***************
X*** 262,267 ****
X--- 263,269 ----
X  			ex_level=`echo $x | cut -f2 -d" "`
X  			ex_patch=`echo $x | cut -f3 -d" "`
X  			ex_file=`echo $x | cut -f4 -d" "`
X+ 			ex_file=$ROOTDIR$ex_file
X  			if test ! -f $ex_file
X  			then
X  				echo $ex_patch >> reqs
X***************
X*** 355,360 ****
X--- 357,363 ----
X  		DIR)	dstowner=`echo $x | cut -f2 -d" "`;
X  			dstmode=`echo $x | cut -f3 -d" "`;
X  			dst=`echo $x | cut -f4 -d" "`;
X+ 			dst=$ROOTDIR$dst
X  			echo "rmdir $dst > /dev/null 2>&1" >> $UNDODIR;
X  			echo "    mkdir $dst" >> $LOG;
X  			if test ! -d $dst ; then
X***************
X*** 381,386 ****
X--- 384,390 ----
X  			dstowner=`echo $x | cut -f3 -d" "`;
X  			dstmode=`echo $x | cut -f4 -d" "`;
X  			dst=`echo $x | cut -f5 -d" "`;
X+ 			dst=$ROOTDIR$dst
X  			echo "rm $dst" >> $UNDO;
X  			echo "    cp $src $dst" >> $LOG;
X  			cp $src $dst;
X***************
X*** 403,408 ****
X--- 407,413 ----
X  		PATCH)	lvl=`echo $x | cut -f2 -d" "`;
X  			pch=`echo $x | cut -f3 -d" "`;
X  			fle=`echo $x | cut -f4 -d" "`;
X+ 			fle=$ROOTDIR$fle
X  			echo "mv $fle.pl$lvl $fle" >> $UNDO;
X  			echo "    patch -b .pl$lvl -c $fle $AVAILDIR/$patch/$pch" >> $LOG;
X  			patch -b .pl$lvl -c $fle $AVAILDIR/$patch/$pch 2>/dev/null;
X***************
X*** 627,632 ****
X--- 632,638 ----
X  		# we didn't, we might not be able to deinstall binaries.
X  		case $field in
X  		NEW)	dst=`echo $x | cut -f5 -d" "`;
X+ 			dst=$ROOTDIR$dst
X  			if test ! -f $dst; then
X  				echo
X  				echo "(FATAL: THE FILE $dst WAS DELETED BY THE USER)"
X***************
X*** 654,659 ****
X--- 660,666 ----
X  			fi;;
X  		PATCH)	lvl=`echo $x | cut -f2 -d" "`;
X  			fle=`echo $x | cut -f4 -d" "`;
X+ 			fle=$ROOTDIR$fle
X  			if test ! -f $fle.pl$lvl; then
X  				echo
X  				echo "(FATAL: THE FILE $fle.pl$lvl WAS DELETED BY THE USER)"
X***************
X*** 770,777 ****
X--- 777,786 ----
X  		field=`echo $x | cut -f1 -d" "`
X  		case $field in
X  		DIR)	dst=`echo $x | cut -f4 -d" "`;
X+ 			dst=$ROOTDIR$dst
X  			echo "rmdir $dst > /dev/null 2>&1" >> $UNDODIR;;
X  		NEW)	dst=`echo $x | cut -f5 -d" "`;
X+ 			dst=$ROOTDIR$dst
X  			rm -f $dst;
X  			if test "$?" != "0"; then
X  				touch $FAIL
X***************
X*** 781,786 ****
X--- 790,796 ----
X  			fi;;
X  		PATCH)	lvl=`echo $x | cut -f2 -d" "`;
X  			fle=`echo $x | cut -f4 -d" "`;
X+ 			fle=$ROOTDIR$fle
X  			mv -f $fle.pl$lvl $fle;
X  			st=$?;
X  			if test "$st" != "0"; then
END_OF_FILE
echo shar: 2 control characters may be missing from \"'patches.diff'\"
if test 3075 -ne `wc -c <'patches.diff'`; then
    echo shar: \"'patches.diff'\" unpacked with wrong size!
fi
# end of 'patches.diff'
fi
echo shar: End of shell archive.
exit 0