From b94022525da632127d22ebd66afc84ed9a2335a6 Mon Sep 17 00:00:00 2001 From: Crabtux Date: Tue, 20 Feb 2024 17:37:12 +0800 Subject: util/nixshell: Add a dev shell for i386 arch Add a Nix shell file to provide a simple environment for coreboot development of i386 architecture. Currently, this environment is capable of completing Tutorial Part 1 in https://doc.coreboot.org. The Nix shell can be used by running the following command: $ nix-shell --pure util/nixshell/devshell-i386.nix The `--pure` parameter is optional. In Nixpkgs, there is a package called 'coreboot-toolchain'. It fetches the source code of coreboot, build crossgcc, and export it as output. With the binary cache mechanism of Nix, crossgcc can be directly downloaded and used without compiling on user's machine. This Nix shell has been tested on a NixOS laptop and a Debian 12 server, and they both work fine. Change-Id: Idcfe10be214e9bca590a62b8a207267493a4861f Signed-off-by: Crabtux Reviewed-on: https://review.coreboot.org/c/coreboot/+/80644 Tested-by: build bot (Jenkins) Reviewed-by: Felix Singer --- util/nixshell/devshell-i386.nix | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 util/nixshell/devshell-i386.nix diff --git a/util/nixshell/devshell-i386.nix b/util/nixshell/devshell-i386.nix new file mode 100644 index 0000000000..88a67dcef4 --- /dev/null +++ b/util/nixshell/devshell-i386.nix @@ -0,0 +1,29 @@ +with import {}; + +pkgs.mkShell { + name = "coreboot-devshell-i386"; + + packages = [ + cacert + gdb + git + qemu + ]; + + buildInputs = [ + ncurses + openssl + ]; + + nativeBuildInputs = [ + coreboot-toolchain.i386 + pkg-config + openssh + ]; + + shellHook = '' + # In Nix, stdenv sets a STRIP environment variable, which has conflict + # with libpayload/Makefile.payload. Unset the variable. + unset STRIP + ''; +} -- cgit v1.2.3