[PATCH 0/3] gnu: grub: build from git source.

  • Open
  • quality assurance status badge
Details
One participant
  • Denis 'GNUtoo' Carikli
Owner
unassigned
Submitted by
Denis 'GNUtoo' Carikli
Severity
normal

Debbugs page

Denis 'GNUtoo' Carikli wrote on 11 Feb 18:05 +0100
(address . guix-patches@gnu.org)(name . Denis 'GNUtoo' Carikli)(address . GNUtoo@cyberdimension.org)
cover.1739292621.git.GNUtoo@cyberdimension.org
Hi,

GRUB is currently built from tarballs. This is not great because:

* gnulib is bundled in the tarball, and Guix even has code to un-bundle
Unicode from gnulib.

* it unlocks transformation options, to build GRUB from the latest commit for
instance.

Since GRUB is stuck on an older gnulib version, we have to package that, along
with its ucd-14.0.0 dependency.

So far I only built that package from source and I'll do more in depth runtime
testing in the next days, though I already tested an older version of this
patch set on real hardware (a ThinkPad X200) by building a Coreboot payload
with the grub-coreboot package.

I can also share and/or adapt the package that builds the payload I used if
necessary but I didn't include it yet in this patch set because it is very
specific to a given use case, and while the grub-coreboot package is supposed
to be reproducible, I've no idea yet if using that to build a payload can
result in a reproducible payload as the grub bootloader code inside Guix works
around some unreproducibility when creating grub images.

Denis 'GNUtoo' Carikli (3):
gnu: Add ucd-14.0.0.
gnu: Add gnulib-2022-02-12.
gnu: grub: build from git source.

gnu/local.mk | 1 +
gnu/packages/bootloaders.scm | 59 +++++++---
gnu/packages/build-tools.scm | 109 ++++++++++++++++++
.../patches/gnulib-2022-02-12-bootstrap.patch | 78 +++++++++++++
gnu/packages/unicode.scm | 13 +++
5 files changed, 247 insertions(+), 13 deletions(-)
create mode 100644 gnu/packages/patches/gnulib-2022-02-12-bootstrap.patch


base-commit: 555937448cc510517011035fbf39c3687336759d
--
2.46.0
Denis 'GNUtoo' Carikli wrote on 11 Feb 18:14 +0100
[PATCH 2/3] gnu: Add gnulib-2022-02-12.
(address . 76208@debbugs.gnu.org)(name . Denis 'GNUtoo' Carikli)(address . GNUtoo@cyberdimension.org)
90fd369df4be14b88fc620856aff63231a31a983.1739292621.git.GNUtoo@cyberdimension.org
* gnu/packages/build-tools.scm (gnulib-2022-02-12): New variable.
* gnu/packages/patches/gnulib-2022-02-12-bootstrap.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Register patch.

GRUB 2.12 depends on gnulib 9f48fb992a3d7e96610c4ce8be969cff2d61a01b
("filevercmp: fix several unexpected results"), as stated in the
bootstrap.conf in the GRUB source code.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Change-Id: I5c2c19aadfd0e6bf5303e10fbc602daa7dd0d0ff
---
gnu/local.mk | 1 +
gnu/packages/build-tools.scm | 109 ++++++++++++++++++
.../patches/gnulib-2022-02-12-bootstrap.patch | 78 +++++++++++++
3 files changed, 188 insertions(+)
create mode 100644 gnu/packages/patches/gnulib-2022-02-12-bootstrap.patch

Toggle diff (225 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 9e192f1e4f1..3b54cd60177 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1497,6 +1497,7 @@ dist_patch_DATA = \
%D%/packages/patches/gnome-session-support-elogind.patch \
%D%/packages/patches/gnome-tweaks-search-paths.patch \
%D%/packages/patches/gnulib-bootstrap.patch \
+ %D%/packages/patches/gnulib-2022-02-12-bootstrap.patch \
%D%/packages/patches/gnumach-version.patch \
%D%/packages/patches/gnupg-default-pinentry.patch \
%D%/packages/patches/gnupg-1-build-with-gcc10.patch \
diff --git a/gnu/packages/build-tools.scm b/gnu/packages/build-tools.scm
index 20fd7bafd8e..839018cd661 100644
--- a/gnu/packages/build-tools.scm
+++ b/gnu/packages/build-tools.scm
@@ -16,6 +16,7 @@
;;; Copyright © 2021, 2023, 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2022, 2023 Juliana Sims <juli@incana.org>
;;; Copyright © 2024 Evgeny Pisemsky <mail@pisemsky.site>
+;;; Copyright © 2025 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -988,6 +989,114 @@ (define-public gnulib
#:commit "ac4b301ae15223c98b51cd5a0eda2e2cf57c817b"
#:hash (base32 "0f4w56fc97clg13mmdghx84dh9xqmaqr3j672ppfh3h66gmmmvzs")))
+(define-public gnulib-2022-02-12
+ (let ((gnulib-2022-02-12-checkout
+ (gnulib-checkout
+ #:version "2022-02-12"
+ ;; from bootstrap.conf in GRUB source code
+ #:commit "9f48fb992a3d7e96610c4ce8be969cff2d61a01b"
+ #:hash
+ (base32 "1njf4y5sfysrshf6l4gjbn5k7k1lm698wrpc4fjw9acdlkmwadlv"))))
+ (package
+ (inherit gnulib-2022-02-12-checkout)
+ (source
+ (origin
+ (inherit (package-source gnulib-2022-02-12-checkout))
+ ;; The Guix path only affect the gnulib tools and not its
+ ;; unmodified source code.
+ (patches (search-patches "gnulib-2022-02-12-bootstrap.patch"))))
+ (arguments
+ (substitute-keyword-arguments
+ (package-arguments gnulib-2022-02-12-checkout)
+ ((#:install-plan base-plan)
+ #~'(("./gnulib-tool" "bin/")
+ ("./gnulib-tool.py" "bin/")
+ ("." "src/gnulib" #:exclude-regexp ("\\.git.*"))))
+ ((#:phases phases #~%standard-phases)
+ #~(modify-phases
+ #$phases
+ ;; The regenerate-unicode stage from gnulib-checkout in (gnu
+ ;; packages build-tools) passes an extra BidiMirroring.txt
+ ;; and this makes gen-uni-tables fails and print its help:
+ ;; Usage: ./gen-uni-tables UnicodeData.txt PropList.txt
+ ;; DerivedCoreProperties.txt emoji-data.txt
+ ;; ArabicShaping.txt Scripts.txt Blocks.txt
+ ;; PropList-3.0.1.txt EastAsianWidth.txt LineBreak.txt
+ ;; WordBreakProperty.txt GraphemeBreakProperty.txt
+ ;; CompositionExclusions.txt SpecialCasing.txt
+ ;; CaseFolding.txt version
+ (delete 'regenerate-unicode)
+ (add-before
+ 'check 'regenerate-unicode-without-bidi-mirroring
+ (lambda* (#:key inputs #:allow-other-keys)
+ (define (find-ucd-file name)
+ (search-input-file
+ inputs (string-append "share/ucd/" name)))
+ (define (find-ucd-files . names)
+ (map find-ucd-file names))
+ (with-directory-excursion
+ "lib"
+ ;; See the compile-command buffer-local variable in
+ ;; lib/gen-uni-tables.c
+ (invoke "gcc" "-O" "-Wall" "gen-uni-tables.c"
+ "-Iunictype" "-o" "gen-uni-tables")
+ (apply invoke
+ "./gen-uni-tables"
+ (append
+ (find-ucd-files
+ "UnicodeData.txt"
+ "PropList.txt"
+ "DerivedCoreProperties.txt"
+ "emoji/emoji-data.txt"
+ "ArabicShaping.txt"
+ "Scripts.txt"
+ "Blocks.txt")
+ (list #$(this-package-native-input "PropList.txt"))
+ (find-ucd-files
+ "EastAsianWidth.txt"
+ "LineBreak.txt"
+ "auxiliary/WordBreakProperty.txt"
+ "auxiliary/GraphemeBreakProperty.txt"
+ "CompositionExclusions.txt"
+ "SpecialCasing.txt"
+ "CaseFolding.txt")
+ (list
+ #$(package-version
+ (this-package-native-input "ucd")))))
+ (invoke "clisp" "-C" "uniname/gen-uninames.lisp"
+ (find-ucd-file "UnicodeData.txt")
+ "uniname/uninames.h"
+ (find-ucd-file "NameAliases.txt"))
+ (for-each
+ (match-lambda
+ ((ucd-file . directory)
+ (copy-file (find-ucd-file ucd-file)
+ (string-append "../tests/" directory "/"
+ (basename ucd-file)))))
+ '(("NameAliases.txt" . "uniname")
+ ("UnicodeData.txt" . "uniname")
+ ("NormalizationTest.txt" . "uninorm")
+ ("auxiliary/GraphemeBreakTest.txt" . "unigbrk")
+ ("auxiliary/WordBreakTest.txt" . "uniwbrk")))
+ (delete-file "gen-uni-tables"))))))))
+ (native-inputs
+ (list
+ bash-minimal
+ clisp
+ git
+ perl
+ python
+ ucd-14.0.0 ;; Unicode data:
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://www.unicode.org/Public/"
+ "3.0-Update1/PropList-3.0.1.txt"))
+ (file-name "PropList.txt")
+ (sha256
+ (base32
+ "0k6wyijyzdl5g3nibcwfm898kfydx1pqaz28v7fdvnzdvd5fz7lh"))))))))
+
(define-public pdpmake
(package
(name "pdpmake")
diff --git a/gnu/packages/patches/gnulib-2022-02-12-bootstrap.patch b/gnu/packages/patches/gnulib-2022-02-12-bootstrap.patch
new file mode 100644
index 00000000000..f9efc061be4
--- /dev/null
+++ b/gnu/packages/patches/gnulib-2022-02-12-bootstrap.patch
@@ -0,0 +1,78 @@
+From b1bd3c4201d7b7936980538e85ad026f9954adcf Mon Sep 17 00:00:00 2001
+From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
+Date: Thu, 30 May 2024 14:48:04 -0400
+Subject: [PATCH] bootstrap: Use gnulib-tool from PATH if available.
+
+Some distributions such as GNU Guix include in their package for
+gnulib a 'gnulib-tool' command under their $bindir
+prefix (e.g. '/bin') for users to use, along the unmodified full
+sources. The idea is that any wrapping or distribution modifications
+for the *execution* of the script at run time is done on these
+commands, while the rest of the source should be in their
+pristine (unmodified) version. Adjust the 'gnulib-tool' discovery
+mechanism to support such installation layout.
+
+* build-aux/bootstrap (autogen) <gnulib_tool>: Prefer to use from
+PATH, else from $GNULIB_SRCDIR/../../bin/gnulib-tool, else from
+$GNULIB_SRCDIR/gnulib-tool.
+* gnulib-tool.sh (func_gnulib_dir): Honor GNULIB_SRCDIR to locate
+gnulib's main directory.
+
+GNUtoo: Backport on top of the commit
+ 9f48fb992a3d7e96610c4ce8be969cff2d61a01b
+ ("filevercmp: fix several unexpected results").
+Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
+---
+ build-aux/bootstrap | 12 ++++++++++--
+ gnulib-tool | 6 +++++-
+ 2 files changed, 15 insertions(+), 3 deletions(-)
+
+diff --git a/build-aux/bootstrap b/build-aux/bootstrap
+index dc2238f4ad..93778a7020 100755
+--- a/build-aux/bootstrap
++++ b/build-aux/bootstrap
+@@ -1,6 +1,6 @@
+ #! /bin/sh
+ # Print a version string.
+-scriptversion=2022-01-26.05; # UTC
++scriptversion=2022-02-12.00; # UTC
+
+ # Bootstrap this package from checked-out sources.
+
+@@ -838,7 +838,15 @@ if $use_gnulib; then
+ }
+ fi
+
+- gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
++ gnulib_tool=$(command -v gnulib-tool)
++ if test -x "$gnulib_tool"; then
++ : # done
++ elif test -x $GNULIB_SRCDIR/../../bin/gnulib-tool; then
++ gnulib_tool=$GNULIB_SRCDIR/../../bin/gnulib-tool
++ else
++ gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
++ fi
++
+ <$gnulib_tool || exit $?
+ fi
+
+diff --git a/gnulib-tool b/gnulib-tool
+index 99854415ba..728430579b 100755
+--- a/gnulib-tool
++++ b/gnulib-tool
+@@ -486,7 +486,11 @@ func_gnulib_dir ()
+ * ) self_abspathname=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'`/"$linkval" ;;
+ esac
+ done
+- gnulib_dir=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'`
++ if test -n "$GNULIB_SRCDIR"; then
++ gnulib_dir=$GNULIB_SRCDIR
++ else
++ gnulib_dir=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'`
++ fi
+ }
+
+ # func_tmpdir
+--
+2.46.0
+
--
2.46.0
Denis 'GNUtoo' Carikli wrote on 11 Feb 18:14 +0100
[PATCH 1/3] gnu: Add ucd-14.0.0.
(address . 76208@debbugs.gnu.org)(name . Denis 'GNUtoo' Carikli)(address . GNUtoo@cyberdimension.org)
dfe65c712bf81b74d820d5e5d1001fe9f5544c25.1739292621.git.GNUtoo@cyberdimension.org
* gnu/packages/unicode.scm (ucd-14.0.0): New variable.

GRUB 2.12 depends on gnulib 9f48fb992a3d7e96610c4ce8be969cff2d61a01b
("filevercmp: fix several unexpected results"), as stated in the
bootstrap.conf in the GRUB source code, and this gnulib version depends
on UCD 14.0.0.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Change-Id: I5c2c19aadfd0e6bf5303e10fbc602daa7dd0d0ff
---
gnu/packages/unicode.scm | 13 +++++++++++++
1 file changed, 13 insertions(+)

Toggle diff (33 lines)
diff --git a/gnu/packages/unicode.scm b/gnu/packages/unicode.scm
index 5f8a3655b0c..0b50b5d60ab 100644
--- a/gnu/packages/unicode.scm
+++ b/gnu/packages/unicode.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2020 Liliana Marie Prikler <liliana.prikler@gmail.com>
;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2021 Felix Gruber <felgru@posteo.net>
+;;; Copyright © 2025 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -102,6 +103,18 @@ (define-public ucd
test data for conformance to several important Unicode algorithms.")
(license unicode)))
+(define-public ucd-14.0.0
+ (package
+ (inherit ucd)
+ (version "14.0.0")
+ (source
+ (origin
+ (method url-fetch/zipbomb)
+ (uri (string-append "https://www.unicode.org/Public/zipped/" version
+ "/UCD.zip"))
+ (sha256
+ (base32 "001nq9w52ijma0vps40xwy2q6ylpyf1393lzb128ibypnmv54fh3"))))))
+
(define (unicode-emoji-file name version hash)
(origin
(method url-fetch)
--
2.46.0
Denis 'GNUtoo' Carikli wrote on 11 Feb 18:14 +0100
[PATCH 3/3] gnu: grub: build from git source.
(address . 76208@debbugs.gnu.org)(name . Denis 'GNUtoo' Carikli)(address . GNUtoo@cyberdimension.org)
35d33ec64be4fb6c064a8a80b8c28f02541909c9.1739292621.git.GNUtoo@cyberdimension.org
* gnu/packages/bootloaders.scm (grub)
[source]: Switch to git-fetch, don't overwrite grub-core/extra_deps.lst.
[native-inputs]: Add autoconf, automake, gnulib-2022-02-12, python.
[arguments]<phases>: Add 'bootstrap phase.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Change-Id: I894e7dcac719a4d20dc82685af7a31110a023b50
---
gnu/packages/bootloaders.scm | 59 ++++++++++++++++++++++++++++--------
1 file changed, 46 insertions(+), 13 deletions(-)

Toggle diff (112 lines)
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index b5cfacca4bc..86fff61ad7d 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -15,7 +15,7 @@
;;; Copyright © 2020, 2021 Pierre Langlois <pierre.langlois@gmx.com>
;;; Copyright © 2021 Vincent Legoll <vincent.legoll@gmail.com>
;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
-;;; Copyright © 2022, 2023 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
+;;; Copyright © 2022-2023, 2025 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
;;; Copyright © 2021 Stefan <stefan-guix@vodafonemail.de>
;;; Copyright © 2022, 2023, 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2023 Herman Rimm <herman@rimm.ee>
@@ -40,7 +40,9 @@
(define-module (gnu packages bootloaders)
#:use-module (gnu packages)
#:use-module (gnu packages assembly)
+ #:use-module (gnu packages autotools)
#:use-module (gnu packages base)
+ #:use-module (gnu packages build-tools)
#:use-module (gnu packages disk)
#:use-module (gnu packages bison)
#:use-module (gnu packages cdrom)
@@ -112,22 +114,20 @@ (define-public grub
(name "grub")
(version "2.12")
(source (origin
- (method url-fetch)
- (uri (string-append "mirror://gnu/grub/grub-" version ".tar.xz"))
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://git.savannah.gnu.org/git/grub.git")
+ (commit (string-append "grub-" version))))
(sha256
(base32
- "1ahgzvvvwdxx7rl08pv5dyqlgp76jxz0q2cflxvsdsn4yy8p7jgk"))
+ "05x4sli80ybpi38pj0313pg2ip2dd4lflz64hymvnzzn2sq63awm"))
+ (file-name (git-file-name name version))
(patches (search-patches
"grub-efi-fat-serial-number.patch"
"grub-setup-root.patch"))
(modules '((guix build utils)))
(snippet
#~(begin
- ;; Add file missing from the release tarball.
- (call-with-output-file "grub-core/extra_deps.lst"
- (lambda (port)
- (display "depends bli part_gpt\n" port)))
-
;; Use exit code 77, not 99, to tell Automake that a test
;; is skipped.
(substitute* (find-files "tests" "\\.in$")
@@ -156,7 +156,36 @@ (define-public grub
#:phases
#~(modify-phases %standard-phases
- (add-after 'unpack 'patch-stuff
+ ;; We need to run before the patch-stuff phase, otherwise we
+ ;; have this error:
+ ;; starting phase `patch-stuff'
+ ;; error: in phase 'patch-stuff': uncaught exception:
+ ;; system-error "stat" "~A: ~S"
+ ;; ("No such file or directory" "grub-core/Makefile.in") (2)
+ (add-after 'unpack 'bootstrap
+ (lambda _
+ ;; The bootstrap script calls gnulib-tool{,.py} from the path
+ ;; passed to --gnulib-srcdir, so we need to put Guix version
+ ;; of these scripts there.
+ (copy-recursively
+ (string-append #$gnulib-2022-02-12 "/src/gnulib") "gnulib")
+ (delete-file "gnulib/gnulib-tool")
+ (delete-file "gnulib/gnulib-tool.py")
+ (copy-file
+ (string-append #$gnulib-2022-02-12 "/bin/gnulib-tool")
+ "gnulib/gnulib-tool")
+ (copy-file
+ (string-append #$gnulib-2022-02-12 "/bin/gnulib-tool.py")
+ "gnulib/gnulib-tool.py")
+ ;; We run very early so we need to patch the sheebang now as
+ ;; bootstrap will run autogen.sh.
+ (patch-shebang "autogen.sh")
+ (invoke
+ "bash"
+ "./bootstrap"
+ "--no-git"
+ "--gnulib-srcdir=gnulib")))
+ (add-after 'bootstrap 'patch-stuff
(lambda* (#:key native-inputs inputs #:allow-other-keys)
(substitute* "grub-core/Makefile.in"
(("/bin/sh") (which "sh")))
@@ -270,12 +299,16 @@ (define-public grub
(list fuse-2)
'())))
(native-inputs
- (append (list pkg-config
+ (append (list autoconf
+ automake
bison
flex
- texinfo
- help2man
freetype ;native version needed for build-grub-mkfont
+ gnulib-2022-02-12
+ help2man
+ pkg-config
+ python ;to run gentpl.py during autoconf.sh
+ texinfo
;; Dependencies of the test suite.
parted
--
2.46.0
Denis 'GNUtoo' Carikli wrote on 12 Feb 02:47 +0100
Re: gnu: grub: build from git source.
(address . 76208@debbugs.gnu.org)
20250212024546.2dc85f53@primary_laptop
Hi again,

I've now tested this patch set with grub-coreboot and it booted fine (I
tested with LUKS1+LVM2+ext4 on a ThinkPad X200).

I'll probably try a bit more tests by generating some rootfs with GRUB
on the MBR.

However I don't have x86_64 UEFI computers at home, so if I also need to
test on UEFI x86_64 it will take more time until I ask a friend who
has a computer like that.

I might be able to test on ARM too but this is also not straightforward
so it might also take more time (probably more than x86).

Denis.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEeC+d2+Nrp/PU3kkGX138wUF34mMFAmer/b0ACgkQX138wUF3
4mNrlQ/9H10sI9Nt4hl6vbqXnd9KJ2UizqDarMA+f6G8BTWCFflG7hA7nt/cIrSd
p8dAatquKulLsn941FNZQBAxfbm5cq5L7X0fuvZhm7oYC2J82/qUE1VDMtubHd55
0mHBNkQvD3+9Gr3jYCKri9MC83EbksQVz9wQUkwt/Lm3PUgP2rZcN9+6ss3m7ljH
2gAtLG+s6hYfES8ElHgzbgu0eECMEJWKu0S0gObGVu86yC83Lu264lSCQYalMare
kR7QEIDTEwtEzQuSJpjeqIKIOJ0OlBJxA3FzzRpKB61rUQ5SUJnqOwsde8Gz/R1K
8a4/0lHp7Apq3UooQ8OmrDczVOGF0DQAQo1a0Os4G+CvAojZO58t6t/X2mcziS1Q
NN2WzZOfrJSFVhE49EZCdvEdqw4JBnQnpLyWA15E0YeIkzMepSbLNRvGHyHLDpZE
CGZ6WBQF1gpvD9tWheO1qPRIOrWvqgJzAG7FWrE4qxD0hFLTQtPPB1NuFawj37wj
lwQUKQUqgrtKzzDUHyw6JfuTHppuWnNoSUxkATMnofYnNGHDQ4Zdv1USZmlZtJRG
01dR20o4uFkUtvc5jnqCgUb2URmvi+XDv/JO2RxxZSWMLy/Xqvbbp+PJrzfX9pZg
S/yamAwpaJ+ZSsVo5OB+aZhdur6fznIMYt7LTgwVQt5HH1TIzZ4=
=KMy+
-----END PGP SIGNATURE-----


Denis 'GNUtoo' Carikli wrote 6 days ago
Re: gnu: grub: build from git source.
(address . 76208@debbugs.gnu.org)
20250215175132.09c34621@primary_laptop
Hi,

My patch contains issues that were found during testing.

If I run:
Toggle quote (3 lines)
> $ ./pre-inst-env guix system image --image-type=efi-raw \
> ./minimal-system.scm

With:
Toggle quote (54 lines)
> ;;; This file is free software; you can redistribute it and/or modify
> it ;;; under the terms of the GNU General Public License as published
> by ;;; the Free Software Foundation; either version 3 of the License,
> or (at ;;; your option) any later version.
> ;;;
> ;;; This file is distributed in the hope that it will be useful, but
> ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
> ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> ;;; GNU General Public License for more details.
> ;;;
> ;;; You should have received a copy of the GNU General Public License
> ;;; along with this file. If not, see <http://www.gnu.org/licenses/>.
>
> (define-module (minimal-system)
> #:use-module (gnu)
> #:use-module (gnu bootloader)
> #:use-module (guix build-system copy)
> #:use-module ((guix licenses) #:prefix license:)
> #:use-module (guix packages))
>
> (define-public current-system
> (package
> (name "current-system")
> (version "0.1")
> (source (local-file (current-filename)))
> (arguments
> (list
> #:install-plan
> #~(list '(#$(basename (current-filename))
> "share/current-system/")))) (build-system copy-build-system)
> (synopsis "current guix system definition")
> (description "The current guix system definition can be used to
> get the file that was used to produce a given image. If the system
> definition is self-contained, it can also be useful to point
> unattended-upgrade-service to the current system definition file.")
> (home-page #f)
> (license license:gpl3+)))
>
> (define-public minimal-operating-system
> (operating-system
> (host-name "minimal")
> (bootloader (bootloader-configuration
> (bootloader grub-bootloader)
> (targets '(file-system-label "Guix_image"))
> (terminal-outputs '(console))))
> (file-systems (append (list (file-system
> (device (file-system-label
> "Guix_image")) (mount-point "/")
> (type "ext4")))
> %base-file-systems))
> (packages (append (list current-system) %base-packages))))
>
> minimal-operating-system

After working around temporary network with --no-substitutes, I
get this error:
Toggle quote (7 lines)
> -builder for
> `/gnu/store/icskarx900khnyg2f551dfc8mszgrpb6-grub-locales.drv' failed
> with exit code 1 build of
> /gnu/store/icskarx900khnyg2f551dfc8mszgrpb6-grub-locales.drv failed
> View build log at
> '/var/log/guix/drvs/ic/skarx900khnyg2f551dfc8mszgrpb6-grub-locales.drv.gz'.

And this file has that:
Toggle quote (9 lines)
> Backtrace:
> 1 (primitive-load
> "/gnu/store/kyc66l3m5pvx6m97z0cyvga4m5b?") In ice-9/boot-9.scm:
> 256:9 0 (for-each #<procedure 7ffff7844840 at ice-9/eval.scm:3?>
> ?)
>
> ice-9/boot-9.scm:256:9: In procedure for-each:
> In procedure for-each: Not a list: #f

So I probably need to rework the patch somehow.

Also note that so far I only tried to unbundle gnulib, there
are, according to the "6 Updating external code" section in the
grub-dev info manual, 2 more bundled projects[1]:
- jsmn
- minilzo

but they are respectively used to parse JSON and implement LZO, so this
is probably not related to the error I have above.

References:
------------

Denis.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEeC+d2+Nrp/PU3kkGX138wUF34mMFAmewxhQACgkQX138wUF3
4mOZvQ//aSWkyM3byXuvMenL7i6+xoBkeA0V5zBK2GeJAexN5yjq/SjfvtQ5ij9E
X5rSXyckg6QjzRjmKxQd81EL4i6FGzwiYOQ0o6ml/HK85m4mYMZDfhp02r/5gnuI
OfmNGJG/wzaKAa0vbkzf7FZxOJ+AwToPwbxiU81Z/7oqsS2Bdfp/q9LzDWW/0u4X
5ELQhtsLuPq0xm9G1ASWUOFCFvHy3OVBrvlZrFhZthYWoLODvJ6gouh2KdkX4N/W
o48BbDgfyu1sLUiPeGAb3QC/2FiqxC229QVhfnP3EBCYF8/SvJGJLfyCXcI85FRG
P2VJ/uZoktpYBrrztO70rAtVc4xLA1RXR6+HBwfdkS+KW8fHK22p0nkhbUZb6OQd
C7ZwaTL/0aB6rSuksDPvTR9oxMcf2ammuqXMYKq6Jic91AABr/EWvjk0U+ao5RaB
kCg5/PecI7aB5xrcUaGnf08w1fiNZbgZ+DeXyFgse5g180OlPnot0GR+PGcxgPCm
D0xe5jnSTJCZ0NrycPTpZBWKvtnvPILessmOYGfcS1dNV6b+G/iHEMjM66YK5x0y
SJvr9D0zfWQGwf7cFmKyYi8TZUCF5T48ygzt1ahZZSM5RqyIl/NMjkyVhA5QoB5U
ZtAfo7BHuFVYUSOmVPWn0/8iJ69kwibtaCeDUi/4Y6qjBfKeM3Y=
=vhBk
-----END PGP SIGNATURE-----


?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 76208@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 76208
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch