Subject: [bug#67403] [PATCH 8/8] gnu: Add nvramtool.

From: Denis 'GNUtoo' Carikli <[email-masked]>
Date: Thu, 23 Nov 2023 16:27:44 +0100

* gnu/packages/flashing-tools.scm (nvramtool): New variable.

Signed-off-by: Denis 'GNUtoo' Carikli <[email-masked]>
Change-Id: I4f1391d51cf861b281abb0cf7d46022b50e70c4e
---
 gnu/packages/flashing-tools.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/gnu/packages/flashing-tools.scm b/gnu/packages/flashing-tools.scm
index 705fd76d6f..bf6726d40b 100644
--- a/gnu/packages/flashing-tools.scm
+++ b/gnu/packages/flashing-tools.scm
@@ -496,6 +496,34 @@ (define-public intelmetool
     ;; This is obviously an Intel thing, plus it requires <cpuid.h>.
     (supported-systems '("x86_64-linux" "i686-linux"))))
 
+(define-public nvramtool
+  (package
+    (name "nvramtool")
+    (version coreboot-version)
+    (source coreboot-source)
+    (build-system gnu-build-system)
+    (arguments
+     (list
+      #:make-flags
+      #~(list (string-append "CC=" #$(cc-for-target))
+              "INSTALL=install"
+              (string-append "PREFIX=" #$output))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'chdir
+            (lambda _
+              (chdir "util/nvramtool")))
+          (delete 'configure))           ; no configure script
+      #:tests? #f))                      ; no test suite
+    (home-page "https://coreboot.org")
+    (synopsis "Tool to read/write Coreboot settings")
+    (description "This package provides @command{nvramtool}.  It can list the
+available values for each Coreboot settings, read/write them, and restore
+their default values.  It also has lower level features like the ability to
+correct checksum if the settings data were corrupted, or ability to read/write
+individual bits in the CMOS memory holding the settings.")
+    (license license:gpl2)))
+
 (define-public me-cleaner
   (package
     (name "me-cleaner")
-- 
2.41.0