Merge pull request #245334 from K900/linux-firmware-oof
linux-firmware: fix build, add explicit revision
This commit is contained in:
commit
2e77718e44
3 changed files with 13 additions and 4 deletions
|
@ -11,7 +11,7 @@ stdenvNoCC.mkDerivation rec {
|
|||
version = source.version;
|
||||
|
||||
src = fetchzip {
|
||||
url = "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/snapshot/linux-firmware-${version}.tar.gz";
|
||||
url = "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/snapshot/linux-firmware-${source.revision}.tar.gz";
|
||||
hash = source.sourceHash;
|
||||
};
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# This file is autogenerated! Run ./update.sh to regenerate.
|
||||
{
|
||||
version = "unstable-2023-07-24";
|
||||
revision = "59fbffa9ec8e4b0b31d2d13e715cf6580ad0e99c";
|
||||
sourceHash = "sha256-WyO/+fxQljfo6OXLC8/BomGmKtUQaJ1Lt9V5Fdv172g=";
|
||||
outputHash = "sha256-wHWPSyqxP+MGmerbc2v/hclFFJ7qKCDsupK5GASjp8s=";
|
||||
}
|
||||
|
|
|
@ -6,13 +6,19 @@ repo="https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.gi
|
|||
|
||||
# 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)"
|
||||
revision="$(git ls-remote --refs --tags --sort refname "$repo" | tail -n1 | cut -f2 | cut -d '/' -f3)"
|
||||
version=$revision
|
||||
else
|
||||
version=$1
|
||||
revision=$1
|
||||
if [ -z "${2:-}" ]; then
|
||||
version="unstable-$(date "+%Y-%m-%d")"
|
||||
else
|
||||
version=$2
|
||||
fi
|
||||
fi
|
||||
|
||||
# step 2: prefetch the source tarball
|
||||
snapshotUrl="$repo/snapshot/linux-firmware-$version.tar.gz"
|
||||
snapshotUrl="$repo/snapshot/linux-firmware-$revision.tar.gz"
|
||||
hash="$(nix-prefetch-url --unpack "$snapshotUrl")"
|
||||
sriHash="$(nix --experimental-features nix-command hash to-sri "sha256:$hash")"
|
||||
|
||||
|
@ -20,6 +26,7 @@ sriHash="$(nix --experimental-features nix-command hash to-sri "sha256:$hash")"
|
|||
cat > source.nix << EOF
|
||||
{
|
||||
version = "$version";
|
||||
revision = "$revision";
|
||||
sourceHash = "$sriHash";
|
||||
outputHash = null;
|
||||
}
|
||||
|
@ -33,6 +40,7 @@ cat > source.nix << EOF
|
|||
# This file is autogenerated! Run ./update.sh to regenerate.
|
||||
{
|
||||
version = "$version";
|
||||
revision = "$revision";
|
||||
sourceHash = "$sriHash";
|
||||
outputHash = "$outHash";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue