#!/bin/sh
echo "Linux kernel build menu, please select your choice:"
echo " 1 make distclean"
echo " 2 make default config"
echo " 3 make menuconfig"
echo " 4 make zImage and copy zImage to tftp dir"
echo " 5 make modules and install"
echo " 6 copy zImage to tftp dir"
echo " q exit"
DEF_CFG=m3250_defconfig
CC=/home/chenxibing/RTlinux/arm-2010q1/bin/arm-none-linux-gnueabi-
TFTPBOOT=/var/lib/tftpboot
make_distclean() {
echo "make distclean"
make ARCH=arm CROSS_COMPILE=$CC distclean
}
make_defconfig() {
echo "make default config"
make ARCH=arm CROSS_COMPILE=$CC $DEF_CFG
}
make_menuconfig() {
echo "make menuconfig"
make ARCH=arm CROSS_COMPILE=$CC menuconfig
}
make_kernel_copy() {
echo "make zImage and copy to tftp dir"
make ARCH=arm CROSS_COMPILE=$CC zImage
copy_zImage
}
make_modules() {
echo "make modules and install"
make ARCH=arm CROSS_COMPILE=$CC modules
sudo make ARCH=arm CROSS_COMPILE=$CC modules_install
}
copy_zImage() {
echo "copy zImage to tftp dir"
cp arch/arm/boot/zImage .
cp arch/arm/boot/zImage $TFTPBOOT
cp arch/arm/boot/zImage $TFTPBOOT/zImage-rt
}
read sel
echo "select $sel"
case $sel in
[1]) make_distclean;;
[2]) make_defconfig;;
[3]) make_menuconfig;;
[4]) make_kernel_copy;;
[5]) make_modules;;
[6]) copy_zImage;;
[q]) exit 0;;
*) echo "ONLY accept 1/2/3/4/5/6/q/Q"
esac