Commit graph

19 commits

Author SHA1 Message Date
Julian Stecklina 0854793542 coreboot: make Ada support optional
Ada support keeps breaking due to gnat being in a somewhat poor state
in nixpkgs. As Ada support is only necessary for some Intel drivers
and these are generally not required for using coreboot in a VM, make
Ada support optional.
2022-08-23 13:33:50 +03:00
Julian Stecklina 4688d3efc8 coreboot: fix buildgcc patching
This seems to have been a copy'n'paste mistake. `$out` doesn't exist
at this point.
2022-08-22 08:38:27 +02:00
Adam Joseph f18e17b2d2 coreboot-toolchain: move patchShebangs outside of fetchgit
This commit fixes the issue described in detail in the commit message
of the previous commit.
2022-06-23 22:53:28 -07:00
Adam Joseph c41fc85e40 coreboot-toolchain: add allowedRequisites=[]
This commit exposes a bug in the coreboot-toolchain expression; if you
nix-build that expression at this commit and do not use subsituters,
you will get a failure like this:

error: output '/nix/store/nvswbzyl39ifpwswfvx132j2mys80ifr-coreboot' is not allowed to refer to the following paths:
         /nix/store/8ngciqnw8jzvyvbx00arkp05gvn5q6sq-libunistring-1.0
         /nix/store/p2r9ynirymj47x5m6y9pnq0lpssn4ahm-bash-5.1-p16
         /nix/store/rflgyvwcnmrql5wf8kchynmmq7raggvj-libidn2-2.3.2
         /nix/store/rszg7d581z3v3fwrak68ba2wv5lrckx7-glibc-2.34-115

The root cause of the bug is this line in
tools/misc/coreboot-toolchain/default.nix:

  sha256 = "073n8yid3v0l9wgwnrdqrlgzaj9mnhs33a007dgr7xq3z0iw3i52"

This hash covers the result of the fetchgit operation, including the
postFetch block.  The postFetch block runs patchShebangs, which writes
the store-path of ${stdenv.shell} into $out/util/crossgcc/buildgcc
*before* computing its hash.

The next commit after this one fixes the bug by moving patchShebangs
out of the postFetch block, so it happens *after* the hash is
computed.

Note that even without allowedRequisites=[], the state of the code
prior to this commit is problematic.  Because it hardcodes the
store-path of stdenv, the expression will break in these situations:

* Building on a platform other than x86_64-linux, since those
  platforms will have a different boostrap-files store-path and
  therefore a different stdenv store-path.

* Building with an overlay which adds -march= or other compiler flag
  customizations to stdenv.

* Future nixpkgs users if nixpkgs commits any change which influences
  the store-path of stdenv.

So we should fix the problem in any event.  The `allowedRequisites=[]`
added by this commit ensures that the problem will be noticed
immediately if it recurs in the future.
2022-06-23 22:53:28 -07:00
Felix Singer 953c9a5d6e coreboot-toolchain: 4.15 -> 4.16
Signed-off-by: Felix Singer <felixsinger@posteo.net>
2022-02-26 23:02:27 +01:00
Felix Singer c1cb95b421 coreboot-toolchain: Fix update script
coreboot-toolchain is a package set now and contains the toolchains for
various platforms. Thus, fix the update script by renaming the package
name to `coreboot-toolchain.i386`.

Signed-off-by: Felix Singer <felixsinger@posteo.net>
2022-02-26 04:43:11 +01:00
Andreas Rammhold 3cd5413447
coreboot-toolchain: refactor the package set structure
Previously we were unable to override individual attributes within the
coreboot-toolchain packageset. By using callPackage on each of the
attributes individually we retain the ability to call the override
function to inject custom dependencies into the build.
2021-11-24 00:25:56 +01:00
Felix Singer bcbc7c0f21 coreboot-toolchain: Add other target architectures
Add the following target architectures:
  * x86_64
  * arm
  * aarch64
  * riscv
  * ppc64
  * nds32le

Signed-off-by: Felix Singer <felixsinger@posteo.net>
2021-11-20 02:18:10 +01:00
Felix Singer 8002a4a133 coreboot-toolchain: Allow adding new architectures
Rework package so that new target architectures can be added and reuse
common configurations.

Signed-off-by: Felix Singer <felixsinger@posteo.net>
2021-11-20 02:18:05 +01:00
Felix Singer 0faf3230fb coreboot-toolchain: Improve reproducibility
For reproducibility, the toolchain build system appends a specific
version string to the usual version string of the tools. Before 4.15,
the build system used git for that at runtime and since the .git
directory is removed by the NixOS build system, the version string was
empty and resulted in `v_`.

Now, the toolchain build system prefers using the environment variable
`CROSSGCC_VERSION` if set. Thus, extract the version string in the
postFetch phase and set `CROSSGCC_VERSION` in the build phase.

Signed-off-by: Felix Singer <felixsinger@posteo.net>
2021-11-10 20:15:05 +01:00
Felix Singer ee2417a226 coreboot-toolchain: 4.14 -> 4.15
Update to latest release.

Signed-off-by: Felix Singer <felixsinger@posteo.net>
2021-11-10 19:39:12 +01:00
Felix Singer 60d1033025 coreboot-toolchain: Rework update script
Rework update script so that it needs to be run from the root directory
of nixpkgs and get rid of relative paths. Also, move the resulting file
`sources.nix` into the package directory.

Signed-off-by: Felix Singer <felixsinger@posteo.net>
2021-11-10 19:38:31 +01:00
Felix Singer 4e75ca5bae coreboot-toolchain: Disable fetching of submodules
Submodules are not needed. Thus, disable fetching of the submodules.

Signed-off-by: Felix Singer <felixsinger@posteo.net>
2021-11-10 19:05:19 +01:00
Sandro 3ae4c035be
coreboot-toolchain: minor cleanup 2021-10-11 15:17:05 +02:00
Felix Singer 0b2b0331f0 coreboot-toolchain: Use sources.nix generated by update.sh
Use sources.nix for all source files (except coreboot) generated by
update.sh.

Signed-off-by: Felix Singer <felixsinger@posteo.net>
2021-10-10 01:05:45 +02:00
Felix Singer 28383a922e 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>
2021-10-09 22:19:46 +02:00
Felix Singer cff7863c34 coreboot-toolchain: Use git repository as source
Signed-off-by: Felix Singer <felixsinger@posteo.net>
2021-10-09 19:39:54 +02:00
Felix Singer 6d7fd89453 coreboot-toolchain: Set pname instead of name
Set `pname` instead of `name` since `name` is derived from
`${pname}-${version}`.

Signed-off-by: Felix Singer <felixsinger@posteo.net>
2021-10-08 04:46:09 +02:00
Felix Singer f0b20bad9c coreboot-toolchain: Init at 4.14
Signed-off-by: Felix Singer <felixsinger@posteo.net>
2021-09-28 21:14:16 +02:00