X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?p=bin.git;a=blobdiff_plain;f=get-kernel;h=bd9b91691946e91ec97372b36f0d0692484b830b;hp=c4d9b92f92e975180e29df4eb41e950587414d7e;hb=bc9757d985d9ae06e9e7c25d5bfcd7c0557dd07d;hpb=88c7e302a60194f68bc1b6d20c1547b62e1436d3 diff --git a/get-kernel b/get-kernel old mode 100644 new mode 100755 index c4d9b92..bd9b916 --- a/get-kernel +++ b/get-kernel @@ -1,11 +1,15 @@ #! /bin/sh -e -VERSION=$1 -MAJOR=`expr $1 : '\(^[0-9]*\.[0-9]*\)'` +if [ -z "$1" ]; then + echo >&2 "No version specified, stopping." + exit 1 +fi + +VERSION="$1" +MAJOR="${1%.*}" rm -f linux -wget -c ftp://ftp.kernel.org/pub/linux/kernel/v$MAJOR/linux-$VERSION.tar.bz2 -tar xjvf linux-$VERSION.tar.bz2 -rm -f linux-$VERSION.tar.bz2 -mv linux linux-$VERSION -ln -s linux-$VERSION linux +wget -c "ftp://ftp.kernel.org/pub/linux/kernel/v$MAJOR/linux-$VERSION.tar.bz2" +tar xjvf "linux-$VERSION.tar.bz2" +mv linux "linux-$VERSION" +ln -s "linux-$VERSION" linux