*BSD News Article 13871


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!elroy.jpl.nasa.gov!usc!cs.utexas.edu!natinst.com!hrd769.brooks.af.mil!not-for-mail
From: burgess@hrd769.brooks.af.mil (Dave Burgess)
Newsgroups: comp.os.386bsd.questions
Subject: Re: Kernel building?
Date: 1 Apr 1993 12:20:47 -0600
Organization: Armstrong Lab MIS, Brooks AFB TX
Lines: 118
Message-ID: <1pfbpvINNfrf@hrd769.brooks.af.mil>
References: <C4t7pL.7IF@nmrdc1.nmrdc.nnmc.navy.mil>
NNTP-Posting-Host: hrd769.brooks.af.mil

In article <C4t7pL.7IF@nmrdc1.nmrdc.nnmc.navy.mil> dsc3pzp@nmrdc1.nmrdc.nnmc.navy.mil (Philip Perucci) writes:
>1st-time kernel compile...
>
>1) Install of bin01/src01/etc01 - no problem
>2) Install patchkit 0.2.2       - no problem
>3) config                       - PROBLEM
>
>Is there a doc somewhere that explains kernel compiling a bit more
>than the instructions that come with patchkit 0.2.2? 
>
>I had to do "config GENERICISA" to get config to work (doing make
>right now).  I created directory "MYCONFIG" in /sys/compile, and 
>tried "config MYCONFIG" ... no joy (file not found error).
>BTW- I did NOT do "rm -r /sys/compile/GENERICISA" before config ...
>     had a bad feeling about that.
>
>Any ideas?  Flames?  Anything?
>

  I created a shell script that does most of the grunt work for your.  It is
included at the end of this article.

  Notes on use:

1.  It checks to make sure you are root.  And I mean ROOT!!  If the first
user 0 in your passwd file is NOT root, this process will fail.

2.  If you want /usr/sbin/config rebuilt, delete it.  This is a good
thing, especially after a big rebuild or anytime you have a config problem.

3.  You can set up a variable called "CONFIG_NAME" that has the name of
your configuration file name, you can specify an argument, which will 
override the CONFIG_NAME, or you can use the the default, which is GENERICISA.  

4.  In the unlikely event there is an error (smirk :-), the errors are left
on the screen with a simple not saying error are encountered.  If the make
succeeded, the screen will clear and instructions about the manual 
installation of the new kernel will be displayed.

5.  DO NOT DELETE THE OLD KERNEL!  This can causes some seriously mystifying
errors.  You should 'mv' the old kernel to a new name and then write the new 
kernel to /.

- - - - - - - - - - - - - CUT HERE - - - - - - - - - - - - - - -
:
#
#  Script to rebuild the kernel.
#
if [ `whoami` != 'root' ] ; then
  echo 'You must be root to proceed from this point'
  exit 1
fi

#
# Rebuild Config
#

if [ -f /usr/sbin/config ] ; then
  echo "Config Up To Date"
else
  cd /usr/src/usr.sbin/config
  make depend
  make
  make install
fi

#
# Modify the local Configuration File
#

if [ "X$CONFIG_NAME" = "X" ]; then
  CONFIG_NAME=GENERICISA
fi  

if [ "X$1" != "X" ]; then
  CONFIG_NAME=$1
fi
cd /sys/i386/conf

if [ ! -f $CONFIG_NAME ]; then
  cp GENERICISA $CONFIG_NAME
fi

echo `tput clr`
echo "Modifying $CONFIG_NAME config file"
echo -n "Press return to continue"
read ans

vi $CONFIG_NAME

config $CONFIG_NAME

cd /sys/compile/$CONFIG_NAME
make newvers
make depend
make

if [ $? -ge 1 ] ; then
  echo "Errors encountered"
else
  echo `tput clr`
  echo ""
  echo "  Manual Installation is recommended.  The following files should be"
  echo "copied/linked/moved to the root directory.  The following steps are"
  echo "suggested:"
  echo ""
  echo "	mv /386bsd /386bsd.alt"
  echo "	mv /sys/compile/$CONFIG_NAME/386bsd /386bsd"
  echo "	reboot"
  echo ""
  echo "Remember that the new kernel changes will not take place until you "
  echo "re-boot the system."
fi
-- 
------
TSgt Dave Burgess
NCOIC AL/Management Information Systems Office
Brooks AFB, TX