#! /bin/sh # ME="kbuild-install-local" # # script to perform superuser kernel instal on local machine # # Copyright (C) 2006 Grant Coady GPLv2 # information: # # what's this script do? # ``````````````````````` # companion script to kbuild-install, this script performs kernel install # to this machine by the superuser. # # this script is called from kbuild-install and works best if a custom # installkernel script installed at one of two locations, first match wins: # # 2.4 series: 2.6 series # ~/bin/installkernel ~/bin/${CROSS_COMPILE}installkernel # /sbin/installkernel /sbin/${CROSS_COMPILE}installkernel # # tested only for i386 targets (donations of other hardware welcome ;) # # 2006-06-01 # Add some commentary, now that this thing is functional echo -e "\n$ME" # perhaps remove old module files ready for install if [ -n "$1" ] && [ -d /lib/modules/$1 ] then rm -rf /lib/modules/$1 fi # perform the kernel and module install (required), note that if you use # the companion installkernel script you'll get these new files in /boot: # # config-$(uname -r) # bzImage-$(uname -r) # System.map-$(uname -r) # if [ -n "$2" ] then # quiet version echo "$ME: run 'make modules_install' quietly" INSTALL_MOD_STRIP=1 make modules_install >/dev/null || exit 1 echo "$ME: run 'make install' quietly" INSTALL_PATH="/boot" make install >/dev/null || exit else # noisy version INSTALL_MOD_STRIP=1 make modules_install || exit 1 INSTALL_PATH="/boot" make install || exit 1 fi # alter the following to suit your preferences # display most recent kernel version installed to check the build progressed # as expected (works with the PuTTY terminal I use) echo -en "most recently installed kernel: " ls -t /boot/bzImage-* | head -1 | cut -d- -f2- # check / modify lilo.conf then run lilo (alter this to suit yourself) # done here while in superuser mode echo -e "\nedit lilo" vim /etc/lilo.conf echo -e "\nrun lilo" lilo # offer reboot, this saves 'su -c reboot' asking for root password again reboot=n echo -en "\nReboot this machine now (y/N)? : " read reboot crap echo $reboot case $reboot in Y|y) reboot;; esac #exits back to normal user mode.