<>

2.2. Creating the mkernel Script for Compiling Kernel

#!/bin/bash
VERSION=''

test $VERSION || (echo "Kernel version please."; exit)

CONFIG=config-$VERSION
KERNEL=lfskernel-$VERSION

cd /usr/src/linux-$VERSION &&
make mrproper &&
cp /boot/$CONFIG .config &&
make menuconfig &&
make &&
make modules_install &&
cp /boot/$KERNEL /boot/$KERNEL-last &&
cp -v arch/i386/boot/bzImage /boot/$KERNEL &&
cp -v System.map /boot/System.map-$VERSION &&
cp /boot/$CONFIG /boot/$CONFIG-last &&
cp -v .config /boot/$CONFIG &&
install -d /usr/share/doc/linux &&
cp -r Documentation/* /usr/share/doc/linux