Re: LUKS2 support in Guix

2024-03-03 Thread Fabio Natali
Hi Josselin,

Thanks for getting back to me.

On 2024-03-02, 22:23 +0100, Josselin Poiret  wrote:
> I have a patch locally upgrading Grub, but it's not in upstreaming
> shape yet and I haven't had much time to work on it recently.  I am
> running it though, and it's working quite well.  Would anyone be
> interested in cleaning it up and sending it upstream?

Sure, I'd be interested. Is it hosted anywhere public or do you want to
share it here or in PVT?

Thanks, Fabio.



Re: LUKS2 support in Guix

2024-03-03 Thread Fabio Natali
Hi Maxim,

On 2024-03-02, 22:08 -0500, Maxim Cournoyer  wrote:
> Is there something preventing us from updating GRUB to benefit from
> full LUKS2 support?

That I don't know.

There seems to be a patch that updates to GRUB 2.12 already, see other
message in this thread. If the patch can be made upstream-ready without
too much effort, that'd be the way to go - as opposed to amending the
manual.

Cheers, Fabio.



[PATCH 1/2] gnu: grub: Update to 2.12.

2024-03-03 Thread Josselin Poiret
From: Josselin Poiret 

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

Change-Id: I5d9ae3952b61b47418cb571fc0bcb5318e72
---
 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:
- ;; .
- (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))

[PATCH 2/2] gnu: grub: Modernize.

2024-03-03 Thread Josselin Poiret
From: Josselin Poiret 

* gnu/packages/bootloaders.scm (grub-minimal, grub-coreboot, grub-efi32, 
grub-hybrid): Use G-Exps.
(grub-efi): Use G-Exps.  Also use OVMF to test.

Change-Id: Ic9c73753004739d6027b8426eb46c114a6a31051
---
 gnu/packages/bootloaders.scm | 286 +++
 1 file changed, 152 insertions(+), 134 deletions(-)

diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 1327055484..39b98b0876 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -307,20 +307,18 @@ (define-public grub-minimal
 '(list "PYTHON=true"))
((#:tests? _ #t)
 #f)
-   ((#:phases phases '%standard-phases)
-`(modify-phases ,phases
-   (replace 'patch-stuff
- (lambda* (#:key native-inputs inputs #:allow-other-keys)
-   (substitute* "grub-core/Makefile.in"
- (("/bin/sh") (which "sh")))
-
-   ;; Make the font visible.
-   (copy-file (assoc-ref (or native-inputs inputs)
- "unifont")
-  "unifont.bdf.gz")
-   (system* "gunzip" "unifont.bdf.gz")
-
-   #t
+   ((#:phases phases #~%standard-phases)
+#~(modify-phases #$phases
+(replace 'patch-stuff
+  (lambda* (#:key native-inputs inputs #:allow-other-keys)
+(substitute* "grub-core/Makefile.in"
+  (("/bin/sh") (which "sh")))
+
+;; Make the font visible.
+(copy-file (assoc-ref (or native-inputs inputs)
+  "unifont")
+   "unifont.bdf.gz")
+(system* "gunzip" "unifont.bdf.gz")
 
 (define-public grub-coreboot
   (package
@@ -328,64 +326,64 @@ (define-public grub-coreboot
 (name "grub-coreboot")
 (synopsis "GRand Unified Boot loader (Coreboot payload version)")
 (arguments
- `(,@(substitute-keyword-arguments (package-arguments grub)
-   ((#:phases phases '%standard-phases)
-`(modify-phases ,phases
-   (add-before 'check 'disable-broken-tests
- (lambda _
-   (setenv "DISABLE_HARD_ERRORS" "1")
-   (setenv
-"XFAIL_TESTS"
-(string-join
- ;; TODO: All the tests below use grub shell
- ;; (tests/util/grub-shell.in), and here grub-shell uses
- ;; QEMU and a Coreboot image to run the tests. Since we
- ;; don't have a Coreboot package in Guix yet these tests
- ;; are disabled. See the Guix bug #64667 for more details
- ;; (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64667).
- (list
-  "pata_test"
-  "ahci_test"
-  "uhci_test"
-  "ehci_test"
-  "example_grub_script_test"
-  "ohci_test"
-  "grub_script_eval"
-  "grub_script_echo1"
-  "grub_script_test"
-  "grub_script_leading_whitespace"
-  "grub_script_echo_keywords"
-  "grub_script_vars1"
-  "grub_script_for1"
-  "grub_script_while1"
-  "grub_script_if"
-  "grub_script_comments"
-  "grub_script_functions"
-  "grub_script_continue"
-  "grub_script_break"
-  "grub_script_shift"
-  "grub_script_blockarg"
-  "grub_script_return"
-  "grub_script_setparams"
-  "grub_cmd_date"
-  "grub_cmd_sleep"
-  "grub_cmd_regexp"
-  "grub_script_not"
-  "grub_cmd_echo"
-  "grub_script_expansion"
-  "grub_script_gettext"
-  "grub_script_escape_comma"
-  "help_test"
-  "grub_script_strcmp"
-  "test_sha512sum"
-  "grub_cmd_tr"
-  "test_unset"
-  "file_filter_test")
- " "))
-   ((#:configure-flags flags
- ''())
-`(cons* "--with-platform=coreboot"
-,flags)))
+ (substitute-keyword-arguments (package-arguments grub)
+   ((#:phases phases #~%standard-phases)
+#~(modify-phases #$phases
+(add-before 'check 'disable-broken-tests
+  (lambda _
+(setenv "DISABLE_HARD_ERRORS" "1")
+(setenv
+ "XFAIL_TESTS"
+ (string-join
+  ;; TODO: All the

Re: Bugs and Patches---or rather, bugs or patches?

2024-03-03 Thread Josselin Poiret
Hi Felix,

Felix Lechner via "Development of GNU Guix and the GNU System
distribution."  writes:

> Hi,
>
> We track bugs and patches separately.  Does the distinction serve a
> purpose?  May I combine them?

What do you mean by tracking them separately and combining them?
They're on two different lists, right?  I don't like the separation
between both MLs, sure, but that's it.  What would be the pros/cons of
such a merge?

Best,
-- 
Josselin Poiret


signature.asc
Description: PGP signature


Re: cmake-build-system: build tests only if #:tests? is true?

2024-03-03 Thread Maxim Cournoyer
Hi Hartmut,

Hartmut Goebel  writes:

> Hi,
>
> I found an old and unfinished patch in my pile. It optimizes building
> with cmake by not building the test if "#:tests?" is false. (Basically
> it passes -DBUILD_TESTING=OFF/ON" depending on "#:tests?".)
>
> Is this of interest? Then I would take my time and finish the patch.

Yes, this looks like a neat improvement.

-- 
Thanks,
Maxim



Re: Bugs and Patches---or rather, bugs or patches?

2024-03-03 Thread Maxim Cournoyer
Hi,

Josselin Poiret  writes:

> Hi Felix,
>
> Felix Lechner via "Development of GNU Guix and the GNU System
> distribution."  writes:
>
>> Hi,
>>
>> We track bugs and patches separately.  Does the distinction serve a
>> purpose?  May I combine them?
>
> What do you mean by tracking them separately and combining them?
> They're on two different lists, right?  I don't like the separation
> between both MLs, sure, but that's it.  What would be the pros/cons of
> such a merge?

I like to be able to see a list of just reported bugs, without having to
use any filters.  Combining the trackers would make this impossible/more
difficult.

-- 
Thanks,
Maxim