#!/bin/bash # -- This script uses Bash extensions # Local installation directly into /lib/modules and /boot. # Run this from your build directory # VERSION = 2 # PATCHLEVEL = 4 # SUBLEVEL = 2 # EXTRAVERSION = -ac3 # EXTRAVERSION =-ac3 # KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) # Unfortunately, these days we also have $(localver) # No workie because 1. spaces around '=', 2. line feeds are eaten # eval $(egrep "^VERSION *= *|^PATCHLEVEL *= *|^SUBLEVEL *= *|^EXTRAVERSION *= *" Makefile) readmakefile () { v=0 p=0 s=0 e=0 while read key equ val; do if [ $v = 1 -a $p = 1 -a $s = 1 -a $e = 1 ]; then break; fi # Woops, no space after the equal sign # if [[ "$val" == "" && "$equ" == '=?*' ]] <--- breaks on bash 3.0 if [ "$val" = "" -a "${equ:0:1}" = "=" ]; then val=${equ:1} equ="=" fi if [ "$equ" = "=" ]; then case "$key" in VERSION) VERSION="$val"; v=1 ;; PATCHLEVEL) PATCHLEVEL="$val"; p=1 ;; SUBLEVEL) SUBLEVEL="$val"; s=1 ;; EXTRAVERSION) EXTRAVERSION="$val"; e=1 ;; esac fi done echo ${VERSION}.${PATCHLEVEL}.${SUBLEVEL}${EXTRAVERSION} } # # main() # set -e KID=$(cat include/config/kernel.release) if [ -z "$KID" ]; then KID=$(readmakefile < Makefile) fi KARCH=$(readlink include/asm | awk -F- '{ print $2}') if [ "$KARCH" = "i386" ]; then ARCH=i386 elif [ "$KARCH" = "s390" ]; then ARCH=s390 elif [ "$KARCH" = "s390x" ]; then ARCH=s390 elif [ "$KARCH" = "x86_64" ]; then ARCH=x86_64 elif [ "$KARCH" = "x86" ]; then ARCH=i386 # Temporary. This works because it's not used below. else echo "Unknown architecture $KARCH" >&2 exit 1 fi if [ "$ARCH" = "s390" ]; then BOOTDIR=/mnt/data/zipl else BOOTDIR=/boot fi echo "Installing $KID ..." make modules_install echo "Copying $KID to $BOOTDIR for $KARCH ..." #if [ "$PATCHLEVEL" != "6" ]; then # Not needed on 2.6, we have kallsyms. # cp vmlinux $BOOTDIR/vmlinux-$KID #fi cp System.map $BOOTDIR/System.map-$KID if [ "$ARCH" = "s390" ]; then cp arch/$KARCH/boot/image $BOOTDIR/vmlinuz-$KID else cp arch/$KARCH/boot/bzImage $BOOTDIR/vmlinuz-$KID fi echo "Done with $KID"