#!/bin/sh
##########################################################################
#                    MAKE KERNEL v1.0 by k-s                             #
##########################################################################
# Description:                                                           #
#   This little script will compile your kernel, install modules, etc.   #
# CAUTION:                                                               #
#   vmlinuz and System.map will be send to /boot! and old files will be  #
#   renamed to vmlinuz-old and System.map-old.                           #
#   Change your configuration to that or change files before running:lilo#
# Instalation:                                                           #
#   Put this file in: /usr/src/linux                                     #
#   Change Permitions to eXecutable: chmod +x /usr/src/linux/make_kernel # 
# Use:                                                                   #
#   Run Config: make config/menuconfig/xconfig                           #
#   Run make_kernel. /usr/src/linux/make_kernel                          # 
##########################################################################

echo -e "\n[32;1m Making Dependences... [0m \n"
make dep
echo -e "\n[31;1m Dependences Made! [0m \n"
echo -e "\n Dependeces Made!" > /dev/tty12

echo -e "\n[32;1m Cleanning... [0m \n"
make clean
echo -e "\n[31;1m Cleanned! [0m \n"
echo -e "\n Cleanned!" > /dev/tty12

echo -e "\n[32;1m Making Kernel... [0m \n"
make bzImage
echo -e "\n[31;1m Kernel Made! [0m \n"
echo -e "\n Kernel Made!" > /dev/tty12

echo -e "\n[32;1m Making zlilo [0m \n"
make bzlilo
echo -e "\n[31;1m zlilo  Made! [0m \n"

echo -e "\n[32;1m Making Modules [0m \n"
make modules
echo -e "\n[31;1m Modules Made! [0m \n"
echo -e "\n Modules Made!" > /dev/tty12

echo -e "\n[32;1m Installing Modules... [0m \n"
make modules_install
echo -e "\n[31;1m Modules Installed! [0m \n"
echo -e "\n Modules Installed!" > /dev/tty12

# Making a Back Up Copy
mv -f /boot/System.map /boot/System.map-old
mv -f /boot/vmlinuz /boot/vmlinuz-old
# Puting into correct dir
mv -f /System.map /boot/System.map
mv -f /vmlinuz /boot/vmlinuz
# REactivating Lilo
lilo

echo -e "\n\n [1m-------- - [36mmake_kernel [0;1m- -------- "
echo -e "                k-s                [0m"
