From 48723b7df38541ca31e20c7c44d4a99640ea9533 Mon Sep 17 00:00:00 2001 From: Jared Baur Date: Sun, 1 Sep 2024 07:21:33 -0700 Subject: [PATCH 1/4] coreboot-toolchain: 24.05 -> 24.08 --- .../tools/misc/coreboot-toolchain/default.nix | 4 ++-- .../tools/misc/coreboot-toolchain/stable.nix | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/development/tools/misc/coreboot-toolchain/default.nix b/pkgs/development/tools/misc/coreboot-toolchain/default.nix index 51d80b6df9ae..d1860dbc6bb5 100644 --- a/pkgs/development/tools/misc/coreboot-toolchain/default.nix +++ b/pkgs/development/tools/misc/coreboot-toolchain/default.nix @@ -19,12 +19,12 @@ let stdenvNoCC.mkDerivation (finalAttrs: { pname = "coreboot-toolchain-${arch}"; - version = "24.05"; + version = "24.08"; src = fetchgit { url = "https://review.coreboot.org/coreboot"; rev = finalAttrs.version; - hash = "sha256-jTfMFvl3sG3BIVVkpZ81BQ20Bs+2ESE6RMh0fW86rKE="; + hash = "sha256-G/O8wN7moawiG4nAWsYSfiU3gpYxMvPtyvkgkrTL62E="; fetchSubmodules = false; leaveDotGit = true; postFetch = '' diff --git a/pkgs/development/tools/misc/coreboot-toolchain/stable.nix b/pkgs/development/tools/misc/coreboot-toolchain/stable.nix index 6656e7822086..12759b03d9a2 100644 --- a/pkgs/development/tools/misc/coreboot-toolchain/stable.nix +++ b/pkgs/development/tools/misc/coreboot-toolchain/stable.nix @@ -21,10 +21,10 @@ }; } { - name = "gcc-13.2.0.tar.xz"; + name = "gcc-14.1.0.tar.xz"; archive = fetchurl { - sha256 = "1nj3qyswcgc650sl3h0480a171ixp33ca13zl90p61m689jffxg2"; - url = "mirror://gnu/gcc/gcc-13.2.0/gcc-13.2.0.tar.xz"; + sha256 = "0h3889kkfp9bzw8km9w1ssh5qjskg6yw02q8v3lkvzksk1acd0z2"; + url = "mirror://gnu/gcc/gcc-14.1.0/gcc-14.1.0.tar.xz"; }; } { @@ -42,10 +42,10 @@ }; } { - name = "nasm-2.16.01.tar.bz2"; + name = "nasm-2.16.03.tar.bz2"; archive = fetchurl { - sha256 = "0bmv8xbzck7jim7fzm6jnwiahqkprbpz6wzhg53irm28w0pavdim"; - url = "https://www.nasm.us/pub/nasm/releasebuilds/2.16.01/nasm-2.16.01.tar.bz2"; + sha256 = "0mwynbnn7c4ay4rpcsyp99j49sa6j3p8gk5pigwssqfdkcaxxwxy"; + url = "https://www.nasm.us/pub/nasm/releasebuilds/2.16.03/nasm-2.16.03.tar.bz2"; }; } ] From 9bd6b9c0e9a41cdde3203a1c37bb1dd530339cee Mon Sep 17 00:00:00 2001 From: Jared Baur Date: Sun, 1 Sep 2024 07:22:16 -0700 Subject: [PATCH 2/4] coreboot-utils: 24.05 -> 24.08 --- pkgs/tools/misc/coreboot-utils/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/coreboot-utils/default.nix b/pkgs/tools/misc/coreboot-utils/default.nix index 69be5edc3f64..f9e9b3607873 100644 --- a/pkgs/tools/misc/coreboot-utils/default.nix +++ b/pkgs/tools/misc/coreboot-utils/default.nix @@ -1,7 +1,7 @@ { lib, stdenv, fetchgit, pkg-config, zlib, pciutils, openssl, coreutils, acpica-tools, makeWrapper, gnugrep, gnused, file, buildEnv }: let - version = "24.05"; + version = "24.08"; commonMeta = { description = "Various coreboot-related tools"; @@ -17,7 +17,7 @@ let src = fetchgit { url = "https://review.coreboot.org/coreboot"; rev = version; - hash = "sha256-Fq3tZje6QoMskxqWd61OstgI9Sj25yijf8S3LiTJuYc="; + hash = "sha256-BwuoBuWKHTnSwV8ubm5NqcddgxP5OMXuTl3zmwwKEsg="; }; enableParallelBuilding = true; From dfd6da9083c87123287d3a0b60cd7287ceeb0479 Mon Sep 17 00:00:00 2001 From: Jared Baur Date: Sun, 1 Sep 2024 07:23:22 -0700 Subject: [PATCH 3/4] coreboot-toolchain: format nix files --- .../tools/misc/coreboot-toolchain/default.nix | 173 ++++++++++-------- .../tools/misc/coreboot-toolchain/stable.nix | 3 +- 2 files changed, 102 insertions(+), 74 deletions(-) diff --git a/pkgs/development/tools/misc/coreboot-toolchain/default.nix b/pkgs/development/tools/misc/coreboot-toolchain/default.nix index d1860dbc6bb5..29e90c031cb7 100644 --- a/pkgs/development/tools/misc/coreboot-toolchain/default.nix +++ b/pkgs/development/tools/misc/coreboot-toolchain/default.nix @@ -1,81 +1,108 @@ -{ stdenv, lib, callPackage }: +{ + stdenv, + lib, + callPackage, +}: let - common = arch: callPackage ( - { bison - , callPackage - , curl - , fetchgit - , flex - , getopt - , git - , gnat - , gcc - , lib - , perl - , stdenvNoCC - , zlib - , withAda ? true - }: + common = + arch: + callPackage ( + { + bison, + callPackage, + curl, + fetchgit, + flex, + getopt, + git, + gnat, + gcc, + lib, + perl, + stdenvNoCC, + zlib, + withAda ? true, + }: - stdenvNoCC.mkDerivation (finalAttrs: { - pname = "coreboot-toolchain-${arch}"; - version = "24.08"; + stdenvNoCC.mkDerivation (finalAttrs: { + pname = "coreboot-toolchain-${arch}"; + version = "24.08"; - src = fetchgit { - url = "https://review.coreboot.org/coreboot"; - rev = finalAttrs.version; - hash = "sha256-G/O8wN7moawiG4nAWsYSfiU3gpYxMvPtyvkgkrTL62E="; - fetchSubmodules = false; - leaveDotGit = true; - postFetch = '' - PATH=${lib.makeBinPath [ getopt ]}:$PATH ${stdenv.shell} $out/util/crossgcc/buildgcc -W > $out/.crossgcc_version - rm -rf $out/.git + src = fetchgit { + url = "https://review.coreboot.org/coreboot"; + rev = finalAttrs.version; + hash = "sha256-G/O8wN7moawiG4nAWsYSfiU3gpYxMvPtyvkgkrTL62E="; + fetchSubmodules = false; + leaveDotGit = true; + postFetch = '' + PATH=${lib.makeBinPath [ getopt ]}:$PATH ${stdenv.shell} $out/util/crossgcc/buildgcc -W > $out/.crossgcc_version + rm -rf $out/.git + ''; + allowedRequisites = [ ]; + }; + + nativeBuildInputs = [ + bison + curl + git + perl + ]; + buildInputs = [ + flex + zlib + (if withAda then gnat else gcc) + ]; + + enableParallelBuilding = true; + dontConfigure = true; + dontInstall = true; + + postPatch = '' + patchShebangs util/crossgcc/buildgcc + + mkdir -p util/crossgcc/tarballs + + ${lib.concatMapStringsSep "\n" (file: "ln -s ${file.archive} util/crossgcc/tarballs/${file.name}") ( + callPackage ./stable.nix { } + )} + + patchShebangs util/genbuild_h/genbuild_h.sh ''; - allowedRequisites = [ ]; - }; - nativeBuildInputs = [ bison curl git perl ]; - buildInputs = [ flex zlib (if withAda then gnat else gcc) ]; + buildPhase = '' + export CROSSGCC_VERSION=$(cat .crossgcc_version) + make crossgcc-${arch} CPUS=$NIX_BUILD_CORES DEST=$out + ''; - enableParallelBuilding = true; - dontConfigure = true; - dontInstall = true; - - postPatch = '' - patchShebangs util/crossgcc/buildgcc - - mkdir -p util/crossgcc/tarballs - - ${lib.concatMapStringsSep "\n" ( - file: "ln -s ${file.archive} util/crossgcc/tarballs/${file.name}" - ) (callPackage ./stable.nix { }) - } - - patchShebangs util/genbuild_h/genbuild_h.sh - ''; - - buildPhase = '' - export CROSSGCC_VERSION=$(cat .crossgcc_version) - make crossgcc-${arch} CPUS=$NIX_BUILD_CORES DEST=$out - ''; - - meta = with lib; { - homepage = "https://www.coreboot.org"; - description = "coreboot toolchain for ${arch} targets"; - license = with licenses; [ bsd2 bsd3 gpl2 lgpl2Plus gpl3Plus ]; - maintainers = with maintainers; [ felixsinger jmbaur ]; - platforms = platforms.linux; - }; - }) - ); + meta = with lib; { + homepage = "https://www.coreboot.org"; + description = "coreboot toolchain for ${arch} targets"; + license = with licenses; [ + bsd2 + bsd3 + gpl2 + lgpl2Plus + gpl3Plus + ]; + maintainers = with maintainers; [ + felixsinger + jmbaur + ]; + platforms = platforms.linux; + }; + }) + ); in -lib.listToAttrs (map (arch: lib.nameValuePair arch (common arch { })) [ - "i386" - "x64" - "arm" - "aarch64" - "riscv" - "ppc64" - "nds32le" -]) +lib.listToAttrs ( + map (arch: lib.nameValuePair arch (common arch { })) [ + "i386" + "x64" + "arm" + "aarch64" + "riscv" + "ppc64" + "nds32le" + ] +) + diff --git a/pkgs/development/tools/misc/coreboot-toolchain/stable.nix b/pkgs/development/tools/misc/coreboot-toolchain/stable.nix index 12759b03d9a2..fc20a1a3e7f8 100644 --- a/pkgs/development/tools/misc/coreboot-toolchain/stable.nix +++ b/pkgs/development/tools/misc/coreboot-toolchain/stable.nix @@ -1,4 +1,5 @@ -{ fetchurl }: [ +{ fetchurl }: +[ { name = "gmp-6.3.0.tar.xz"; archive = fetchurl { From 381643e81789111660f6877148cee6f2f5b23ee2 Mon Sep 17 00:00:00 2001 From: Jared Baur Date: Sun, 1 Sep 2024 07:24:35 -0700 Subject: [PATCH 4/4] coreboot-utils: format nix files --- pkgs/tools/misc/coreboot-utils/default.nix | 150 +++++++++++++++------ 1 file changed, 109 insertions(+), 41 deletions(-) diff --git a/pkgs/tools/misc/coreboot-utils/default.nix b/pkgs/tools/misc/coreboot-utils/default.nix index f9e9b3607873..82c0acd63f12 100644 --- a/pkgs/tools/misc/coreboot-utils/default.nix +++ b/pkgs/tools/misc/coreboot-utils/default.nix @@ -1,4 +1,19 @@ -{ lib, stdenv, fetchgit, pkg-config, zlib, pciutils, openssl, coreutils, acpica-tools, makeWrapper, gnugrep, gnused, file, buildEnv }: +{ + lib, + stdenv, + fetchgit, + pkg-config, + zlib, + pciutils, + openssl, + coreutils, + acpica-tools, + makeWrapper, + gnugrep, + gnused, + file, + buildEnv, +}: let version = "24.08"; @@ -6,42 +21,63 @@ let commonMeta = { description = "Various coreboot-related tools"; homepage = "https://www.coreboot.org"; - license = with lib.licenses; [ gpl2Only gpl2Plus ]; - maintainers = with lib.maintainers; [ felixsinger jmbaur ]; + license = with lib.licenses; [ + gpl2Only + gpl2Plus + ]; + maintainers = with lib.maintainers; [ + felixsinger + jmbaur + ]; platforms = lib.platforms.linux; }; - generic = { pname, path ? "util/${pname}", ... }@args: stdenv.mkDerivation ({ - inherit pname version; + generic = + { + pname, + path ? "util/${pname}", + ... + }@args: + stdenv.mkDerivation ( + { + inherit pname version; - src = fetchgit { - url = "https://review.coreboot.org/coreboot"; - rev = version; - hash = "sha256-BwuoBuWKHTnSwV8ubm5NqcddgxP5OMXuTl3zmwwKEsg="; - }; + src = fetchgit { + url = "https://review.coreboot.org/coreboot"; + rev = version; + hash = "sha256-BwuoBuWKHTnSwV8ubm5NqcddgxP5OMXuTl3zmwwKEsg="; + }; - enableParallelBuilding = true; + enableParallelBuilding = true; - postPatch = '' - substituteInPlace 3rdparty/vboot/Makefile --replace 'ar qc ' '$$AR qc ' - cd ${path} - patchShebangs . - ''; + postPatch = '' + substituteInPlace 3rdparty/vboot/Makefile --replace 'ar qc ' '$$AR qc ' + cd ${path} + patchShebangs . + ''; - makeFlags = [ - "INSTALL=install" - "PREFIX=${placeholder "out"}" - ]; + makeFlags = [ + "INSTALL=install" + "PREFIX=${placeholder "out"}" + ]; - meta = commonMeta // args.meta; - } // (removeAttrs args [ "meta" ])); + meta = commonMeta // args.meta; + } + // (removeAttrs args [ "meta" ]) + ); utils = { msrtool = generic { pname = "msrtool"; meta.description = "Dump chipset-specific MSR registers"; - meta.platforms = [ "x86_64-linux" "i686-linux" ]; - buildInputs = [ pciutils zlib ]; + meta.platforms = [ + "x86_64-linux" + "i686-linux" + ]; + buildInputs = [ + pciutils + zlib + ]; preConfigure = "export INSTALL=install"; }; cbmem = generic { @@ -55,8 +91,14 @@ let intelmetool = generic { pname = "intelmetool"; meta.description = "Dump interesting things about Management Engine"; - meta.platforms = [ "x86_64-linux" "i686-linux" ]; - buildInputs = [ pciutils zlib ]; + meta.platforms = [ + "x86_64-linux" + "i686-linux" + ]; + buildInputs = [ + pciutils + zlib + ]; }; cbfstool = generic { pname = "cbfstool"; @@ -70,20 +112,35 @@ let superiotool = generic { pname = "superiotool"; meta.description = "User-space utility to detect Super I/O of a mainboard and provide detailed information about the register contents of the Super I/O"; - meta.platforms = [ "x86_64-linux" "i686-linux" ]; - buildInputs = [ pciutils zlib ]; + meta.platforms = [ + "x86_64-linux" + "i686-linux" + ]; + buildInputs = [ + pciutils + zlib + ]; }; ectool = generic { pname = "ectool"; meta.description = "Dump the RAM of a laptop's Embedded/Environmental Controller (EC)"; - meta.platforms = [ "x86_64-linux" "i686-linux" ]; + meta.platforms = [ + "x86_64-linux" + "i686-linux" + ]; preInstall = "mkdir -p $out/sbin"; }; inteltool = generic { pname = "inteltool"; meta.description = "Provides information about Intel CPU/chipset hardware configuration (register contents, MSRs, etc)"; - meta.platforms = [ "x86_64-linux" "i686-linux" ]; - buildInputs = [ pciutils zlib ]; + meta.platforms = [ + "x86_64-linux" + "i686-linux" + ]; + buildInputs = [ + pciutils + zlib + ]; }; amdfwtool = generic { pname = "amdfwtool"; @@ -113,19 +170,30 @@ let ''; postFixup = '' wrapProgram $out/bin/acpidump-all \ - --set PATH ${lib.makeBinPath [ coreutils acpica-tools gnugrep gnused file ]} + --set PATH ${ + lib.makeBinPath [ + coreutils + acpica-tools + gnugrep + gnused + file + ] + } ''; }; }; in -utils // { - coreboot-utils = (buildEnv { - name = "coreboot-utils-${version}"; - paths = lib.filter (lib.meta.availableOn stdenv.hostPlatform) (lib.attrValues utils); - postBuild = "rm -rf $out/sbin"; - }) // { - inherit version; - meta = commonMeta; - }; +utils +// { + coreboot-utils = + (buildEnv { + name = "coreboot-utils-${version}"; + paths = lib.filter (lib.meta.availableOn stdenv.hostPlatform) (lib.attrValues utils); + postBuild = "rm -rf $out/sbin"; + }) + // { + inherit version; + meta = commonMeta; + }; }