diff options
| author | Jörg Thalheim <joerg@thalheim.io> | 2021-08-18 22:23:56 +0200 |
|---|---|---|
| committer | github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 2021-08-21 10:04:20 +0000 |
| commit | a0a2f6b6ef28330ea9a97c798688d0d3a8a465d5 (patch) | |
| tree | a67f8e834cbebf86c1c3da6eb41a15effd6ab06e | |
| parent | linuxPackages_zen: 5.13.9 -> 5.13.10-zen1 (diff) | |
| download | nixpkgs-origin/backport-134708-to-release-21.05.tar.gz | |
linux_zen: add update scriptorigin/backport-134708-to-release-21.05
(cherry picked from commit e4db1c88471229f71aa529ff388e490e087f2cfe)
| -rwxr-xr-x | pkgs/os-specific/linux/kernel/update-zen.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/kernel/update-zen.sh b/pkgs/os-specific/linux/kernel/update-zen.sh new file mode 100755 index 000000000000..1532d7be02b3 --- /dev/null +++ b/pkgs/os-specific/linux/kernel/update-zen.sh @@ -0,0 +1,21 @@ +#! /usr/bin/env nix-shell +#! nix-shell -I nixpkgs=../../../.. -i bash -p nix-prefetch git gnused gnugrep nix curl +set -euo pipefail -x + +nixpkgs="$(git rev-parse --show-toplevel)" +old=$(nix-instantiate --eval -A linuxPackages_zen.kernel.modDirVersion "$nixpkgs") +old="${old%\"}" +old="${old#\"}" +new=$(curl https://github.com/zen-kernel/zen-kernel/releases.atom | grep -m1 -o -E '[0-9.]+-zen[0-9]+') +if [[ "$new" == "$old" ]]; then + echo "already up-to-date" + exit 0 +fi + +path="$nixpkgs/pkgs/os-specific/linux/kernel/linux-zen.nix" + +sed -i -e "s!modDirVersion = \".*\"!modDirVersion = \"${new}\"!" "$path" +checksum=$(nix-prefetch "(import ${nixpkgs} {}).linuxPackages_zen.kernel") +sed -i -e "s!sha256 = \".*\"!sha256 = \"${checksum}\"!" "$path" + +git commit -m "linux_zen: ${old} -> ${new}" $path |
