#!/bin/bash # This script build a custom Linux Kernel and matching modules. # This is used to build a kernel that run under IBM Netvista 2200 (8363). # Also patches the kernel binary, and copy kernel and modules # to a flash memory that is supposed to be already mounted under # /media/disk-5. Change this if you want. Media will be umounted after. # # usage: ./build-n2200-kernel linux-2.6.22-5 # The argument refers to a linux kernel source directory # # Antonio Cardoso Martins (digiplan.pt@gmail.com) if [ "$1" == "" ]; then echo "Argument missing!" exit fi cd $1 # Call xconfig for you to customize your kernel. Otherwise, provide a .config # file before calling this script. make xconfig make # cleanup rm arch/*86/boot/compressed/vmlinux make bzImage # Build and install modules (binaries will be in the modules sobdirectory # of your linux kernel source. Weird huh?) make modules make modules_install INSTALL_MOD_PATH=`pwd`/modules cd .. # Check if vmlinux has been created if [ -f $1/arch/*86/boot/compressed/vmlinux ]; then # Patch the Kernel ELF counter to be able to run in the N2200) ./patch-kernel $1/arch/*86/boot/compressed/vmlinux # Kernel and modules will be installed to final destination. # Adapt to your needs. (here is /media/disk-5). sudo cp $1/arch/*86/boot/compressed/vmlinux /media/disk-5/kernel.2x00 sudo cp -a $1/modules/* /media/disk-5/ sudo umount /media/disk-5 else echo "vmlinux file not found!" fi