Skip to content

Instantly share code, notes, and snippets.

@thefloweringash
Created February 15, 2020 13:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thefloweringash/ec9511da8c7f41f903eb530a68f7e30f to your computer and use it in GitHub Desktop.
Save thefloweringash/ec9511da8c7f41f903eb530a68f7e30f to your computer and use it in GitHub Desktop.
Hacky bootstrap test script
#!/usr/bin/env bash
set -euo pipefail
set -x
target="pkgs/stdenv/linux/bootstrap-files/armv7l.nix"
bootstrapToolsDist=$(
nix-build pkgs/top-level/release-cross.nix -A bootstrapTools.armv7l.dist
)
fetchOutput() {
local wanted="$1"
while read -r type name path; do
if [ "$name" == "$wanted" ]; then
echo "$path"
return 0
fi
done < "$bootstrapToolsDist/nix-support/hydra-build-products"
return 1
}
busybox=$(fetchOutput "busybox")
bootstrapTools=$(fetchOutput "tarball")
echo "{
bootstrapTools = $bootstrapTools;
busybox = $busybox;
}" > $target
nix-build --argstr system armv7l-linux -A hello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment