Skip to content

Instantly share code, notes, and snippets.

@toelke
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toelke/ef7771a91748ce0aa763 to your computer and use it in GitHub Desktop.
Save toelke/ef7771a91748ce0aa763 to your computer and use it in GitHub Desktop.
#!/bin/bash -exu
newest_base_version=$(curl -s -l ftp://ftp.kernel.org/pub/linux/kernel/projects/rt/ | sort -V | tail -n 1)
newest_patch_file=$(curl -s -l ftp://ftp.kernel.org/pub/linux/kernel/projects/rt/$newest_base_version/older/ | grep .patch.xz | sort -V | tail -n 1)
newest_version=$(echo $newest_patch_file | cut -d- -f2- | cut -d- -f1)
git fetch git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git refs/tags/v$newest_version:refs/tags/v$newest_version
git reset --hard v$newest_version
curl -s ftp://ftp.kernel.org/pub/linux/kernel/projects/rt/$newest_base_version/older/$newest_patch_file | xz -cd | patch -Np1
git add .
git commit -a -m 'rt'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment