summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <me@tobias.gr>2022-10-23 02:00:00 +0200
committerTobias Geerinckx-Rice <me@tobias.gr>2022-10-23 02:00:06 +0200
commit68f4b7a1585f71ccb1809cf808ad759f744438f3 (patch)
tree344b10e2a921670bf5eeb4672c660cd017da8f7a
parent634f7cd7dfef8746a39c2054d0ef9240a75d74d1 (diff)
gnu: memtest86+: Include a GRUB-based ISO image.
* gnu/packages/hardware.scm (memtest86+)[arguments]: Add a new 'patch-broken-Makefiles and custom 'build phase. Add "grub-memtest.iso" to the list of files to 'install. [native-inputs]: Add dosfstools, grub-hybrid, mtools, and xorriso.
-rw-r--r--gnu/packages/hardware.scm25
1 files changed, 24 insertions, 1 deletions
diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index 50ad9ff15f1..e72163616b6 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -38,6 +38,8 @@
38 #:use-module (gnu packages base) 38 #:use-module (gnu packages base)
39 #:use-module (gnu packages bash) 39 #:use-module (gnu packages bash)
40 #:use-module (gnu packages bison) 40 #:use-module (gnu packages bison)
41 #:use-module (gnu packages bootloaders)
42 #:use-module (gnu packages cdrom)
41 #:use-module (gnu packages compression) 43 #:use-module (gnu packages compression)
42 #:use-module (gnu packages check) 44 #:use-module (gnu packages check)
43 #:use-module (gnu packages cpp) 45 #:use-module (gnu packages cpp)
@@ -60,6 +62,7 @@
60 #:use-module (gnu packages libusb) 62 #:use-module (gnu packages libusb)
61 #:use-module (gnu packages linux) 63 #:use-module (gnu packages linux)
62 #:use-module (gnu packages lxqt) 64 #:use-module (gnu packages lxqt)
65 #:use-module (gnu packages mtools)
63 #:use-module (gnu packages package-management) 66 #:use-module (gnu packages package-management)
64 #:use-module (gnu packages ncurses) 67 #:use-module (gnu packages ncurses)
65 #:use-module (gnu packages networking) 68 #:use-module (gnu packages networking)
@@ -815,12 +818,29 @@ specific SMBIOS tables.")
815 #:tests? #f ; no way to test this 818 #:tests? #f ; no way to test this
816 #:phases 819 #:phases
817 #~(modify-phases %standard-phases 820 #~(modify-phases %standard-phases
821 (add-after 'unpack 'patch-broken-Makefiles
822 (lambda _
823 (substitute* (list "build32/Makefile"
824 "build64/Makefile")
825 (("/sbin/(mkdosfs)" _ command)
826 command))))
818 (delete 'configure) ; no configure script 827 (delete 'configure) ; no configure script
819 (add-before 'build 'enter-build-directory 828 (add-before 'build 'enter-build-directory
820 (lambda _ 829 (lambda _
821 (chdir #$(if (target-x86-32?) 830 (chdir #$(if (target-x86-32?)
822 "build32" 831 "build32"
823 "build64")))) 832 "build64"))))
833 (replace 'build
834 (lambda* (#:key inputs make-flags #:allow-other-keys)
835 (apply invoke
836 "make" "all" "grub-iso" ; more options than memtest.iso
837 (string-append "GRUB_FONT_DIR="
838 (search-input-directory inputs
839 "share/grub"))
840 (string-append "GRUB_LIB_DIR="
841 (search-input-directory inputs
842 "lib/grub"))
843 make-flags)))
824 (replace 'install 844 (replace 'install
825 (lambda* (#:key outputs #:allow-other-keys) 845 (lambda* (#:key outputs #:allow-other-keys)
826 (let* ((out (assoc-ref outputs "out")) 846 (let* ((out (assoc-ref outputs "out"))
@@ -830,10 +850,13 @@ specific SMBIOS tables.")
830 (for-each 850 (for-each
831 (lambda (file) 851 (lambda (file)
832 (install-file file lib)) 852 (install-file file lib))
833 (list "memtest.bin" 853 (list "grub-memtest.iso"
854 "memtest.bin"
834 "memtest.efi")) 855 "memtest.efi"))
835 (chdir "..") 856 (chdir "..")
836 (install-file "README.md" doc))))))) 857 (install-file "README.md" doc)))))))
858 (native-inputs
859 (list dosfstools grub-hybrid mtools xorriso))
837 (supported-systems (list "i686-linux" "x86_64-linux")) 860 (supported-systems (list "i686-linux" "x86_64-linux"))
838 (home-page "https://www.memtest.org/") 861 (home-page "https://www.memtest.org/")
839 (synopsis "Thorough real-mode memory tester") 862 (synopsis "Thorough real-mode memory tester")