#!/bin/bash KERNELNAME="linux-2.6.12" KERNELPKG="linux-2.6.12.tar.bz2" KERNELPATCHPKG="patch-2.6.13-rc4.bz2" #MMPKG="2.6.10-mm1.bz2" RPPKG="realtime-preempt-2.6.13-rc4-RT-V0.7.52-10" RTLSMPKG="realtime_lsm.patch" KERNELSRCDIR="http://kernel.org/pub/linux/kernel/v2.6/" KERNELPATCHSRCDIR="http://kernel.org/pub/linux/kernel/v2.6/testing/" #MMSRCDIR="http://kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.10/2.6.10-mm1/" RPSRCDIR="http://redhat.com/~mingo/realtime-preempt/" RPSRCDIRALT="http://redhat.com/~mingo/realtime-preempt/older/" RTLSMSRCDIR="http://affenbande.org/~tapas/" #are we done already? echo if [ -e $KERNELNAME-$RPPKG ] then echo patched tree $KERNELNAME-$RPPKG already existing? bailing out.. exit fi echo echo getting $KERNELSRCDIR$KERNELPKG if [ -e $KERNELPKG ] then echo file already exists else wget $KERNELSRCDIR$KERNELPKG fi if [ -e $KERNELPKG ] then true else echo still missing $KERNELPKG - bye bye exit fi echo echo getting $KERNELPATCHSRCDIR$KERNELPATCHPKG if [ -e $KERNELPATCHPKG ] then echo file already exists else wget $KERNELPATCHSRCDIR$KERNELPATCHPKG fi if [ -e $KERNELPATCHPKG ] then true else echo still missing $KERNELPATCHPKG - bye bye exit fi #echo #echo getting $MMSRCDIR$MMPKG #if [ -e $MMPKG ] #then # echo file already exists #else # wget $MMSRCDIR$MMPKG #fi #if [ -e $MMPKG ] #then # true #else # echo still missing $MMPKG - bye bye # exit #fi echo echo getting $RPSRCDIR$RPPKG if [ -e $RPPKG ] then echo file already exists else if wget $RPSRCDIR$RPPKG then true else echo patch outdated? trying "older/" dir for $RPPKG wget $RPSRCDIRALT$RPPKG fi fi if [ -e $RPPKG ] then true else echo still missing $RPPKG - bye bye exit fi echo echo getting $RTLSMSRCDIR$RTLSMPKG if [ -e $RTLSMPKG ] then echo file already exists else wget $RTLSMSRCDIR$RTLSMPKG fi if [ -e $RTLSMPKG ] then true else echo still missing $RTLSMPKG - bye bye exit fi echo echo untarring $KERNELPKG - please wait [and then wait a little more] if [ -e $KERNELNAME ] then echo hmm, it seems a kernel dir seems to already exist. not untarring. exiting.. exit else tar xjf $KERNELPKG fi echo echo entering kernel source dir cd $KERNELNAME echo echo testing patch $KERNELPATCHPKG if cat ../$KERNELPATCHPKG |bunzip2 |patch -p1 -t --dry-run then echo dry run completed applying patch for real cat ../$KERNELPATCHPKG |bunzip2 |patch -p1 -t else echo something went wrong with $KERNELPATCHPKG. NOT applying for real. exiting exit fi #echo #echo testing patch $MMPKG #if cat ../$MMPKG |bunzip2 |patch -p1 -t --dry-run #then # echo dry run completed applying patch for real # cat ../$MMPKG |bunzip2 |patch -p1 -t #else # echo something went wrong with $MMPKG, NOT applying for real. exiting # exit #fi echo echo testing patch $RPPKG if cat ../$RPPKG |patch -p1 -t --dry-run then echo dry run completed applying patch for real cat ../$RPPKG |patch -p1 -t else echo something went wrong with $RPPKG, NOT applying for real. exiting exit fi echo echo testing patch $RTLSMPKG if cat ../$RTLSMPKG |patch -p1 -t --dry-run then echo dry run completed applying patch for real cat ../$RTLSMPKG |patch -p1 -t else echo something went wrong with $RTLSMPKG, NOT applying for real. exiting exit fi cd .. echo echo renaming kernel source dir to $KERNELNAME $KERNELNAME-$RPPKG mv $KERNELNAME $KERNELNAME-$RPPKG