unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Josselin Poiret <dev@jpoiret.xyz>
To: Fabio Natali <me@fabionatali.com>, Josselin Poiret <dev@jpoiret.xyz>
Cc: guix-devel@gnu.org, Oleg Pykhalov <go.wigust@gmail.com>,
	Felix Lechner <felix.lechner@lease-up.com>
Subject: [PATCH 1/2] gnu: grub: Update to 2.12.
Date: Sun,  3 Mar 2024 17:42:13 +0100	[thread overview]
Message-ID: <99fd518452f3d5c822f61de09d01e7393cda9369.1709484088.git.dev@jpoiret.xyz> (raw)
In-Reply-To: <87bk7vhett.fsf@fabionatali.com>

From: Josselin Poiret <dev@jpoiret.xyz>

* gnu/packages/bootloaders.scm (grub): Update to 2.12.

Change-Id: I5d9ae3952b61b47418cb5666671fc0bcb5318e72
---
 gnu/packages/bootloaders.scm | 182 ++++++++++++++++++++---------------
 1 file changed, 102 insertions(+), 80 deletions(-)

diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 986f0ac035..1327055484 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -103,94 +103,113 @@ (define unifont
 (define-public grub
   (package
     (name "grub")
-    (version "2.06")
+    (version "2.12")
     (source (origin
               (method url-fetch)
               (uri (string-append "mirror://gnu/grub/grub-" version ".tar.xz"))
               (sha256
                (base32
-                "1qbycnxkx07arj9f2nlsi9kp0dyldspbv07ysdyd34qvz55a97mp"))
+                "1ahgzvvvwdxx7rl08pv5dyqlgp76jxz0q2cflxvsdsn4yy8p7jgk"))
               (patches (search-patches
                         "grub-efi-fat-serial-number.patch"
-                        "grub-setup-root.patch"))
-              (modules '((guix build utils)))
-              (snippet
-               '(begin
-                  ;; Adjust QEMU invocation to not use a deprecated device
-                  ;; name that was removed in QEMU 6.0.  Remove for >2.06.
-                  (substitute* "tests/ahci_test.in"
-                    (("ide-drive")
-                     "ide-hd"))))))
+                        "grub-setup-root.patch"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:configure-flags
-       ;; Counterintuitively, this *disables* a spurious Python dependency by
-       ;; calling the ‘true’ binary instead.  Python is only needed during
-       ;; bootstrapping (for genptl.py), not when building from a release.
-       (list "PYTHON=true")
-       ;; Grub fails to load modules stripped with --strip-unneeded.
-       #:strip-flags '("--strip-debug" "--enable-deterministic-archives")
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'patch-stuff
-           (lambda* (#:key native-inputs inputs #:allow-other-keys)
-             (substitute* "grub-core/Makefile.in"
-               (("/bin/sh") (which "sh")))
-
-             ;; Give the absolute file name of 'mdadm', used to determine the
-             ;; root file system when it's a RAID device.  Failing to do that,
-             ;; 'grub-probe' silently fails if 'mdadm' is not in $PATH.
-             (when (assoc-ref inputs "mdadm")
-               (substitute* "grub-core/osdep/linux/getroot.c"
-                 (("argv\\[0\\] = \"mdadm\"")
-                  (string-append "argv[0] = \""
-                                 (assoc-ref inputs "mdadm")
-                                 "/sbin/mdadm\""))))
-
-             ;; Make the font visible.
-             (copy-file (assoc-ref (or native-inputs inputs)
-                                   "unifont")
-                        "unifont.bdf.gz")
-             (system* "gunzip" "unifont.bdf.gz")
-
-             ;; Give the absolute file name of 'ckbcomp'.
-             (substitute* "util/grub-kbdcomp.in"
-               (("^ckbcomp ")
-                (string-append
-                 (search-input-file inputs "/bin/ckbcomp")
-                 " ")))))
-         (add-after 'unpack 'set-freetype-variables
-           ;; These variables need to be set to the native versions of the
-           ;; dependencies because they are used to build programs which are
-           ;; executed during build time.
-           (lambda* (#:key native-inputs #:allow-other-keys)
-             (when (assoc-ref native-inputs "freetype")
-               (let ((freetype (assoc-ref native-inputs "freetype")))
-                 (setenv "BUILD_FREETYPE_LIBS"
-                         (string-append "-L" freetype
-                                        "/lib -lfreetype"))
-                 (setenv "BUILD_FREETYPE_CFLAGS"
-                         (string-append "-I" freetype
-                                        "/include/freetype2"))))))
-         (add-before 'check 'disable-flaky-test
-           (lambda _
-             ;; This test is unreliable. For more information, see:
-             ;; <https://bugs.gnu.org/26936>.
-             (substitute* "Makefile.in"
-               (("grub_cmd_date grub_cmd_set_date grub_cmd_sleep")
-                "grub_cmd_date grub_cmd_sleep"))))
-         (add-before 'check 'disable-pixel-perfect-test
-           (lambda _
-             ;; This test compares many screenshots rendered with an older
-             ;; Unifont (9.0.06) than that packaged in Guix.
-             (substitute* "Makefile.in"
-               (("test_unset grub_func_test")
-                "test_unset")))))
-       ;; Disable tests on ARM and AARCH64 platforms or when cross-compiling.
-       #:tests? ,(not (or (any (cute string-prefix? <> (or (%current-target-system)
-                                                           (%current-system)))
-                               '("arm" "aarch64"))
-                          (%current-target-system)))))
+     (list
+      #:configure-flags
+      ;; Counterintuitively, this *disables* a spurious Python dependency by
+      ;; calling the ‘true’ binary instead.  Python is only needed during
+      ;; bootstrapping (for genptl.py), not when building from a release.
+      ''("PYTHON=true")
+      ;; Grub fails to load modules stripped with --strip-unneeded.
+      #:strip-flags ''("--strip-debug" "--enable-deterministic-archives")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'add-missing-extra-deps
+            (lambda _
+              (call-with-output-file "grub-core/extra_deps.lst"
+                (lambda (port)
+                  (format port "depends bli part_gpt~%")))))
+          (add-after 'unpack 'patch-stuff
+            (lambda* (#:key native-inputs inputs #:allow-other-keys)
+              (substitute* "grub-core/Makefile.in"
+                (("/bin/sh") (which "sh")))
+
+              ;; Give the absolute file name of 'mdadm', used to determine the
+              ;; root file system when it's a RAID device.  Failing to do that,
+              ;; 'grub-probe' silently fails if 'mdadm' is not in $PATH.
+              (let ((mdadm (false-if-exception
+                            (search-input-file inputs "/sbin/mdadm"))))
+                (when mdadm
+                  (substitute* "grub-core/osdep/linux/getroot.c"
+                    (("argv\\[0\\] = \"mdadm\"")
+                     (string-append "argv[0] = \""
+                                    mdadm "\"")))))
+
+              ;; Make the font visible.
+              (copy-file (assoc-ref (or native-inputs inputs)
+                                    "unifont")
+                         "unifont.bdf.gz")
+              (system* "gunzip" "unifont.bdf.gz")
+
+              ;; Give the absolute file name of 'ckbcomp'.
+              (substitute* "util/grub-kbdcomp.in"
+                (("^ckbcomp ")
+                 (string-append
+                  (search-input-file inputs "/bin/ckbcomp")
+                  " ")))))
+          (add-after 'unpack 'set-freetype-variables
+            ;; These variables need to be set to the native versions of the
+            ;; dependencies because they are used to build programs which are
+            ;; executed during build time.
+            (lambda* (#:key native-inputs #:allow-other-keys)
+              (let ((freetype
+                     (false-if-exception
+                      (dirname
+                       (dirname
+                        (search-input-directory (or native-inputs inputs)
+                                                "/include/freetype2"))))))
+                (when freetype
+                  (setenv "BUILD_FREETYPE_LIBS"
+                          (string-append "-L" freetype
+                                         "/lib -lfreetype"))
+                  (setenv "BUILD_FREETYPE_CFLAGS"
+                          (string-append "-I" freetype
+                                         "/include/freetype2"))))))
+          (add-before 'check 'disable-flaky-test
+            (lambda _
+              (define* (skip-tests #:rest tests)
+                (for-each
+                 (lambda (s)
+                   (copy-file #$(program-file "skip-test.scm" #~(exit 77))
+                              s))
+                 tests))
+              ;; Rely on the built-in `command` instead of coreutils `which`.
+              (substitute*
+                  (cons*
+                   "tests/partmap_test.in"
+                   (map (lambda (s) (string-append "tests/" s "compress_test.in"))
+                        '("gz" "lzo" "xz")))
+                (("which")
+                 "command -v"))
+              (skip-tests
+               ;; This test is unreliable. For more information, see:
+               ;; <https://bugs.gnu.org/26936>.
+               "grub_cmd_set_date"
+               ;; This test compares many screenshots rendered with an older
+               ;; Unifont (9.0.06) than that packaged in Guix.
+               "grub_func_test"
+               ;; Theses tests require root, disable them for now.
+               "ext234_test" "squashfs_test" "iso9660_test" "hfsplus_test"
+               "ntfs_test" "reiserfs_test" "fat_test" "minixfs_test"
+               "xfs_test" "f2fs_test" "nilfs2_test" "romfs_test" "exfat_test"
+               "tar_test" "udf_test" "hfs_test" "jfs_test" "btrfs_test"
+               "zfs_test" "cpio_test" "luks1_test" "luks2_test"
+               "grub_cmd_cryptomount"))))
+      ;; Disable tests on ARM and AARCH64 platforms or when cross-compiling.
+      #:tests? (not (or (target-arm32?)
+                        (target-aarch64?)
+                        (%current-target-system)))))
     (inputs
      `(("gettext" ,gettext-minimal)
 
@@ -252,11 +271,14 @@ (define-public grub
 
        ;; Dependencies for the test suite.  The "real" QEMU is needed here,
        ;; because several targets are used.
+       ("gzip" ,gzip)
+       ("lzop" ,lzop)
        ("parted" ,parted)
        ,@(if (member (%current-system) (package-supported-systems qemu-minimal))
              `(("qemu" ,qemu-minimal))
              '())
-       ("xorriso" ,xorriso)))
+       ("xorriso" ,xorriso)
+       ("xz" ,xz)))
     (home-page "https://www.gnu.org/software/grub/")
     (synopsis "GRand Unified Boot loader")
     (description

base-commit: efdaa885b083e85bd380ca914addfcf32d0834f7
prerequisite-patch-id: 0804a38590177dfed12fd7a69a96c0bfed9b0991
prerequisite-patch-id: c55fab450e37b6202898b430c21597042e067d31
prerequisite-patch-id: 51b6fbcd8a513f1c644d0958811cf4731a0d8c5e
-- 
2.41.0



  reply	other threads:[~2024-03-03 16:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01  9:08 LUKS2 support in Guix Fabio Natali
2024-03-01 13:25 ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2024-03-02  7:41   ` Oleg Pykhalov
2024-03-02 12:45     ` Fabio Natali
2024-03-02 21:23       ` Josselin Poiret
2024-03-03  8:58         ` Fabio Natali
2024-03-03 16:42           ` Josselin Poiret [this message]
2024-03-03 16:42           ` [PATCH 2/2] gnu: grub: Modernize Josselin Poiret
2024-03-05  9:53             ` Fabio Natali
2024-03-09  9:42               ` Josselin Poiret
2024-03-11 14:47                 ` Fabio Natali
2024-03-03  3:08       ` LUKS2 support in Guix Maxim Cournoyer
2024-03-03  9:03         ` Fabio Natali

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=99fd518452f3d5c822f61de09d01e7393cda9369.1709484088.git.dev@jpoiret.xyz \
    --to=dev@jpoiret.xyz \
    --cc=felix.lechner@lease-up.com \
    --cc=go.wigust@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=me@fabionatali.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).