diff options
Diffstat (limited to 'infra/corenix/pkgs/coreboot/update.sh')
-rwxr-xr-x | infra/corenix/pkgs/coreboot/update.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/infra/corenix/pkgs/coreboot/update.sh b/infra/corenix/pkgs/coreboot/update.sh new file mode 100755 index 000000000000..d73f21404cd7 --- /dev/null +++ b/infra/corenix/pkgs/coreboot/update.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env nix-shell +#!nix-shell --pure -i bash update-shell.nix + +set -xe + +cd "$(dirname "$0")/../.." + +export PATH="/nix/store/yhr5cl61hqqx12zgfq8i3pkg0diq9v5k-nix-update/bin:$PATH" +nix-update coreboot $@ + +src="$(nix-build --no-out-link -A coreboot.src)" +urls=$($src/util/crossgcc/buildgcc -u) + +echo '{ fetchurl }: [' > pkgs/coreboot/.files.nix.tmp + +for url in $urls +do + name="$(basename $url)" + hash="$(nix-prefetch-url "$url")" + + cat << EOF >> pkgs/coreboot/.files.nix.tmp + { + name = "$name"; + archive = fetchurl { + sha256 = "$hash"; + url = "$url"; + }; + } +EOF + +done + +echo ']' >> pkgs/coreboot/.files.nix.tmp +mv pkgs/coreboot/.files.nix.tmp pkgs/coreboot/files.nix |