*BSD News Article 10350


Return to BSD News archive

Received: by minnie.vk1xwt.ampr.org with NNTP
	id AA7809 ; Tue, 26 Jan 93 08:00:50 EST
Path: sserve!manuel.anu.edu.au!munnari.oz.au!spool.mu.edu!uwm.edu!zaphod.mps.ohio-state.edu!cs.utexas.edu!natinst.com!hrd769.brooks.af.mil!hrd769.brooks.af.mil!not-for-mail
From: burgess@hrd769.brooks.af.mil (Dave Burgess)
Newsgroups: comp.unix.bsd
Subject: [386bsd] Kernel builder
Date: 22 Jan 1993 11:34:25 -0600
Organization: Armstrong Lab MIS, Brooks AFB TX
Lines: 92
Message-ID: <1jpb71INNa3v@hrd769.brooks.af.mil>
NNTP-Posting-Host: hrd769.brooks.af.mil

  After going through the 'Idiot's Guide to Rebuilding your kernel' (his name
not mine), I decided that the process was reasonably well defined and could
stand to be put into a simple script.  I have done that.  It is included
below, and makes a new kernel using the existing software, Makefiles, etc.
The program defaults to GENERICISA as the configuration file to edit, or 
will accept an environment variable called CONFIG_NAME which should contain
the name of your configuration file, or will accept an argument which will
override the CONFIG_NAME variable.  I started using this when I was building
a new kernel for a friend of mine that needed to have different options
enabled than I needed.  also, since I am one of those folks that keeps a
bunch of weird kernels around, I decided that the last step should be
manual.  Check it out.  E-Mail me with improvements or questions.

TSgt Dave Burgess
NCOIC AL/MIS
Brooks AFB, TX
----------------------------- Cut Here -----------------------------------
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	/usr/local/bin/build.kernel
#
echo x - /usr/local/bin/build.kernel
sed 's/^X//' >/usr/local/bin/build.kernel << 'END-of-/usr/local/bin/build.kernel'
X:
X#
X#  Script to rebuild the kernel.
X#
Xif [ `whoami` != 'root' ] ; then
X  echo 'You must be root to proceed from this point'
X  exit 1
Xfi
X
X#
X# Rebuild Config
X#
X
Xcd /usr/src/usr.sbin/config
Xmake depend
Xmake
Xmake install
X
X#
X# Modify the local Configuration File
X#
X
Xif [ "X$CONFIG_NAME" = "X" ]; then
X  CONFIG_NAME=GENERICISA
Xfi  
X
Xif [ "X$1" != "X" ]; then
X  CONFIG_NAME=$1
Xfi
Xcd /sys/i386/conf
X
Xif [ ! -f $CONFIG_NAME ]; then
X  cp GENERICISA $CONFIG_NAME
Xfi
X
Xecho `tput clr`
Xecho "Modifying $CONFIG_NAME config file"
Xecho -n "Press return to continue"
Xread ans
X
Xvi $CONFIG_NAME
X
Xconfig $CONFIG_NAME
X
Xcd /sys/compile/$CONFIG_NAME
Xmake newvers
Xmake depend
Xmake
X
Xecho `tput clr`
Xecho ""
Xecho "  Manual Installation is recommended.  The following files should be"
Xecho "copied/linked/moved to the root directory.  The following steps are"
Xecho "suggested:"
Xecho ""
Xecho "	mv /386bsd /386bsd.old"
Xecho "	mv  386bsd /386bsd"
Xecho "	reboot"
Xecho ""
Xecho "Remember that the new kernel changes will not take place until you "
Xecho "re-boot the system."
END-of-/usr/local/bin/build.kernel
exit