coreboot-toolchain: Introduce script for generating sources file
Add and adjust update script from https://git.petabyte.dev/petabyteboy/corenix. The script is meant to be run from the package directory of the coreboot-toolchain. The script generates a sources.nix files, which contains all sources used for the coreboot toolchain and some other tools. Thus, it needs to be stripped down to the necessary sources. Signed-off-by: Felix Singer <felixsinger@posteo.net>
This commit is contained in:
parent
cff7863c34
commit
28383a922e
1 changed files with 31 additions and 0 deletions
31
pkgs/development/tools/misc/coreboot-toolchain/update.sh
Executable file
31
pkgs/development/tools/misc/coreboot-toolchain/update.sh
Executable file
|
@ -0,0 +1,31 @@
|
||||||
|
#!/usr/bin/env nix-shell
|
||||||
|
#!nix-shell --pure -i bash -p nix cacert git getopt
|
||||||
|
|
||||||
|
rootdir="../../../../../"
|
||||||
|
|
||||||
|
src="$(nix-build $rootdir --no-out-link -A coreboot-toolchain.src)"
|
||||||
|
urls=$($src/util/crossgcc/buildgcc -u)
|
||||||
|
|
||||||
|
tmp=$(mktemp)
|
||||||
|
echo '{ fetchurl }: [' > $tmp
|
||||||
|
|
||||||
|
for url in $urls; do
|
||||||
|
name="$(basename $url)"
|
||||||
|
hash="$(nix-prefetch-url "$url")"
|
||||||
|
|
||||||
|
cat << EOF >> $tmp
|
||||||
|
{
|
||||||
|
name = "$name";
|
||||||
|
archive = fetchurl {
|
||||||
|
sha256 = "$hash";
|
||||||
|
url = "$url";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
done
|
||||||
|
|
||||||
|
echo ']' >> $tmp
|
||||||
|
|
||||||
|
sed -ie 's/https\:\/\/ftpmirror\.gnu\.org/mirror\:\/\/gnu/g' $tmp
|
||||||
|
|
||||||
|
mv $tmp sources.nix
|
Loading…
Reference in a new issue