#!/bin/sh # # A simple script we are using to get the latest mainline kernel # tar ball # wget https://www.kernel.org/releases.json if [ $? -ne 0 ]; then echo "Could not download kernel.org/releases.json" exit 1 fi VER=$(cat releases.json | python2.7 -c "import sys, json; print json.load(sys.stdin)['latest_stable']['version']") if [ $? -ne 0 ]; then echo "Could not parse release.json" exit 1 fi if [ "z$VER" = "z" ]; then echo "Could not determine latest release version" exit 1 fi MVER=$(echo $VER | cut -d. -f1) wget https://cdn.kernel.org/pub/linux/kernel/v"$MVER".x/linux-"$VER".tar.gz if [ $? -ne 0 ]; then echo "Could not download $VER kernel version" exit 1 fi tar xf linux-"$VER".tar.gz if [ $? -ne 0 ]; then echo "Could not untar kernel tar ball" exit 1 fi mv linux-"$VER" linux