• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2
3#
4# A simple script we are using to get the latest mainline kernel
5# tar ball
6#
7
8wget https://www.kernel.org/releases.json
9if [ $? -ne 0 ]; then
10	echo "Could not download kernel.org/releases.json"
11	exit 1
12fi
13
14VER=$(cat releases.json | python2.7 -c "import sys, json; print json.load(sys.stdin)['latest_stable']['version']")
15if [ $? -ne 0 ]; then
16	echo "Could not parse release.json"
17	exit 1
18fi
19
20if [ "z$VER" = "z" ]; then
21	echo "Could not determine latest release version"
22	exit 1
23fi
24
25MVER=$(echo $VER | cut -d. -f1)
26
27wget https://cdn.kernel.org/pub/linux/kernel/v"$MVER".x/linux-"$VER".tar.gz
28if [ $? -ne 0 ]; then
29	echo "Could not download $VER kernel version"
30	exit 1
31fi
32
33tar xf linux-"$VER".tar.gz
34if [ $? -ne 0 ]; then
35	echo "Could not untar kernel tar ball"
36	exit 1
37fi
38
39mv linux-"$VER" linux
40