Skip to content

Commit

Permalink
linux-firmware: 20230625 -> unstable-2023-07-24, sync with master
Browse files Browse the repository at this point in the history
This is a manual backport of #245305.
  • Loading branch information
K900 committed Jul 25, 2023
1 parent 5f8c787 commit beb6196
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
6 changes: 3 additions & 3 deletions pkgs/os-specific/linux/firmware/linux-firmware/source.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is autogenerated! Run ./update.sh to regenerate.
{
version = "20230625";
sourceHash = "sha256-olRaUVnCri/sJU6ob+QgNxEZF8GzVxxEh8zdNJIZlYY=";
outputHash = "sha256-zSlMpAPbW7ewEBzDre47/7NJyy2pC0GSbkyOVVi+4gU=";
version = "unstable-2023-07-24";
sourceHash = "sha256-WyO/+fxQljfo6OXLC8/BomGmKtUQaJ1Lt9V5Fdv172g=";
outputHash = "sha256-wHWPSyqxP+MGmerbc2v/hclFFJ7qKCDsupK5GASjp8s=";
}
15 changes: 10 additions & 5 deletions pkgs/os-specific/linux/firmware/linux-firmware/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,24 @@
set -euo pipefail
cd "$(dirname "$(readlink -f "$0")")" || exit

# step 1: figure out the latest version from the tags
repo="https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git"
latestTag="$(git ls-remote --refs --tags --sort refname "$repo" | tail -n1 | cut -f2 | cut -d '/' -f3)"

# step 1: figure out the latest version from the tags
if [ -z "${1:-}" ]; then
version="$(git ls-remote --refs --tags --sort refname "$repo" | tail -n1 | cut -f2 | cut -d '/' -f3)"
else
version=$1
fi

# step 2: prefetch the source tarball
snapshotUrl="$repo/snapshot/linux-firmware-$latestTag.tar.gz"
snapshotUrl="$repo/snapshot/linux-firmware-$version.tar.gz"
hash="$(nix-prefetch-url --unpack "$snapshotUrl")"
sriHash="$(nix --experimental-features nix-command hash to-sri "sha256:$hash")"

# step 3: rebuild as a non-FO derivation to get the right hash
cat > source.nix << EOF
{
version = "$latestTag";
version = "$version";
sourceHash = "$sriHash";
outputHash = null;
}
Expand All @@ -27,7 +32,7 @@ outHash="$(nix --experimental-features nix-command hash path "$outPath")"
cat > source.nix << EOF
# This file is autogenerated! Run ./update.sh to regenerate.
{
version = "$latestTag";
version = "$version";
sourceHash = "$sriHash";
outputHash = "$outHash";
}
Expand Down

0 comments on commit beb6196

Please sign in to comment.