linux/update.sh: update linux-libre too
update-libre.sh doesn't commit by default so that it can be used as an updateScript, where I don't think auto-committing is the norm. The generated commit messages say "linux-libre_latest" rather than "linux-libre", because even though linux-libre will also be rebuilt, it's linux-libre_latest that is more likely to need it.
This commit is contained in:
parent
821ff387da
commit
80a823eeca
@ -1,9 +1,6 @@
|
|||||||
{ stdenv, lib, fetchsvn, linux
|
{ stdenv, lib, fetchsvn, linux
|
||||||
, scripts ? fetchsvn {
|
, scripts ? fetchsvn {
|
||||||
url = "https://www.fsfla.org/svn/fsfla/software/linux-libre/releases/branches/";
|
url = "https://www.fsfla.org/svn/fsfla/software/linux-libre/releases/branches/";
|
||||||
|
|
||||||
# Update this if linux_latest-libre fails to build.
|
|
||||||
# $ curl https://www.fsfla.org/svn/fsfla/software/linux-libre/releases/branches/ | grep -Eo 'Revision [0-9]+'
|
|
||||||
rev = "16794";
|
rev = "16794";
|
||||||
sha256 = "1lpaka4hs7yrpnrzfybd6radjylwvw2p4aly68pypykqs2srvm7j";
|
sha256 = "1lpaka4hs7yrpnrzfybd6radjylwvw2p4aly68pypykqs2srvm7j";
|
||||||
}
|
}
|
||||||
|
26
pkgs/os-specific/linux/kernel/update-libre.sh
Executable file
26
pkgs/os-specific/linux/kernel/update-libre.sh
Executable file
@ -0,0 +1,26 @@
|
|||||||
|
#! /usr/bin/env nix-shell
|
||||||
|
#! nix-shell -i bash -p nix-prefetch-svn git curl
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
nixpkgs="$(git rev-parse --show-toplevel)"
|
||||||
|
path="$nixpkgs/pkgs/os-specific/linux/kernel/linux-libre.nix"
|
||||||
|
|
||||||
|
old_rev="$(grep -o 'rev = ".*"' "$path" | awk -F'"' '{print $2}')"
|
||||||
|
|
||||||
|
svn_url=https://www.fsfla.org/svn/fsfla/software/linux-libre/releases/branches/
|
||||||
|
rev="$(curl -s "$svn_url" | grep -Em 1 -o 'Revision [0-9]+' | awk '{print $2}')"
|
||||||
|
|
||||||
|
if [ "$old_rev" = "$rev" ]; then
|
||||||
|
echo "No updates for linux-libre"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
sha256="$(QUIET=1 nix-prefetch-svn "$svn_url" "$rev" | tail -1)"
|
||||||
|
|
||||||
|
sed -i -e "s/rev = \".*\"/rev = \"$rev\"/" \
|
||||||
|
-e "s/sha256 = \".*\"/sha256 = \"$sha256\"/" "$path"
|
||||||
|
|
||||||
|
if [ -n "$COMMIT" ]; then
|
||||||
|
git commit -qm "linux-libre_latest: $old_rev -> $rev" "$path"
|
||||||
|
echo "Updated linux-libre_latest $old_rev -> $rev"
|
||||||
|
fi
|
@ -57,3 +57,6 @@ ls $NIXPKGS/pkgs/os-specific/linux/kernel | while read FILE; do
|
|||||||
|
|
||||||
echo "Updated $OLDVER -> $V"
|
echo "Updated $OLDVER -> $V"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Update linux-libre
|
||||||
|
COMMIT=1 $NIXPKGS/pkgs/os-specific/linux/kernel/update-libre.sh
|
||||||
|
Loading…
x
Reference in New Issue
Block a user