Скрипт для автоматической постройке kernel.
использовать так:
Загоняем скрипт в файл, делаем запускным,
копируем файл в /usr/src/sys/i386/conf
и запускаем...
sh# ./build_kernel MyGeneric
Сам скрипт приведён ниже:
--------------------------------------------------------------
#!/bin/sh
clear
KRNL_CFG=$1
PATH_CFG=`pwd`
STEP1='make cleandepend'
STEP2='make depend'
STEP3='make all'
if [ -z "$KRNL_CFG" ]; then
echo ""
echo "Kernel not found"
echo "Use: build_kernel _GENERIC_"
echo ""
exit
fi
echo ""
echo "~~~ Build NEW Kernel ~~~"
echo ""
echo "Krnl cfg: $KRNL_CFG"
echo "Path cfg: $PATH_CFG/$KRNL_CFG"
echo ""
config $KRNL_CFG > /dev/null 2>&1
#config $KRNL_CFG
cd ../compile/$KRNL_CFG
echo "Step 1: Cleandepend"
$STEP1 > /dev/null 2>&1
#$STEP1 > ../cleandepend.log
echo "Step 2: Depend"
$STEP2 > /dev/null 2>&1
#$STEP2 > ../depend.log
echo "Step 3: Make all"
$STEP3 > /dev/null 2>&1
#$STEP3 > ../make.log
echo ""
echo "Build Complite..."
dt=`ls -l kernel | awk '{ print $6,$7,$8 }'`
echo "Kernel: $KRNL_CFG $dt"
size=`ls -l kernel | awk '{ print $5 }'`
echo " size: $size"
echo ""
echo "Clean kernel..."
echo "Step 1:"
`strip kernel`
size=`ls -l kernel | awk '{ print $5 }'`
echo " size: $size"
echo "Step 2:"
`strip --remove-section=.note --remove-section=.comment kernel`
size=`ls -l kernel | awk '{ print $5 }'`
echo " size: $size"
echo "Clean Complite..."
echo ""
echo "Total size kernel: $size"
--------------------------------------------------------------