#!/bin/bash # Changed to deal with the demise of bitkeeper base=`findlatestkernel | sed -e 's/^.*\/linux-//' -e 's/.tar.gz//'` echo "Checking for linux-$base (kernel.org)" if [ ! -d linux-$base ] then wget -c http://www.kernel.org/pub/linux/kernel/v2.6/linux-$base.tar.bz2 tar --bzip2 -xf linux-$base.tar.bz2 fi echo "Checking for linux-$base (kernel.org release candidates)" if [ ! -d linux-$base ] then wget -c http://www.kernel.org/pub/linux/kernel/v2.6/testing/linux-$base.tar.bz2 tar --bzip2 -xf linux-$base.tar.bz2 fi echo "Checking for linux-$base (final check)" if [ ! -d linux-$base ] then echo "Failed to get the base" exit 2 fi echo linux-$base > latest # And now the mm cset mmpatch=`wget http://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/$base/ -O - | grep mm | tail -1 | sed -e 's/^.*//' -e 's/\/<\/a>.*$//'` rm $mmpatch wget http://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/$base/$mmpatch/$mmpatch.bz2 bunzip2 $mmpatch.bz2 if [ -d linux-$mmpatch ] then echo "We already have the latest mm cset" else echo "Building latest mm cset" cp -R linux-$base linux-$mmpatch pwd=`pwd` cd linux-$mmpatch patch -p 1 < $pwd/$mmpatch cd $pwd echo linux-$mmpatch > latestmm fi