#!/bin/sh # ============================================================================= # use this script to generate a new kernel config # usage: # $> mkdir SAVE_PLACE/kernconf # $> cd /usr/src/sys/${ARCH}/conf # $> mk_kern_template.sh > SAVE_PLACE/kernconf/MYKERNEL # $> ln -s SAVE_PLACE/kernconf/MYKERNEL MYKERNEL # $> cd /usr/src/ # $> make buildkernel KERNCONF=MYKERNEL # $> make installkernel KERNCONF=MYKERNEL # # in MYKERNEL: include the following line before the cpu options # # include GENERIC <- include the GENERIC kernel config, # allready done by this script, but check # for duplicates # # nocpu I486_CPU # # nocpu I586_CPU # # nocpu I686_CPU # ident MYKERNEL <- replace MYKERNEL with your kernel name # # Now the easy part, uncomment the nocpu, nooptions, nodevice you don't want # to have in the kernel. # Keep this file at a save place, and you can easily create a diff between # FreeBSD releases to adjust your kernel config # # 2006-08-07 olli hauer IDENT=MYKERNEL ARCH=$(uname -m) REL=$(sysctl -n kern.osrelease) cat << _EOF #===================================================================================== # \$Source\$ # \$Id\$ # # Kernel Config for FreeBSD ${REL} ${ARCH} # This config overrides the default settings from GENERIC # with the 'no' prefix, so we can track differences of # the kernel config between FreeBSD versions easier # include GENERIC _EOF if [ $# -le 1 ]; then GENERIC=/usr/src/sys/${ARCH}/conf/GENERIC else GENERIC=$1 fi sed -e "s;^ident.*GENERIC;ident ${IDENT};g" \ -e 's;^[cpu|device|makeoptions|options]\(.*\);# no&;g' \ -e 's;^[a-z]\(.*\);# &;g' \ -e 's;^# noident;ident;g' ${GENERIC}