#!/bin/sh # $Revision: 1.10 $ # # This file contain ALL todos after kernel changes! # So it is possible for me to remember what I have done to the kernel # and what I have todo to the kernel and additional modules # # so after 'make menuconfig' I must only start 'machkernel' reboot and machkernel, reboot again! # nothing else. # This tool works only within the 2.4.X kernel # # I don't need to remember to set up lilo or grub # alsa # vpn # webcam driver # hpt37x driver # backup kernel, install a nice new console font. # cd /usr/src/linux MACHMODULES=/tmp/.machmodules KERNELVER=`uname -r | cut -b 1-3` # 2.4 for old kernel 2.4 CURRENT_HOSTNAME=`hostname -f` if [ -e $MACHMODULES ]; then if [ "$CURRENT_HOSTNAME" = "moon.linux.bogus" ]; then # build hpt driver, and copy to the right destination echo "### Create hpt370 driver" cd /usr/src/hpt370 make clean make HPT_DRIVER_DESC=/lib/modules/`uname -r`/kernel/drivers/scsi/ echo "### install the driver" cp hpt37x2.o $HPT_DRIVER_DESC # this is not right here, because we need to reboot before this depmod -a if [ -e /etc/fstab.boot_no_sdx ]; then if [ -e /etc/fstab.orig.machkernel ]; then echo "##### restore old /etc/fstab" cp /etc/fstab.orig.machkernel /etc/fstab rm -f /etc/fstab.orig.machkernel # mount -a fi else echo "##### fstab.boot_no_sdx does not exist, please create one " echo "##### cp /etc/fstab and remove all drives which need hpt37x drivers" echo "##### /dev/sdX at the moment." fi fi # LLA: at the moment I use build in OSS Driver for ESS1688 Sound Card (works very well) if [ "$CURRENT_HOSTNAME" = "lemur.linux.bogus" ]; then echo "### Build sound module new" # make sound modules # cd ../sound/alsa_09/alsa-driver-0.9.0rc6 # ./build # cd - export ALSA_CARDS='emu10k1' emerge alsa-driver # emerge alsa-oss # ov511 if [ -d /usr/src/ov511-1.65 ]; then echo "create OV511..." cd /usr/src/ov511-1.65 make clean make make install-2.4 fi fi if [ "$CURRENT_HOSTNAME" = "sputnik.linux.bogus" ]; then echo "### Build sound module new" # make sound modules # cd ../sound/alsa_09/alsa-driver-0.9.0rc6 # ./build # cd - export ALSA_CARDS='intel8x0' emerge alsa-driver # LLA: is not necessary # emerge alsa-oss # if we are on sputnik, create also vpn5k # LLA: 20040901 vpn5k is no longer active, use vpn3k # if [ -d /usr/src/vpn/COMPvpn ]; then # echo "create VPN5k..." # cd /usr/src/vpn/COMPvpn # ./build # fi if [ -d /usr/src/vpnclient ]; then echo "create VPN3k..." cd /usr/src/vpnclient if [ -e build ]; then ./build else echo "SORRY, NO BUILD SCRIPT FOUND. (SELFMADE BY LLA.)" fi fi # ov511 if [ -d /usr/src/ov511-1.65 ]; then echo "create OV511..." cd /usr/src/ov511-1.65 make clean make make install-2.4 fi fi if [ "$CURRENT_HOSTNAME" = "lla-1.germany.sun.com" ]; then echo "### Build sound module new" export ALSA_CARDS='intel8x0' # emerge alsa-driver emerge alsa-driver emerge alsa-oss fi rm -f $MACHMODULES else if [ "$KERNELVER" = "2.4" ]; then # old kernel 2.4 # patch the kernel echo "Patch kernel" MD5FONT=`md5sum ../backup_linux/drivers/video/font_8x16.c | cut -b 1-32` MD5FONT2=`md5sum drivers/video/font_8x16.c | cut -b 1-32` echo "$MD5FONT" echo "$MD5FONT2" if [ "$MD5FONT" != "$MD5FONT2" ]; then echo "install new console font." cp ../backup_linux/drivers/video/font_8x16.c drivers/video/ else echo "font already patched." fi make dep make bzImage make modules make modules_install else if [ "$KERNELVER" = "2.6" ]; then # new kernel 2.6 make make modules_install fi fi echo "### Mount filesystem, create backup, copy new kernel." if [ ! -e /boot/grub ]; then mount /boot sleep 5 fi echo "Check for grub on host: $CURRENT_HOSTNAME" GRUB="no" echo "sputnik:" if [ "$CURRENT_HOSTNAME" = "sputnik.linux.bogus" ]; then GRUB="yes" fi echo "lemur:" if [ "$CURRENT_HOSTNAME" = "lemur.linux.bogus" ]; then GRUB="yes" fi echo "lla-1:" if [ "$CURRENT_HOSTNAME" = "lla-1.germany.sun.com" ]; then GRUB="yes" fi if [ "$GRUB" = "yes" ]; then # grub echo "Grub config" mv /boot/bzImage /boot/bzImage.`date +%Y%m%d` cp /usr/src/linux/arch/i386/boot/bzImage /boot else echo "Grub install: $GRUB" fi if [ "$CURRENT_HOSTNAME" = "moon.linux.bogus" ]; then # lilo echo "Lilo config" mv /boot/bzImage_lilo /boot/bzImage_lilo.`date +%Y%m%d` cp /usr/src/linux/arch/i386/boot/bzImage /boot/bzImage_lilo /sbin/lilo # HACK for hpt37x drivers if [ -e /etc/fstab.boot_no_sdx ]; then cp /etc/fstab /etc/fstab.orig.machkernel cp /etc/fstab.boot_no_sdx /etc/fstab else echo "##### fstab.boot_no_sdx does not exist, please do not reboot without " echo "##### change your /etc/fstab, or reboot will fail." fi fi # Gentoo hack, this hinder gentoo at boot time for massiv checks echo "Use /fastboot, gentoo boot trick" touch /fastboot echo "helperfile, to switch /usr/local/bin/machkernel" >$MACHMODULES echo "please reboot..." echo "then start machkernel again" fi