From unknown Thu Jun 19 14:07:58 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#41066 <41066@debbugs.gnu.org> To: bug#41066 <41066@debbugs.gnu.org> Subject: Status: [PATCH] gnu: grub: Support for chain loading. Reply-To: bug#41066 <41066@debbugs.gnu.org> Date: Thu, 19 Jun 2025 21:07:58 +0000 retitle 41066 [PATCH] gnu: grub: Support for chain loading. reassign 41066 guix-patches submitter 41066 Stefan severity 41066 normal tag 41066 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun May 03 19:34:38 2020 Received: (at submit) by debbugs.gnu.org; 3 May 2020 23:34:38 +0000 Received: from localhost ([127.0.0.1]:58466 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jVO86-0001Kv-2Y for submit@debbugs.gnu.org; Sun, 03 May 2020 19:34:38 -0400 Received: from lists.gnu.org ([209.51.188.17]:40836) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jVO83-0001Kn-HC for submit@debbugs.gnu.org; Sun, 03 May 2020 19:34:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVO83-0000kI-8U for guix-patches@gnu.org; Sun, 03 May 2020 19:34:35 -0400 Received: from mx009.vodafonemail.xion.oxcs.net ([153.92.174.39]:57241) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVO81-0005EA-FZ for guix-patches@gnu.org; Sun, 03 May 2020 19:34:34 -0400 Received: from vsmx002.vodafonemail.xion.oxcs.net (unknown [192.168.75.192]) by mta-6-out.mta.xion.oxcs.net (Postfix) with ESMTP id 87FFD604800 for ; Sun, 3 May 2020 23:34:27 +0000 (UTC) Received: from macbook-pro.kuh-wiese.my-router.de (unknown [88.70.113.211]) by mta-6-out.mta.xion.oxcs.net (Postfix) with ESMTPA id 47BA56047FF for ; Sun, 3 May 2020 23:34:25 +0000 (UTC) From: Stefan Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: [PATCH] gnu: grub: Support for chain loading. Message-Id: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> Date: Mon, 4 May 2020 01:34:24 +0200 To: guix-patches@gnu.org Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) X-Mailer: Apple Mail (2.3124) X-VADE-STATUS: LEGIT X-VADE-SCORE: 0 X-VADE-REASON: gggruggvucftvghtrhhoucdtuddrgeduhedrjeefgddvvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucevfgfuvffqoffgtfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddtnecunecujfgurhephfgtgffukfffvfggofesthhqmhdthhdtvdenucfhrhhomhepufhtvghfrghnuceoshhtvghfrghnqdhguhhigiesvhhouggrfhhonhgvmhgrihhlrdguvgeqnecuggftrfgrthhtvghrnhepkefguefhvdfgledutddvueejuefhveeffeeufeekgfdtueelgedvfffgvdfghfetnecuffhomhgrihhnpehgnhhurdhorhhgnecukfhppeekkedrjedtrdduudefrddvuddunecuufhprghmffhomhgrihhnpehmhidqrhhouhhtvghrrdguvgenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghlohepmhgrtggsohhokhdqphhrohdrkhhuhhdqfihivghsvgdrmhihqdhrohhuthgvrhdruggvpdhinhgvthepkeekrdejtddruddufedrvdduuddpmhgrihhlfhhrohhmpehsthgvfhgrnhdqghhuihigsehvohgurghfohhnvghmrghilhdruggvpdhrtghpthhtohepghhuihigqdhprghttghhvghssehgnhhurdhorhhg Received-SPF: pass client-ip=153.92.174.39; envelope-from=stefan-guix@vodafonemail.de; helo=mx009.vodafonemail.xion.oxcs.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/03 19:34:27 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) * gnu/bootloaders/grub.scm (grub-efi-net-bootloader-chain): New efi = bootloader for chaining with other bootloaders. * guix/packages.scm (package-collection): New function to build a union = of packages with a collection of certain files. This allows to chain grub-efi mainly for single-board-computers with = e.g. U-Boot, device-tree files, plain configuration files, etc. like this: (operating-system (bootloader (grub-efi-net-bootloader-chain (list u-boot firmware) '("libexec/u-boot.bin" "firmware/") (list (plain-file "config.txt" "kernel=3Du-boot.bin")) #:target "/boot-tftp" #:efi-subdir "efi/boot") (target "/boot-tftp")) ...) --- gnu/bootloader/grub.scm | 36 +++++++++++++ guix/packages.scm | 114 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 150 insertions(+) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 9ca4f016f6..67736724a7 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -22,6 +22,7 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu bootloader grub) + #:use-module (guix packages) #:use-module (guix records) #:use-module ((guix utils) #:select (%current-system = %current-target-system)) #:use-module (guix gexp) @@ -54,6 +55,7 @@ grub-bootloader grub-efi-bootloader grub-efi-net-bootloader + grub-efi-net-bootloader-chain grub-mkrescue-bootloader grub-configuration)) @@ -525,6 +527,40 @@ TARGET for the system whose root is mounted at = MOUNT-POINT." (installer (install-grub-efi-net efi-subdir)) (configuration-file (string-append target "/" efi-subdir = "/grub.cfg"))))) +(define* (grub-efi-net-bootloader-chain bootloader-packages + bootloader-package-contents + #:optional (files '()) + #:key + (target #f) + (efi-subdir #f)) + "Defines a (grub-efi-net-bootloader) with ADDITIONAL-BOOTLOADER-FILES = from +ADDITIONAL-BOOTLOADER-PACKAGES and ADDITIONAL-FILES, all collected as a +(package-collection), whose files inside the \"collection\" folder get +copied into TARGET along with the the bootloader installation in = EFI-SUBDIR." + (let* ((base-bootloader (grub-efi-net-bootloader #:target target + #:efi-subdir = efi-subdir)) + (base-installer (bootloader-installer base-bootloader)) + (packages (package-collection + (cons (bootloader-package base-bootloader) + bootloader-packages) + bootloader-package-contents + files))) + (bootloader + (inherit base-bootloader) + (package packages) + (installer + #~(lambda (bootloader target mount-point) + (#$base-installer bootloader target mount-point) + (copy-recursively + (string-append bootloader "/collection") + (string-join (delete "" + (string-split + (string-append mount-point "/" target) + #\/)) + "/" + 'prefix) + #:follow-symlinks? #t)))))) + (define* grub-mkrescue-bootloader (bootloader (inherit grub-efi-bootloader) diff --git a/guix/packages.scm b/guix/packages.scm index 2fa4fd05d7..987c3b80ac 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -32,6 +32,7 @@ #:use-module (guix derivations) #:use-module (guix memoization) #:use-module (guix build-system) + #:use-module (guix build-system trivial) #:use-module (guix search-paths) #:use-module (guix sets) #:use-module (ice-9 match) @@ -114,6 +115,7 @@ package-with-patches package-with-extra-patches package/inherit + package-collection transitive-input-references @@ -944,6 +946,118 @@ OVERRIDES." overrides ... (replacement (and=3D> (package-replacement p) loop))))) +(define* (package-collection packages package-contents #:optional = (files '())) + "Defines a package union from PACKAGES and additional FILES. Its = output +\":out\" has a \"collection\" directory with links to selected = PACKAGE-CONTENTS +and FILES. The output \":collection\" of the package links to that = directory." + (let ((package-names (map (lambda (package) + (package-name package)) + packages)) + (link-machine '(lambda (file directory targetname) + (symlink file + (string-append directory + "/" + (targetname file)))))) + (package + (name (string-join (append '("package-collection") package-names) = "-")) + ;; We copy the version of the first package. + (version (package-version (first packages))) + ;; FILES are expected to be a list of gexps like 'plain-file'. As = gexps + ;; can't (yet) be used in the arguments of a package we convert = FILES into + ;; the source of this package. + (source (computed-file + "computed-files" + (with-imported-modules + '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (define (targetname file) + ;; A plain-file inside the store has a name like + ;; = gnu/store/9x6y7j75qy9z6iv21byrbyj4yy8hb490-config.txt. + ;; We take its basename and drop the hash from it. + ;; Therefore it expects the first '-' at index 32. + ;; Otherwise the basename of file is returned + (let ((name (basename file))) + (if (and (> (string-length name) 33) + (=3D (string-index name #\- 0 33) 32)) + (substring name 33) + (name)))) + (mkdir-p #$output) + (for-each (lambda (file) + (#$link-machine file #$output = targetname)) + '#$files))))) + (build-system trivial-build-system) + (arguments + `(#:modules + ((guix build union) + (guix build utils)) + #:builder + (begin + (use-modules (guix build union) + (guix build utils) + (ice-9 ftw) + (ice-9 match) + (srfi srfi-1)) + ;; Make a union of all packages as :out. + (match %build-inputs + (((names . directories) ...) + (union-build %output directories))) + (let* ((directory-content + ;; Creates a list of absolute path names inside DIR. + (lambda (dir) + (map (lambda (name) + (string-append dir name)) + (scandir dir (lambda (name) + (not (member name '("." = "..")))))))) + (select-names + ;; Select names ending with (filter) or without "/" = (remove) + (lambda (select names) + (select (lambda (name) + (string=3D? (string-take-right name 1) = "/")) + names))) + (content + ;; The selected package content as a list of absolute = paths. + (map (lambda (name) + (string-append %output "/" name)) + ',package-contents)) + (directory-names + (append (select-names filter content) + (list (string-append + (assoc-ref %build-inputs "source") + "/")))) + (names-from-directories + (fold (lambda (directory previous) + (append (directory-content directory) = previous)) + '() + directory-names)) + (names-from-content (select-names remove content)) + (names (append names-from-directories = names-from-content)) + (collection-directory (string-append %output = "/collection")) + (collection (assoc-ref %outputs "collection"))) + ;; Collect links to package-contents and file. + (mkdir-p collection-directory) + (for-each (lambda (name) + (,link-machine name collection-directory = basename)) + names) + (symlink collection-directory collection))))) + (inputs (fold-right + (lambda (package previous) + (cons (list (package-name package) package) previous)) + '() + packages)) + (outputs '("out" "collection")) + (synopsis "Package union with a collection of package contents and = files") + (description + (string-append "A package collection is useful when bootloaders = need to " + "be chained and the bootloader-installer needs to = install " + "selected parts of them. This collection = includes: " + (string-join package-names ", ") ".")) + (license + (append (map (lambda (package) + (package-license package)) + packages))) + (home-page "")))) + ^L ;;; ;;; Package derivations. --=20 2.26.0= From debbugs-submit-bounces@debbugs.gnu.org Sun May 03 19:57:58 2020 Received: (at control) by debbugs.gnu.org; 3 May 2020 23:57:58 +0000 Received: from localhost ([127.0.0.1]:58491 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jVOUf-0001vH-Sy for submit@debbugs.gnu.org; Sun, 03 May 2020 19:57:58 -0400 Received: from tobias.gr ([80.241.217.52]:35406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jVOUb-0001v7-P4 for control@debbugs.gnu.org; Sun, 03 May 2020 19:57:56 -0400 Received: by tobias.gr (OpenSMTPD) with ESMTP id da547144 for ; Sun, 3 May 2020 23:57:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=tobias.gr; h=from:to :date:message-id:mime-version:content-type; s=2018; i= me@tobias.gr; bh=MgsJ6JskDL6+LObcYxHUEJdKea4CzNyiHu24/8CJ2n4=; b= TetM8TKmM0qja7A0Geubw/gaI/ACMvwN/X66Hf9yDsXiqQwKvFtl+HDDq/unO7FM CPa5pM2EIhTirRTE1k16LLb8Aysv42SQ7amjGBcz4X/ZBRUvgTvSeBweXFHHhKWA 9oSfquo5Kzu12yAxTGBp6cn6zyJTiW97P7plFwVnV1fYfJcWiXublGlVzhq2pVZM aEiBLlu6ZTCSUMPG3REGhUgs6g+U6IWXF/t0OW3h6rdBMhwoxIiF+WFDekXzN9ap DCJXRzeHe55RwEC4ho5HEmMJdvu10QZcRZZ7gqAOBxLtxGdGjj/BsCiILTnIDNiN hmHs5uQtzJwsTjDfyu8Kxg== Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id f23c1144 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Sun, 3 May 2020 23:57:51 +0000 (UTC) From: Tobias Geerinckx-Rice To: GNU bug tracker automated control server Date: Mon, 04 May 2020 01:58:04 +0200 Message-ID: <874kswr2pf.fsf@nckx> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Spam-Score: -0.3 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) merge 41066 41068 From debbugs-submit-bounces@debbugs.gnu.org Sun May 24 07:13:47 2020 Received: (at 41066) by debbugs.gnu.org; 24 May 2020 11:13:47 +0000 Received: from localhost ([127.0.0.1]:36592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jcoZf-0000ga-6P for submit@debbugs.gnu.org; Sun, 24 May 2020 07:13:47 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:44050) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jcoZd-0000gS-NM for 41066@debbugs.gnu.org; Sun, 24 May 2020 07:13:46 -0400 Received: from localhost (80-110-127-207.cgn.dynamic.surfer.at [80.110.127.207]) by dd26836.kasserver.com (Postfix) with ESMTPSA id E78283362B62; Sun, 24 May 2020 13:13:43 +0200 (CEST) Date: Sun, 24 May 2020 13:13:16 +0200 From: Danny Milosavljevic To: Stefan Subject: Re: [bug#41066] [PATCH] gnu: grub: Support for chain loading. Message-ID: <20200524131316.4c6e8a50@scratchpost.org> In-Reply-To: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/3+8=9qVuO8MXPXAZeH7x05Y"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41066 Cc: 41066@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Sig_/3+8=9qVuO8MXPXAZeH7x05Y Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable I guess it is possible to do it like that--and maybe we even should. But a collection of packages and accompanying setup is called a profile. Maybe you'd rather want a bootloader profile instead of a bootloader package-of-packages. We do the same for kernel modules--it just creates a profile of all the kernel module packages using the procedure "profile-derivation" and then uses a profile hook to configure the whole thing. See also operating-system-directory-base-entries in gnu/system.scm for how this is done with kernel modules (the profile-derivation call). You could do something similar with multiple bootloaders that are chained together that make some kind of useful whole. A profile hook could then make sure that this collection of bootloaders actually makes sense and then chain them together in the right order, if any. What do you think? --Sig_/3+8=9qVuO8MXPXAZeH7x05Y Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl7KVswACgkQ5xo1VCww uqVIKQf/ak3Gv1Vl0ec9I2JEJ3XAD4mtcXxjZAq04qqVYr++FGffrRQhMah2OoF/ ByO1H3pNXl0XWBemGqVId419ihDpN1whzNw+Q4AmsN28t6QY82xkKcY04FT7yTBH v0hL2veG0FNbZISo6AB1WOfo7MkC9YupuH9tdn2sKZrmD5o3ANlwO78GMiK2/B/D KGS5G+ihIvwqHta9mA9JnKeqByNWo4SLaDNaFbJtDm3XRG9kAGjS8Wx1UfG7Ypzt mppAYguq5NV1m7ksedc37iF5svDvfj2jeIN6xzK5xBBc7Ar7nThIpVhe6oFkuNUb yBqfBU6VvDKH0+rjwvqPRF99vYl7bw== =kYA+ -----END PGP SIGNATURE----- --Sig_/3+8=9qVuO8MXPXAZeH7x05Y-- From debbugs-submit-bounces@debbugs.gnu.org Sun May 24 09:21:18 2020 Received: (at 41066) by debbugs.gnu.org; 24 May 2020 13:21:18 +0000 Received: from localhost ([127.0.0.1]:36680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jcqZ4-0005r0-CH for submit@debbugs.gnu.org; Sun, 24 May 2020 09:21:18 -0400 Received: from vsmx009.vodafonemail.xion.oxcs.net ([153.92.174.87]:8763) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jcqZ1-0005qm-1r for 41066@debbugs.gnu.org; Sun, 24 May 2020 09:21:16 -0400 Received: from vsmx001.vodafonemail.xion.oxcs.net (unknown [192.168.75.191]) by mta-5-out.mta.xion.oxcs.net (Postfix) with ESMTP id DEFCA159D379; Sun, 24 May 2020 13:21:08 +0000 (UTC) Received: from macbook-pro.kuh-wiese.my-router.de (unknown [2.206.141.243]) by mta-5-out.mta.xion.oxcs.net (Postfix) with ESMTPA id 7B770159CA78; Sun, 24 May 2020 13:21:04 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [bug#41066] [PATCH] gnu: grub: Support for chain loading. From: Stefan In-Reply-To: <20200524131316.4c6e8a50@scratchpost.org> Date: Sun, 24 May 2020 15:21:03 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> To: Danny Milosavljevic X-Mailer: Apple Mail (2.3124) X-VADE-STATUS: LEGIT X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41066 Cc: 41066@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Danny! > Am 24.05.2020 um 13:13 schrieb Danny Milosavljevic = : >=20 > I guess it is possible to do it like that--and maybe we even should. >=20 > But a collection of packages and accompanying setup is called a = profile. Good point. > Maybe you'd rather want a bootloader profile instead of a bootloader > package-of-packages. >=20 > We do the same for kernel modules--it just creates a profile of all = the > kernel module packages using the procedure "profile-derivation" and = then > uses a profile hook to configure the whole thing. >=20 > See also operating-system-directory-base-entries in gnu/system.scm for > how this is done with kernel modules (the profile-derivation call). >=20 > You could do something similar with multiple bootloaders that are = chained > together that make some kind of useful whole. >=20 > A profile hook could then make sure that this collection of = bootloaders > actually makes sense and then chain them together in the right order, > if any. >=20 > What do you think? I=E2=80=99m still a bloody newbie. This sounds like a huge rework, = probably too huge for me. The biggest trouble from my point of view is that the bootloader = installer functions only get a argument, which internally = only has a field. Then this would need to be = replaced by some kind of . My current solution provides a different package with the proper = collection of files to copy for the installer. That was quite easy =E2=80=93= well, beside the problem to tear in a plain-file, for which I needed = the trick with the source field. Bye Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 04 12:31:38 2020 Received: (at 41066) by debbugs.gnu.org; 4 Oct 2020 16:31:38 +0000 Received: from localhost ([127.0.0.1]:46631 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kP6vB-00043a-Mg for submit@debbugs.gnu.org; Sun, 04 Oct 2020 12:31:38 -0400 Received: from vsmx012.vodafonemail.xion.oxcs.net ([153.92.174.90]:48183) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kP6v9-00043L-7Y for 41066@debbugs.gnu.org; Sun, 04 Oct 2020 12:31:36 -0400 Received: from vsmx004.vodafonemail.xion.oxcs.net (unknown [192.168.75.198]) by mta-8-out.mta.xion.oxcs.net (Postfix) with ESMTP id 8F0B2F362E0; Sun, 4 Oct 2020 16:31:28 +0000 (UTC) Received: from macbook-pro.kuh-wiese.my-router.de (unknown [88.70.113.39]) by mta-8-out.mta.xion.oxcs.net (Postfix) with ESMTPA id 1C51A19B4A8; Sun, 4 Oct 2020 16:31:23 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: [PATCH] gnu: bootloader: Support for chain loading. From: Stefan In-Reply-To: <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> Date: Sun, 4 Oct 2020 18:31:22 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> To: Danny Milosavljevic X-Mailer: Apple Mail (2.3124) X-VADE-STATUS: LEGIT X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41066 Cc: 41066@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * gnu/bootloader.scm (bootloader-profile): New internal function to = build a profile from packages and files with a collection of contents to = install. (bootloader-chain): New function to chain a bootloader with contents of additional bootloader or other packages and additional files like = configuration files or device-trees. This allows to chain GRUB with U-Boot, device-tree-files, plain = configuration files, etc. mainly for single-board-computers like this: (operating-system (bootloader (bootloader-configurationa (bootloader (bootloader-chain grub-efi-netboot-bootloader (list u-boot-my-scb firmware) '("libexec/u-boot.bin" "firmware/") (list (plain-file "config.txt" "kernel=3Du-boot.bin")) #:installer (install-grub-efi-netboot = "efi/boot")) (target "/boot")))) =E2=80=A6) --- gnu/bootloader.scm | 143 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 142 insertions(+), 1 deletion(-) diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm index 2eebb8e9d9..e9d80bf45a 100644 --- a/gnu/bootloader.scm +++ b/gnu/bootloader.scm @@ -22,6 +22,8 @@ =20 (define-module (gnu bootloader) #:use-module (guix discovery) + #:use-module (guix gexp) + #:use-module (guix profiles) #:use-module (guix records) #:use-module (guix ui) #:use-module (srfi srfi-1) @@ -66,7 +68,9 @@ bootloader-configuration-additional-configuration =20 %bootloaders - lookup-bootloader-by-name)) + lookup-bootloader-by-name + + bootloader-chain)) =20 ^L ;;; @@ -227,3 +231,140 @@ record." (eq? name (bootloader-name bootloader))) (force %bootloaders)) (leave (G_ "~a: no such bootloader~%") name))) + +(define (bootloader-profile packages package-contents files) + "Creates a profile with PACKAGES and additional FILES. The new = profile will +contain a directory collection/ with links to selected PACKAGE-CONTENTS = and +FILES. This collection is meant to be used by the bootloader = installer. + +PACKAGE-CONTENTS is a list of file or directory names relative to the = PACKAGES, +which will be symlinked into the collection/ directory. If a directory = name +ends with '/', then the directory content instead of the directory = itself will +be symlinked into the collection/ directory. + +FILES is a list of file like objects produced by functions like = plain-file, +local-file, etc., which will be symlinked into the collection/ = directory, too." + (define (bootloader-collection manifest) + (define build + (with-imported-modules '((guix build utils) + (ice-9 ftw) + (srfi srfi-1)) + #~(begin + (use-modules ((guix build utils) #:select (mkdir-p)) + ((ice-9 ftw) #:select (scandir)) + ((srfi srfi-1) #:select (append-map remove))) + (define (symlink-to file directory transform-name) + "Creates a symlink with transformed name to FILE in = DIRECTORY." + (when (file-exists? file) + (symlink file + (string-append + directory "/" + (transform-name (basename file)))))) + (define (remove-hash basename) + "Returns the basename of a store entry without the hash." + ;; A plain-file inside the store has a name like + ;; gnu/store/9x6y7j75qy9z6iv21byrbyj4yy8hb490-config.txt. + ;; =46rom its basename we drop the hash. + ;; Therefore we expects the first '-' at index 32. + ;; Otherwise the basename itself is returned. + (if (and (> (string-length basename) 33) + (=3D (string-index basename #\- 0 33) 32)) + (substring basename 33) + (basename))) + (define (directory-content directory) + "Creates a list of absolute path names inside DIRECTORY." + (map (lambda (name) + (string-append directory name)) + (sort (or (scandir directory + (lambda (name) + (not (member name '("." = ".."))))) + '()) + stringderivation "bootloader-collection" + build + #:local-build? #t + #:substitutable? #f + #:properties + `((type . profile-hook) + (hook . bootloader-collection)))) + + (profile (content (packages->manifest packages)) + (name "bootloader-profile") + (hooks (list bootloader-collection)) + (locales? #f) + (allow-collisions? #f) + (relative-symlinks? #f))) + +(define* (bootloader-chain final-bootloader + bootloader-packages + bootloader-package-contents + #:optional (files '()) + #:key installer) + "Defines a bootloader chain with the FINAL-BOOTLOADER as the final = bootloader +and certain directories and files given in the = BOOTLOADER-PACKAGE-CONTENTS list +relative to list of BOOTLOADER-PACKAGES and additional FILES. + +Along with the installation of the FINAL-BOOTLOADER these additional = FILES and +BOOTLOADER-PACKAGE-CONTENTS will be copied into the bootloader target = directory. + +If a directory name in BOOTLOADER-PACKAGE-CONTENTS ends with '/', then = the +directory content instead of the directory itself will be copied. + +FILES is a list of file like objects produced by functions like = plain-file, +local-file, etc. + +If the INSTALLER argument is used, then this will be used as the = bootloader +installer. Otherwise the intaller of the FINAL-BOOTLOADER will be = used." + (let* ((final-installer (or installer + (bootloader-installer final-bootloader))) + (profile (bootloader-profile + (cons (bootloader-package final-bootloader) + bootloader-packages) + bootloader-package-contents + files))) + (bootloader + (inherit final-bootloader) + (package profile) + (installer + #~(lambda (bootloader target mount-point) + (#$final-installer bootloader target mount-point) + (copy-recursively + (string-append bootloader "/collection") + (string-append mount-point target) + #:follow-symlinks? #t + #:log (%make-void-port "w"))))))) --=20 2.26.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 10 05:31:18 2020 Received: (at 41066) by debbugs.gnu.org; 10 Oct 2020 09:31:18 +0000 Received: from localhost ([127.0.0.1]:36974 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kRBDi-0004SY-6v for submit@debbugs.gnu.org; Sat, 10 Oct 2020 05:31:18 -0400 Received: from mx009.vodafonemail.xion.oxcs.net ([153.92.174.39]:54274) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kRBDd-0004SG-Th for 41066@debbugs.gnu.org; Sat, 10 Oct 2020 05:31:16 -0400 Received: from vsmx002.vodafonemail.xion.oxcs.net (unknown [192.168.75.192]) by mta-6-out.mta.xion.oxcs.net (Postfix) with ESMTP id 4B1DF607A4B; Sat, 10 Oct 2020 09:31:08 +0000 (UTC) Received: from macbook-pro.kuh-wiese.my-router.de (unknown [88.70.113.39]) by mta-6-out.mta.xion.oxcs.net (Postfix) with ESMTPA id 96C5D607BED; Sat, 10 Oct 2020 09:30:57 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [PATCH] gnu: bootloader: Support for chain loading. From: Stefan In-Reply-To: <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> Date: Sat, 10 Oct 2020 11:31:15 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> To: Danny Milosavljevic , Maxim Cournoyer , Efraim Flashner , Mathieu Othacehe , 41066@debbugs.gnu.org X-Mailer: Apple Mail (2.3124) X-VADE-STATUS: LEGIT X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41066 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) A friendly ping =E2=80=A6= From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 18 07:20:33 2020 Received: (at 41066) by debbugs.gnu.org; 18 Oct 2020 11:20:34 +0000 Received: from localhost ([127.0.0.1]:36340 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kU6jp-0004Wg-NE for submit@debbugs.gnu.org; Sun, 18 Oct 2020 07:20:33 -0400 Received: from vsmx012.vodafonemail.xion.oxcs.net ([153.92.174.90]:34839) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kU6jn-0004WT-T1 for 41066@debbugs.gnu.org; Sun, 18 Oct 2020 07:20:32 -0400 Received: from vsmx004.vodafonemail.xion.oxcs.net (unknown [192.168.75.198]) by mta-8-out.mta.xion.oxcs.net (Postfix) with ESMTP id 68F1FF49F3F; Sun, 18 Oct 2020 11:20:26 +0000 (UTC) Received: from macbook-pro.kuh-wiese.my-router.de (unknown [90.186.146.42]) by mta-8-out.mta.xion.oxcs.net (Postfix) with ESMTPA id 4F2AC19ADF3; Sun, 18 Oct 2020 11:20:15 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [PATCH] gnu: bootloader: Support for chain loading. From: Stefan In-Reply-To: <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> Date: Sun, 18 Oct 2020 13:20:14 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> To: Danny Milosavljevic , Maxim Cournoyer , Efraim Flashner , Mathieu Othacehe , 41066@debbugs.gnu.org X-Mailer: Apple Mail (2.3124) X-VADE-STATUS: LEGIT X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41066 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi! Recently the documentation got enhanced and I realised that there is = already the function strip-store-file-name which I kind of = reimplemented. So I did a small rework and also added a check to verify = that all package-content got collected. Bye Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 18 07:21:49 2020 Received: (at 41066) by debbugs.gnu.org; 18 Oct 2020 11:21:49 +0000 Received: from localhost ([127.0.0.1]:36344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kU6l3-0004Ys-1E for submit@debbugs.gnu.org; Sun, 18 Oct 2020 07:21:49 -0400 Received: from mx009.vodafonemail.xion.oxcs.net ([153.92.174.39]:55972) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kU6l0-0004Yd-Ia for 41066@debbugs.gnu.org; Sun, 18 Oct 2020 07:21:47 -0400 Received: from vsmx002.vodafonemail.xion.oxcs.net (unknown [192.168.75.192]) by mta-6-out.mta.xion.oxcs.net (Postfix) with ESMTP id B8D91616677; Sun, 18 Oct 2020 11:21:40 +0000 (UTC) Received: from macbook-pro.kuh-wiese.my-router.de (unknown [90.186.146.42]) by mta-6-out.mta.xion.oxcs.net (Postfix) with ESMTPA id 77CE9616667; Sun, 18 Oct 2020 11:21:29 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [PATCH] gnu: bootloader: Support for chain loading. From: Stefan In-Reply-To: <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> Date: Sun, 18 Oct 2020 13:21:28 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> To: Danny Milosavljevic , Maxim Cournoyer , Efraim Flashner , Mathieu Othacehe , 41066@debbugs.gnu.org X-Mailer: Apple Mail (2.3124) X-VADE-STATUS: LEGIT X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41066 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/bootloader.scm (bootloader-profile): New internal function to = build a profile from packages and files with a collection of contents to = install. (bootloader-chain): New function to chain a bootloader with contents of additional bootloader or other packages and additional files like = configuration files or device-trees. This allows to chain GRUB with U-Boot, device-tree-files, plain = configuration files, etc. mainly for single-board-computers like this: (operating-system (bootloader (bootloader-configurationa (bootloader (bootloader-chain grub-efi-netboot-bootloader (list u-boot-my-scb firmware) '("libexec/u-boot.bin" "firmware/") (list (plain-file "config.txt" "kernel=3Du-boot.bin")) #:installer (install-grub-efi-netboot = "efi/boot")) (target "/boot")))) =E2=80=A6) --- gnu/bootloader.scm | 143 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 142 insertions(+), 1 deletion(-) diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm index 2eebb8e9d9..745618f204 100644 --- a/gnu/bootloader.scm +++ b/gnu/bootloader.scm @@ -22,6 +22,8 @@ =20 (define-module (gnu bootloader) #:use-module (guix discovery) + #:use-module (guix gexp) + #:use-module (guix profiles) #:use-module (guix records) #:use-module (guix ui) #:use-module (srfi srfi-1) @@ -66,7 +68,9 @@ bootloader-configuration-additional-configuration =20 %bootloaders - lookup-bootloader-by-name)) + lookup-bootloader-by-name + + bootloader-chain)) =20 ^L ;;; @@ -227,3 +231,140 @@ record." (eq? name (bootloader-name bootloader))) (force %bootloaders)) (leave (G_ "~a: no such bootloader~%") name))) + +(define (bootloader-profile packages package-contents files) + "Creates a profile with PACKAGES and additional FILES. The new = profile will +contain a directory collection/ with links to selected PACKAGE-CONTENTS = and +FILES. This collection is meant to be used by the bootloader = installer. + +PACKAGE-CONTENTS is a list of file or directory names relative to the = PACKAGES, +which will be symlinked into the collection/ directory. If a directory = name +ends with '/', then the directory content instead of the directory = itself will +be symlinked into the collection/ directory. + +FILES is a list of file like objects produced by functions like = plain-file, +local-file, etc., which will be symlinked into the collection/ = directory, too." + (define (bootloader-collection manifest) + (define build + (with-imported-modules '((guix build utils) + (ice-9 ftw) + (srfi srfi-1)) + #~(begin + (use-modules ((guix build utils) + #:select (mkdir-p strip-store-file-name)) + ((ice-9 ftw) + #:select (scandir)) + ((srfi srfi-1) + #:select (append-map every remove))) + (define (symlink-to file directory transform) + "Creates a symlink to FILE named (TRANSFORM FILE) in = DIRECTORY." + (when (file-exists? file) + (symlink file + (string-append directory "/" (transform = file))))) + (define (directory-content directory) + "Creates a list of absolute path names inside DIRECTORY." + (map (lambda (name) + (string-append directory name)) + (sort (or (scandir directory + (lambda (name) + (not (member name '("." = ".."))))) + '()) + stringderivation "bootloader-collection" + build + #:local-build? #t + #:substitutable? #f + #:properties + `((type . profile-hook) + (hook . bootloader-collection)))) + + (profile (content (packages->manifest packages)) + (name "bootloader-profile") + (hooks (list bootloader-collection)) + (locales? #f) + (allow-collisions? #f) + (relative-symlinks? #f))) + +(define* (bootloader-chain final-bootloader + bootloader-packages + bootloader-package-contents + #:optional (files '()) + #:key installer) + "Defines a bootloader chain with the FINAL-BOOTLOADER as the final = bootloader +and certain directories and files given in the = BOOTLOADER-PACKAGE-CONTENTS list +relative to list of BOOTLOADER-PACKAGES and additional FILES. + +Along with the installation of the FINAL-BOOTLOADER these additional = FILES and +BOOTLOADER-PACKAGE-CONTENTS will be copied into the bootloader target = directory. + +If a directory name in BOOTLOADER-PACKAGE-CONTENTS ends with '/', then = the +directory content instead of the directory itself will be copied. + +FILES is a list of file like objects produced by functions like = plain-file, +local-file, etc. + +If the INSTALLER argument is used, then this will be used as the = bootloader +installer. Otherwise the intaller of the FINAL-BOOTLOADER will be = used." + (let* ((final-installer (or installer + (bootloader-installer final-bootloader))) + (profile (bootloader-profile + (cons (bootloader-package final-bootloader) + bootloader-packages) + bootloader-package-contents + files))) + (bootloader + (inherit final-bootloader) + (package profile) + (installer + #~(lambda (bootloader target mount-point) + (#$final-installer bootloader target mount-point) + (copy-recursively + (string-append bootloader "/collection") + (string-append mount-point target) + #:follow-symlinks? #t + #:log (%make-void-port "w"))))))) --=20 2.26.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 22 13:46:38 2020 Received: (at 41066) by debbugs.gnu.org; 22 Oct 2020 17:46:38 +0000 Received: from localhost ([127.0.0.1]:53776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVefd-0002ZG-VS for submit@debbugs.gnu.org; Thu, 22 Oct 2020 13:46:38 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:36120) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVefc-0002Z7-12 for 41066@debbugs.gnu.org; Thu, 22 Oct 2020 13:46:36 -0400 Received: from localhost (80-110-126-103.cgn.dynamic.surfer.at [80.110.126.103]) by dd26836.kasserver.com (Postfix) with ESMTPSA id AF3903367C9C; Thu, 22 Oct 2020 19:46:33 +0200 (CEST) Date: Thu, 22 Oct 2020 19:46:30 +0200 From: Danny Milosavljevic To: Stefan , Subject: Re: [PATCH] gnu: bootloader: Support for chain loading. Message-ID: <20201022194630.597302a2@scratchpost.org> In-Reply-To: <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/98PrK3G5UQkoZY94jZHx_+n"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41066 Cc: 41066@debbugs.gnu.org, Mathieu Othacehe , Efraim Flashner , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Sig_/98PrK3G5UQkoZY94jZHx_+n Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Stefan, this looks very good in general. I have only a few doubts--mostly concerning the end-user API "bootloader-ch= ain": On Sun, 18 Oct 2020 13:21:28 +0200 Stefan wrote: > (bootloader-chain grub-efi-netboot-bootloader > (list u-boot-my-scb > firmware) > '("libexec/u-boot.bin" > "firmware/") > (list (plain-file "config.txt" > "kernel=3Du-boot.bin")) > #:installer (install-grub-efi-netboot "efi/boot= ")) I would prefer if it was possible to do the following: (bootloader-chain (list firmware (plain-file "config.txt" "kernel=3Du-boot= .bin") u-boot-my-scb) grub-efi-netboot-bootloader) (I would put the main bootloader last because the user probably thinks of t= he list of bootloaders in the order they are loaded at boot) [maybe even (bootloader-chain (list u-boot-my-scb firmware (plain-file "config.txt" "k= ernel=3Du-boot.bin") grub-efi-netboot-bootloader)) -- with documentation that the order of the entries matters. But maybe that would be too magical--since only the last entry in that list would have the= ir installer called, and the actual guix generations also only go into the last one's configuration. But maybe that would be OK anyway] Also, I don't like the ad hoc derivation subset selection mechanism you hav= e. I understand that it can be nice to be able to select a subset in general, = but: * Usually we make a special package, inherit from the original package, and= then just make it put the files we want into the derivation output directory. The user would put "u-boot-my-scb-minimal" instead of "u-boot-my-scb" in that case, and then only get the subset. * In this special case of chaining bootloaders, I think that the profile ho= ok can take care of deleting all the unnecessary files, and of all the other w= eird complications (installing FILES, moving stuff around etc--maybe even genera= ting or updating that config.txt one day). One of the reasons I suggested using a profile in the first place is that now the profile hook can do all the dirty work, even long term. * If that isn't possible either, it would be nicer to have a helper procedure that allows you to select a subset of the files that are in the derivation of a package, and not have this subset selection ming= led into the innards of bootloader-chain. (separation of concerns) Maybe there could even be a package transformation to do that. I know that there are probably good reasons why you did it like you did. But still, I think a profile hook is exactly the right kind of tool to hide the extra setup complexity that my API requires, and the API would be less complicated to use and more stable (less likely to ever need to be changed). What do you think? Also, if it is difficult to collect bootloader packages into a profile automatically (without extra user-supplied information) because of the subd= ir "libexec" in u-boot derivations, then we can modify all the u-boot packages (for good) to put u-boot into "$output/" instead of "$output/libexec". I would prefer fixing things instead of having to put workarounds into user configuration. Please tell me if you want that--we can do that. > #:installer (install-grub-efi-netboot "efi/boot= ")) That should be automatic but overridable. This seems to be the case already. Nice! > +(define (bootloader-profile packages package-contents files) If using my suggested bootloader-chain API, this would just get PACKAGES, not PACKAGE-CONTENTS and FILES (FILES would be mixed into the PACKAGES list= --which thus should be renamed to ITEMS or something). > + (define (bootloader-collection manifest) > + (define build > + (with-imported-modules '((guix build utils) > + (ice-9 ftw) > + (srfi srfi-1)) > + #~(begin > + (use-modules ((guix build utils) > + #:select (mkdir-p strip-store-file-name)) > + ((ice-9 ftw) > + #:select (scandir)) > + ((srfi srfi-1) > + #:select (append-map every remove))) > + (define (symlink-to file directory transform) > + "Creates a symlink to FILE named (TRANSFORM FILE) in DIREC= TORY." > + (when (file-exists? file) > + (symlink file > + (string-append directory "/" (transform fil= e))))) > + (define (directory-content directory) > + "Creates a list of absolute path names inside DIRECTORY." > + (map (lambda (name) > + (string-append directory name)) > + (sort (or (scandir directory > + (lambda (name) > + (not (member name '("." ".."))))) > + '()) > + string + (define (select-names select names) > + "Set SELECT to 'filter' or 'remove' names ending with '/'." > + (select (lambda (name) > + (string-suffix? "/" name)) > + names)) > + (define (filter-names-without-slash names) > + (select-names remove names)) > + (define (filter-names-with-slash names) > + (select-names filter names)) I would prefer these to be in another procedure that can be used to transfo= rm any package (or profile?) like this. @Ludo: What do you think? [...] > + (gexp->derivation "bootloader-collection" > + build > + #:local-build? #t > + #:substitutable? #f > + #:properties > + `((type . profile-hook) > + (hook . bootloader-collection)))) > + > + (profile (content (packages->manifest packages)) > + (name "bootloader-profile") > + (hooks (list bootloader-collection)) > + (locales? #f) > + (allow-collisions? #f) > + (relative-symlinks? #f))) > + > +(define* (bootloader-chain [...] > + (bootloader > + (inherit final-bootloader) > + (package profile) I like that. Smart way to reuse existing code. > + (installer > + #~(lambda (bootloader target mount-point) > + (#$final-installer bootloader target mount-point) > + (copy-recursively > + (string-append bootloader "/collection") > + (string-append mount-point target) > + #:follow-symlinks? #t > + #:log (%make-void-port "w"))))))) Thanks! --Sig_/98PrK3G5UQkoZY94jZHx_+n Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl+RxXYACgkQ5xo1VCww uqUPHggAjbAJc065/6YBaVwh1TvClzzplghTe9vBlibTysxgz5XImKlGKJA3vI/M LFS4/ZjVT8z76FuAUCVnSIZyC/SwQQu9d1U31FxIwl/o1ZjAQ7MYDLSp/sDi3gPq bfVlHSfCqB20N99PSRdxz/srQBzTRJ+V7pohhw9Xw/BJ9BncT1I9gLzWUv3FlGdV TictMiivSGzRQURNhdqlaWB93dBZAVJ2cthdCIBBKncxEpvLltiDabqiEg7+X/oT 8cHTphNuYV8Gy6QLvqj/FnXCTFJFz55+3bqNHQXBgeIU1VFepENvKa5GjY42taKr sOe5gZLrCR7qMYW65mLQ4VaTiJhOQQ== =ej98 -----END PGP SIGNATURE----- --Sig_/98PrK3G5UQkoZY94jZHx_+n-- From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 23 08:48:53 2020 Received: (at 41066) by debbugs.gnu.org; 23 Oct 2020 12:48:53 +0000 Received: from localhost ([127.0.0.1]:56281 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVwV2-00034v-Rc for submit@debbugs.gnu.org; Fri, 23 Oct 2020 08:48:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46012) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVwUz-00034g-Cg for 41066@debbugs.gnu.org; Fri, 23 Oct 2020 08:48:50 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48854) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVwUq-0005Dq-Kw; Fri, 23 Oct 2020 08:48:40 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=55328 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kVwUp-0008TP-6m; Fri, 23 Oct 2020 08:48:40 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Danny Milosavljevic Subject: Re: [PATCH] gnu: bootloader: Support for chain loading. References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201022194630.597302a2@scratchpost.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 2 Brumaire an 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 23 Oct 2020 14:48:36 +0200 In-Reply-To: <20201022194630.597302a2@scratchpost.org> (Danny Milosavljevic's message of "Thu, 22 Oct 2020 19:46:30 +0200") Message-ID: <87eelpp0pn.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41066 Cc: Stefan , Mathieu Othacehe , 41066@debbugs.gnu.org, Efraim Flashner , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Danny Milosavljevic skribis: > On Sun, 18 Oct 2020 13:21:28 +0200 > Stefan wrote: > >> (bootloader-chain grub-efi-netboot-bootloader >> (list u-boot-my-scb >> firmware) >> '("libexec/u-boot.bin" >> "firmware/") >> (list (plain-file "config.txt" >> "kernel=3Du-boot.bin")) >> #:installer (install-grub-efi-netboot "efi/boo= t")) In the example above, I think that you could merge the 2nd and 3rd arguments by using =E2=80=98file-append=E2=80=99: (bootloader-chain grub-efi-netboot-bootloader (list (file-append u-boot "/libexec/u-boot.bin") (file-append firmware "/firmware"))) No? I think we should look at how to simplify this interface. Intuitively, I would expect the =E2=80=98bootloader-chain=E2=80=99 to take a list of records and return a record. Is this something that can be achieved? If not, what are the extra constraints that need to be taken into account? >> +(define (bootloader-profile packages package-contents files) > > If using my suggested bootloader-chain API, this would just get PACKAGES, > not PACKAGE-CONTENTS and FILES (FILES would be mixed into the PACKAGES li= st--which > thus should be renamed to ITEMS or something). Yes, if it=E2=80=99s about building a profile, you could just use a object. Would that work here? >> + (define (bootloader-collection manifest) >> + (define build >> + (with-imported-modules '((guix build utils) >> + (ice-9 ftw) >> + (srfi srfi-1)) >> + #~(begin >> + (use-modules ((guix build utils) >> + #:select (mkdir-p strip-store-file-name)) >> + ((ice-9 ftw) >> + #:select (scandir)) >> + ((srfi srfi-1) >> + #:select (append-map every remove))) >> + (define (symlink-to file directory transform) >> + "Creates a symlink to FILE named (TRANSFORM FILE) in DIRE= CTORY." >> + (when (file-exists? file) >> + (symlink file >> + (string-append directory "/" (transform fi= le))))) >> + (define (directory-content directory) >> + "Creates a list of absolute path names inside DIRECTORY." >> + (map (lambda (name) >> + (string-append directory name)) >> + (sort (or (scandir directory >> + (lambda (name) >> + (not (member name '("." "..")))= )) >> + '()) >> + string> + (define (select-names select names) >> + "Set SELECT to 'filter' or 'remove' names ending with '/'= ." >> + (select (lambda (name) >> + (string-suffix? "/" name)) >> + names)) >> + (define (filter-names-without-slash names) >> + (select-names remove names)) >> + (define (filter-names-with-slash names) >> + (select-names filter names)) > > I would prefer these to be in another procedure that can be used to trans= form > any package (or profile?) like this. @Ludo: What do you think? >From a quick look at the patch, I don=E2=80=99t fully understand yet what= =E2=80=99s going on. Stylistically, I=E2=80=99d suggest a few things to make the code more consi= stent with the rest of the code base, and thus hopefully easier to grasp for the rest of us: 1. Don=E2=80=99t sort the result of =E2=80=98scandir=E2=80=99, it=E2=80= =99s already sorted. 2. Remove =E2=80=98select-names=E2=80=99 as it requires people to read mo= re code to understand that we=E2=80=99re just filtering/removing. Instead, decl= are: (define absolute-file-name? (cut string-suffix? "/" <>)) and write: (filter absolute-file-name? names) (remote absolute-file-name? names) HTH! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 23 21:31:01 2020 Received: (at 41066) by debbugs.gnu.org; 24 Oct 2020 01:31:01 +0000 Received: from localhost ([127.0.0.1]:58763 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kW8Ob-0006G7-2X for submit@debbugs.gnu.org; Fri, 23 Oct 2020 21:31:01 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:56476) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kW8OX-0006Fx-8F for 41066@debbugs.gnu.org; Fri, 23 Oct 2020 21:30:59 -0400 Received: from localhost (80-110-126-103.cgn.dynamic.surfer.at [80.110.126.103]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 51A3F3363A8C; Sat, 24 Oct 2020 03:30:54 +0200 (CEST) Date: Sat, 24 Oct 2020 03:30:51 +0200 From: Danny Milosavljevic To: Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: Re: [PATCH] gnu: bootloader: Support for chain loading. Message-ID: <20201024033051.00720ac1@scratchpost.org> In-Reply-To: <87eelpp0pn.fsf@gnu.org> References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201022194630.597302a2@scratchpost.org> <87eelpp0pn.fsf@gnu.org> X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/2DlCA5G10_20G7KKdhuhXo4"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41066 Cc: Stefan , Mathieu Othacehe , 41066@debbugs.gnu.org, Efraim Flashner , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Sig_/2DlCA5G10_20G7KKdhuhXo4 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, On Fri, 23 Oct 2020 14:48:36 +0200 Ludovic Court=C3=A8s wrote: > (bootloader-chain grub-efi-netboot-bootloader > (list (file-append u-boot "/libexec/u-boot.bin") > (file-append firmware "/firmware"))) Ohhh! That's right. That's much better. Can a profile be created with th= ose in it? Especially because of the profile hook... > I think we should look at how to simplify this interface. Intuitively, > I would expect the =E2=80=98bootloader-chain=E2=80=99 to take a list of <= bootloader> > records and return a record. > Is this something that can be achieved? If not, what are the extra > constraints that need to be taken into account? That is not easily possible, and is also logically not what happens anyway. The use case of this entire patchset is when one (for some reason) can't bo= ot the final bootloader directly, then one uses some chain of bootloaders to get the final bootloader to boot. That especially means that all the bootloaders before the final bootloader WILL NOT GET THE GUIX GENERATIONS MENU. It is also pretty uncommon/impossible to use each usual bootloader installer in order to install all the bootloaders one after another. Just think of what would happen if multiple x86_64 bootloaders all tried to install themselves into the first sector of the drive. That's not gonna work correctly. What actually happens is that there's some kind of payload area in the first bootloader where you can put the second bootloader, and some kind of payload area in the second bootloader where you can put the third bootloader... and= so on. Except for the final bootloader, which has the Linux kernel in the pay= load area (as far as the final bootloader is concerned, it can do everything as = if it was the first and only thing that was loaded at boot so far). That means the final bootloader can use the normal config files and general= ly proceed like all our standalone bootloaders do. None of the previous bootl= oaders in the chain can do that, generally. >bootloader-profile > Yes, if it=E2=80=99s about building a profile, you could just use a > object. Would that work here? Huh? Isn't he doing that already? That's what that procedure does. Or am I misunderstanding? > >From a quick look at the patch, I don=E2=80=99t fully understand yet wha= t=E2=80=99s =20 > going on. I suggested to Stefan to use a profile with a profile hook in order to configure all those bootloaders of a bootloader chain correctly. That's what he does here. Usually, Guix bootloader *packages* have a lot of junk that (1) you wouldn't want on a esp partition (wastes space) and also stuff that would be duplica= tes with other bootloaders (COPYING etc). Therefore, it's nice to be able to filter what files of those packages get used. I think your suggestion in t= he beginning is the best one. (file-append u-boot "/libexec/u-boot.bin") inde= ed! The profile hook can then use whatever methods to configure all those bootloaders correctly. --Sig_/2DlCA5G10_20G7KKdhuhXo4 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl+Tg8sACgkQ5xo1VCww uqUeZQgAo67Se5YiIqjMFWvoQTCmCGRpkVYaM28IkNoRFxY2mOroQWvFzRSONi2B 7JRzJJSHXOwg6HMZbW7epbvOD/deNEn+3NK7xWP3sJN/pnQgtmZTDIOFsXX0VfIn HSAm2prDA3lqDVr59kRTUl8rXllfNqkrfWsfQnlrdC/Pw9GHXu6/XRp3KCYwX9n5 mNYVXbPUnPjlujn9H5LZwygg6zsryC1ZzsVAmrHuQh2ebdMuhdaLKvrU7K70Ouaa BIz07HimYjo/15fptJSZfyjOIwLXrPSb1oHDfQxHhM64TrhecZV1eYhy2A5xbmG1 lDKm1lx3gfSNrMcy4l8D4GAgidIxPw== =Xy83 -----END PGP SIGNATURE----- --Sig_/2DlCA5G10_20G7KKdhuhXo4-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 24 12:23:01 2020 Received: (at 41066) by debbugs.gnu.org; 24 Oct 2020 16:23:01 +0000 Received: from localhost ([127.0.0.1]:34965 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWMJo-0003hg-RO for submit@debbugs.gnu.org; Sat, 24 Oct 2020 12:23:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54128) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWMJm-0003hT-Qb for 41066@debbugs.gnu.org; Sat, 24 Oct 2020 12:22:59 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49381) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kWMJf-0000GB-6z; Sat, 24 Oct 2020 12:22:51 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=52100 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kWMJe-0002ot-C1; Sat, 24 Oct 2020 12:22:50 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Danny Milosavljevic Subject: Re: [PATCH] gnu: bootloader: Support for chain loading. References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201022194630.597302a2@scratchpost.org> <87eelpp0pn.fsf@gnu.org> <20201024033051.00720ac1@scratchpost.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 3 Brumaire an 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sat, 24 Oct 2020 18:22:48 +0200 In-Reply-To: <20201024033051.00720ac1@scratchpost.org> (Danny Milosavljevic's message of "Sat, 24 Oct 2020 03:30:51 +0200") Message-ID: <87a6wbiofb.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41066 Cc: Stefan , Mathieu Othacehe , 41066@debbugs.gnu.org, Efraim Flashner , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Danny Milosavljevic skribis: > On Fri, 23 Oct 2020 14:48:36 +0200 > Ludovic Court=C3=A8s wrote: > >> (bootloader-chain grub-efi-netboot-bootloader >> (list (file-append u-boot "/libexec/u-boot.bin") >> (file-append firmware "/firmware"))) > > Ohhh! That's right. That's much better. Can a profile be created with = those > in it? Especially because of the profile hook... Yes, there=E2=80=99s first-class objects that one can use in gexp= s: (profile (content (manifest (entries =E2=80=A6)))) >> I think we should look at how to simplify this interface. Intuitively, >> I would expect the =E2=80=98bootloader-chain=E2=80=99 to take a list of = >> records and return a record. >> Is this something that can be achieved? If not, what are the extra >> constraints that need to be taken into account? > > That is not easily possible, and is also logically not what happens anywa= y. > > The use case of this entire patchset is when one (for some reason) can't = boot > the final bootloader directly, then one uses some chain of bootloaders to > get the final bootloader to boot. > > That especially means that all the bootloaders before the final bootloader > WILL NOT GET THE GUIX GENERATIONS MENU. > > It is also pretty uncommon/impossible to use each usual bootloader instal= ler > in order to install all the bootloaders one after another. Just think of > what would happen if multiple x86_64 bootloaders all tried to install > themselves into the first sector of the drive. That's not gonna work > correctly. > > What actually happens is that there's some kind of payload area in the fi= rst > bootloader where you can put the second bootloader, and some kind of payl= oad > area in the second bootloader where you can put the third bootloader... a= nd so > on. Except for the final bootloader, which has the Linux kernel in the p= ayload > area (as far as the final bootloader is concerned, it can do everything a= s if > it was the first and only thing that was loaded at boot so far). > > That means the final bootloader can use the normal config files and gener= ally > proceed like all our standalone bootloaders do. None of the previous boo= tloaders > in the chain can do that, generally. Sorry, I don=E2=80=99t see why this prevents an API that more closely match= es the idea of a chain of bootloaders (but perhaps I=E2=80=99d just need to sp= end more time studying this.) I guess my advice is: design an interface that=E2=80=99s as close as possib= le to the concepts at hand. If implementation details constrain what can be done, that=E2=80=99s OK, but it should be clear in that case why we end up = with an interface that=E2=80=99s not as simple as one could expect. >>bootloader-profile > >> Yes, if it=E2=80=99s about building a profile, you could just use a >> object. Would that work here? > > Huh? Isn't he doing that already? > > That's what that procedure does. Or am I misunderstanding? It=E2=80=99s not using code from (guix profiles) IIRC. >> >From a quick look at the patch, I don=E2=80=99t fully understand yet wh= at=E2=80=99s=20=20 >> going on. > > I suggested to Stefan to use a profile with a profile hook in order to > configure all those bootloaders of a bootloader chain correctly. That's > what he does here. > > Usually, Guix bootloader *packages* have a lot of junk that (1) you would= n't > want on a esp partition (wastes space) and also stuff that would be dupli= cates > with other bootloaders (COPYING etc). Therefore, it's nice to be able to > filter what files of those packages get used. I think your suggestion in= the > beginning is the best one. (file-append u-boot "/libexec/u-boot.bin") in= deed! > The profile hook can then use whatever methods to configure all those > bootloaders correctly. Alrighty! Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 24 20:33:56 2020 Received: (at 41066) by debbugs.gnu.org; 25 Oct 2020 00:33:56 +0000 Received: from localhost ([127.0.0.1]:35532 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWTyu-0005Pf-Cu for submit@debbugs.gnu.org; Sat, 24 Oct 2020 20:33:56 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:59326) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWTyq-0005PV-Fp for 41066@debbugs.gnu.org; Sat, 24 Oct 2020 20:33:55 -0400 Received: from localhost (80-110-126-103.cgn.dynamic.surfer.at [80.110.126.103]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 93E6133679F7; Sun, 25 Oct 2020 02:33:50 +0200 (CEST) Date: Sun, 25 Oct 2020 02:33:45 +0200 From: Danny Milosavljevic To: Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: Re: [PATCH] gnu: bootloader: Support for chain loading. Message-ID: <20201025023345.73d515d2@scratchpost.org> In-Reply-To: <87a6wbiofb.fsf@gnu.org> References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201022194630.597302a2@scratchpost.org> <87eelpp0pn.fsf@gnu.org> <20201024033051.00720ac1@scratchpost.org> <87a6wbiofb.fsf@gnu.org> X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/1kkicjp4rvHwH=kuatN1toZ"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41066 Cc: Stefan , Mathieu Othacehe , 41066@debbugs.gnu.org, Efraim Flashner , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Sig_/1kkicjp4rvHwH=kuatN1toZ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Ludo, On Sat, 24 Oct 2020 18:22:48 +0200 Ludovic Court=C3=A8s wrote: > >> (bootloader-chain grub-efi-netboot-bootloader > >> (list (file-append u-boot "/libexec/u-boot.bin") > >> (file-append firmware "/firmware"))) =20 > > > > Ohhh! That's right. That's much better. Can a profile be created wit= h those > > in it? Especially because of the profile hook... =20 >=20 > Yes, there=E2=80=99s first-class objects that one can use in ge= xps: >=20 > (profile (content (manifest (entries =E2=80=A6)))) Nice! I haven't used those before, so no idea whether it would be better here. > Sorry, I don=E2=80=99t see why this prevents an API that more closely mat= ches > the idea of a chain of bootloaders (but perhaps I=E2=80=99d just need to = spend > more time studying this.) It doesn't prevent that API--but this narrow use case here doesn't need it. And I do not intend to implement the general use case--we all decided again= st general chainloading and then introduced full support for bootloaders other than grub (which then do not chainload grub--they totally could have!). But this use case with lots of bootloaders on an ESP partition (or Raspberr= y Pi equivalent) is easy enough. Maybe we should change the name of the main procedure to be less general, though. "chain-esp-bootloaders" ? If you could check it out more, that would help. I think how the patch is now is fine for the narrow use case: chainloading the normal guix bootloader using other bootloaders (or whatever else! Maybe a turtle is loading the f= inal guix bootloader--who knows ;) ). The code here can only chain bootloaders in the ESP partition (actually, the Raspberry Pi equivalent of the latter). > >>bootloader-profile =20 > > =20 > >> Yes, if it=E2=80=99s about building a profile, you could just use a > >> object. Would that work here? =20 > > > > Huh? Isn't he doing that already? > > > > That's what that procedure does. Or am I misunderstanding? =20 >=20 > It=E2=80=99s not using code from (guix profiles) IIRC. =46rom the patch: >+(define (bootloader-profile packages package-contents files) >[...] >+ (profile (content (packages->manifest packages)) >+ (name "bootloader-profile") >+ (hooks (list bootloader-collection)) >+ (locales? #f) >+ (allow-collisions? #f) >+ (relative-symlinks? #f))) Maybe I don't understand what you mean... but that "profile" is from (guix profiles). In any case, maybe we should just call it "esp-bootloader-chain" or maybe just "raspberry-pi-bootloader-chain". --Sig_/1kkicjp4rvHwH=kuatN1toZ Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl+Ux+kACgkQ5xo1VCww uqUE/ggAhTYWhzDug/JbwSaL2akUe5n4xpx3mMcVtfyhk+FCMjcemeY3CaNHKFb5 QFnQkCLgd7CKY1rRizXpKHROhydZ8Mp0W4n7EC9FQUSrKMBY77CvPNbH6fbFx4HE uQo8TfCLFH70ZYeTENzSPq4zkENSQ1AmAXfD2hwppmJYzvFG+8Tr3suv4z4iTeei 694xqCzyD7mM2D/JEWVHQHejeYbBKhDXRHWi2JK2zJ/KkX5yhFxoP3z235Whhlq/ dP07Ao2yNS35om51bFILgd/6dcR7vVXDSfkdsVY3O9ydEIxtFY9EchIWl3rXydTJ c9+MjFyIJKUpBJ9iFhtEfhdzM8bh1w== =cE7A -----END PGP SIGNATURE----- --Sig_/1kkicjp4rvHwH=kuatN1toZ-- From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 25 12:58:22 2020 Received: (at 41066) by debbugs.gnu.org; 25 Oct 2020 16:58:22 +0000 Received: from localhost ([127.0.0.1]:37530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWjLa-0007AL-GP for submit@debbugs.gnu.org; Sun, 25 Oct 2020 12:58:22 -0400 Received: from mx009.vodafonemail.xion.oxcs.net ([153.92.174.39]:25507) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWjLY-0007A9-W0 for 41066@debbugs.gnu.org; Sun, 25 Oct 2020 12:58:21 -0400 Received: from vsmx002.vodafonemail.xion.oxcs.net (unknown [192.168.75.192]) by mta-6-out.mta.xion.oxcs.net (Postfix) with ESMTP id CD8A0602BDA; Sun, 25 Oct 2020 16:58:14 +0000 (UTC) Received: from macbook-pro.kuh-wiese.my-router.de (unknown [2.202.77.30]) by mta-6-out.mta.xion.oxcs.net (Postfix) with ESMTPA id 16D0B6040A8; Sun, 25 Oct 2020 16:58:07 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [PATCH] gnu: bootloader: Support for chain loading. From: Stefan In-Reply-To: <20201025023345.73d515d2@scratchpost.org> Date: Sun, 25 Oct 2020 17:58:07 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <4FACB9F5-2A1E-45B5-A53F-42F0E098CEAA@vodafonemail.de> References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201022194630.597302a2@scratchpost.org> <87eelpp0pn.fsf@gnu.org> <20201024033051.00720ac1@scratchpost.org> <87a6wbiofb.fsf@gnu.org> <20201025023345.73d515d2@scratchpost.org> To: Danny Milosavljevic , =?utf-8?Q?Ludovic_Court=C3=A8s?= , 41066@debbugs.gnu.org X-Mailer: Apple Mail (2.3124) X-VADE-STATUS: LEGIT X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41066 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Danny and Ludo! I tried to consider your comments and modified the code as far as I = could grasp the suggestions. Thanks! Now the API looks like this: (bootloader-chain (list (file-append firmware "/boot/") (file-append u-boot-my-scb "/libexec/u-boot.bin") (plain-file "config.txt" "kernel=3Du-boot.bin")) grub-efi-netboot-bootloader #:hook my-special-bootloader-profile-manipulator #:installer (install-grub-efi-netboot "efi/boot")) The suggestion to use file-append simplified a lot, also for the = implementation of the bootloader-collection profile hook. I also added = an optional hook function to do customised manipulations of the profile = before invoking the installer. Regarding this kind of chain-loading: The ARM world seems to consolidate = onto an UEFI firmware, supporting either device-trees or ACPI. There are = two main options for an UEFI firmware to chose from: TianoCore/EDK II = and U-Boot. Some platforms come with an EEPROM or NAND storage to install e.g. = U-Boot with embedded device-tree information as an UEFI firmware. =46rom = a distribution=E2=80=99s point of view this can make using GRUB-EFI the = default choice. And it becomes arguable if the distribution is = responsible to install/update this firmware, if you compare to a BIOS. Other platforms just boot from some FAT partition requiring some blobs = and don=E2=80=99t offer an UEFI firmware. But copying e.g. U-Boot and = some more files onto this FAT partition makes them appear like a system = with an UEFI firmware, giving a kind of compatibility to the future. Bye Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 25 12:59:35 2020 Received: (at 41066) by debbugs.gnu.org; 25 Oct 2020 16:59:35 +0000 Received: from localhost ([127.0.0.1]:37534 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWjMk-0007CK-SE for submit@debbugs.gnu.org; Sun, 25 Oct 2020 12:59:35 -0400 Received: from vsmx012.vodafonemail.xion.oxcs.net ([153.92.174.90]:16036) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWjMi-0007C4-Lm for 41066@debbugs.gnu.org; Sun, 25 Oct 2020 12:59:33 -0400 Received: from vsmx004.vodafonemail.xion.oxcs.net (unknown [192.168.75.198]) by mta-8-out.mta.xion.oxcs.net (Postfix) with ESMTP id C3A90F353B4; Sun, 25 Oct 2020 16:59:26 +0000 (UTC) Received: from macbook-pro.kuh-wiese.my-router.de (unknown [2.202.77.30]) by mta-8-out.mta.xion.oxcs.net (Postfix) with ESMTPA id 4002019AE56; Sun, 25 Oct 2020 16:59:20 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [PATCH] gnu: bootloader: Support for chain loading. From: Stefan In-Reply-To: <4FACB9F5-2A1E-45B5-A53F-42F0E098CEAA@vodafonemail.de> Date: Sun, 25 Oct 2020 17:59:19 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <0DCDD4B0-DC4B-4870-B018-D771C509F9E5@vodafonemail.de> References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201022194630.597302a2@scratchpost.org> <87eelpp0pn.fsf@gnu.org> <20201024033051.00720ac1@scratchpost.org> <87a6wbiofb.fsf@gnu.org> <20201025023345.73d515d2@scratchpost.org> <4FACB9F5-2A1E-45B5-A53F-42F0E098CEAA@vodafonemail.de> To: Danny Milosavljevic , =?utf-8?Q?Ludovic_Court=C3=A8s?= , 41066@debbugs.gnu.org X-Mailer: Apple Mail (2.3124) X-VADE-STATUS: LEGIT X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41066 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * gnu/bootloader.scm (bootloader-profile): New internal function to = build a profile from a package and a collection of files to install. (bootloader-chain): New function to chain a bootloader with a collection = of additional files like other bootloaders, configuration files or = device-trees. This allows to chain GRUB with U-Boot, device-tree-files, plain = configuration files, etc. mainly for single-board-computers like this: (operating-system (bootloader (bootloader-configuration (bootloader (bootloader-chain (list (file-append firmware "/boot/") (file-append u-boot-my-scb "/libexec/u-boot.bin") (plain-file "config.txt" "kernel=3Du-boot.bin")) grub-efi-netboot-bootloader #:hook my-special-bootloader-profile-manipulator #:installer (install-grub-efi-netboot "efi/boot")) (target "/boot")))) =E2=80=A6) --- gnu/bootloader.scm | 125 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 124 insertions(+), 1 deletion(-) diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm index 2eebb8e9d9..b319e1f92f 100644 --- a/gnu/bootloader.scm +++ b/gnu/bootloader.scm @@ -22,6 +22,8 @@ =20 (define-module (gnu bootloader) #:use-module (guix discovery) + #:use-module (guix gexp) + #:use-module (guix profiles) #:use-module (guix records) #:use-module (guix ui) #:use-module (srfi srfi-1) @@ -66,7 +68,9 @@ bootloader-configuration-additional-configuration =20 %bootloaders - lookup-bootloader-by-name)) + lookup-bootloader-by-name + + bootloader-chain)) =20 ^L ;;; @@ -227,3 +231,122 @@ record." (eq? name (bootloader-name bootloader))) (force %bootloaders)) (leave (G_ "~a: no such bootloader~%") name))) + +(define (bootloader-profile files bootloader-package hook) + "Creates a profile with BOOTLOADER-PACKAGE and a directory = collection/ with +links to additional FILES from the store. This collection is meant to = be used +by the bootloader installer. + +FILES is a list of file or directory names from the store, which will = be +symlinked into the collection/ directory. If a directory name ends = with '/', +then the directory content instead of the directory itself will be = symlinked +into the collection/ directory. + +FILES may contain file like objects produced by functions like = plain-file, +local-file, etc., or package contents produced with file-append." + (define (bootloader-collection manifest) + (define build + (with-imported-modules '((guix build utils) + (ice-9 ftw) + (srfi srfi-1) + (srfi srfi-26)) + #~(begin + (use-modules ((guix build utils) + #:select (mkdir-p strip-store-file-name)) + ((ice-9 ftw) + #:select (scandir)) + ((srfi srfi-1) + #:select (append-map every remove)) + ((srfi srfi-26) + #:select (cut))) + (define (symlink-to file directory transform) + "Creates a symlink to FILE named (TRANSFORM FILE) in = DIRECTORY." + (symlink file (string-append directory "/" (transform = file)))) + (define (directory-content directory) + "Creates a list of absolute path names inside DIRECTORY." + (map (lambda (name) + (string-append directory name)) + (or (scandir directory (lambda (name) + (not (member name '("." = ".."))))) + '()))) + (define name-ends-with-/? (cut string-suffix? "/" <>)) + (define (name-is-store-entry? name) + "Return #t if NAME is a direct store entry and nothing = inside." + (not (string-index (strip-store-file-name name) #\/))) + (let* ((collection (string-append #$output "/collection")) + (files '#$files) + (directories (filter name-ends-with-/? files)) + (names-from-directories + (append-map (lambda (directory) + (directory-content directory)) + directories)) + (names (append names-from-directories + (remove name-ends-with-/? files)))) + (mkdir-p collection) + (if (every file-exists? names) + (begin + (for-each (lambda (name) + (symlink-to name collection + (if (name-is-store-entry? = name) + strip-store-file-name + basename))) + names) + #t) + #f))))) + + (gexp->derivation "bootloader-collection" + build + #:local-build? #t + #:substitutable? #f + #:properties + `((type . profile-hook) + (hook . bootloader-collection)))) + + (profile (content (packages->manifest (list bootloader-package))) + (name "bootloader-profile") + (hooks (append (list bootloader-collection) + (or hook '()))) + (locales? #f) + (allow-collisions? #f) + (relative-symlinks? #f))) + +(define* (bootloader-chain files + final-bootloader + #:key + hook + installer) + "Defines a bootloader chain with FINAL-BOOTLOADER as the final = bootloader and +certain directories and files from the store given in the list of = FILES. + +FILES may contain file like objects produced by functions like = plain-file, +local-file, etc., or package contents produced with file-append. They = will be +collected inside a directory collection/ inside a generated bootloader = profile, +which will be passed to the INSTALLER. + +If a directory name in FILES ends with '/', then the directory content = instead +of the directory itself will be symlinked into the collection/ = directory. + +The PROFILE-HOOK function can be used to further modify the bootloader = profile. + +If the INSTALLER argument is used, then this function will be called to = install +the bootloader. Otherwise the installer of the FINAL-BOOTLOADER will be = called. + +Independent of the INSTALLER argument, all files in the mentioned = collection/ +directory of the bootloader profile will be copied into the bootloader = target +directory after the actual bootloader installer has been called." + (let* ((final-installer (or installer + (bootloader-installer final-bootloader))) + (profile (bootloader-profile files + (bootloader-package = final-bootloader) + hook))) + (bootloader + (inherit final-bootloader) + (package profile) + (installer + #~(lambda (bootloader target mount-point) + (#$final-installer bootloader target mount-point) + (copy-recursively + (string-append bootloader "/collection") + (string-append mount-point target) + #:follow-symlinks? #t + #:log (%make-void-port "w"))))))) --=20 2.26.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 26 06:37:50 2020 Received: (at 41066) by debbugs.gnu.org; 26 Oct 2020 10:37:50 +0000 Received: from localhost ([127.0.0.1]:38565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWzss-0004EF-GN for submit@debbugs.gnu.org; Mon, 26 Oct 2020 06:37:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWzsr-0004E3-HU for 41066@debbugs.gnu.org; Mon, 26 Oct 2020 06:37:49 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51867) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kWzsj-0000mx-Qa; Mon, 26 Oct 2020 06:37:42 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=60778 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kWzsh-0005My-NI; Mon, 26 Oct 2020 06:37:41 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Danny Milosavljevic Subject: Re: [PATCH] gnu: bootloader: Support for chain loading. References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201022194630.597302a2@scratchpost.org> <87eelpp0pn.fsf@gnu.org> <20201024033051.00720ac1@scratchpost.org> <87a6wbiofb.fsf@gnu.org> <20201025023345.73d515d2@scratchpost.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 5 Brumaire an 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 26 Oct 2020 11:37:37 +0100 In-Reply-To: <20201025023345.73d515d2@scratchpost.org> (Danny Milosavljevic's message of "Sun, 25 Oct 2020 02:33:45 +0200") Message-ID: <87h7qhclxq.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41066 Cc: Stefan , Mathieu Othacehe , 41066@debbugs.gnu.org, Efraim Flashner , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Danny Milosavljevic skribis: >> Sorry, I don=E2=80=99t see why this prevents an API that more closely ma= tches >> the idea of a chain of bootloaders (but perhaps I=E2=80=99d just need to= spend >> more time studying this.) > > It doesn't prevent that API--but this narrow use case here doesn't need i= t. > > And I do not intend to implement the general use case--we all decided aga= inst > general chainloading and then introduced full support for bootloaders oth= er > than grub (which then do not chainload grub--they totally could have!). > > But this use case with lots of bootloaders on an ESP partition (or Raspbe= rry Pi > equivalent) is easy enough. Maybe we should change the name of the main > procedure to be less general, though. "chain-esp-bootloaders" ? > > If you could check it out more, that would help. I think how the patch is > now is fine for the narrow use case: chainloading the normal guix bootloa= der > using other bootloaders (or whatever else! Maybe a turtle is loading the= final > guix bootloader--who knows ;) ). > > The code here can only chain bootloaders in the ESP partition (actually, = the > Raspberry Pi equivalent of the latter). Oh got it, I thought it was about bootloader chaining =E2=80=9Cin general= =E2=80=9D, apologies for the confusion! > From the patch: > >>+(define (bootloader-profile packages package-contents files) >>[...] >>+ (profile (content (packages->manifest packages)) >>+ (name "bootloader-profile") >>+ (hooks (list bootloader-collection)) >>+ (locales? #f) >>+ (allow-collisions? #f) >>+ (relative-symlinks? #f))) > > Maybe I don't understand what you mean... but that "profile" is from > (guix profiles). Oops, you=E2=80=99re right; my bad! > In any case, maybe we should just call it "esp-bootloader-chain" or > maybe just "raspberry-pi-bootloader-chain". Yes, maybe that=E2=80=99d be clearer (perhaps the former, unless there=E2= =80=99s something really RPi-specific). Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 02 10:42:31 2020 Received: (at 41066) by debbugs.gnu.org; 2 Nov 2020 15:42:31 +0000 Received: from localhost ([127.0.0.1]:42210 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZbyZ-0003Jt-1q for submit@debbugs.gnu.org; Mon, 02 Nov 2020 10:42:31 -0500 Received: from dd26836.kasserver.com ([85.13.145.193]:35568) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZbyW-0003Jk-Vh for 41066@debbugs.gnu.org; Mon, 02 Nov 2020 10:42:29 -0500 Received: from localhost (80-110-126-103.cgn.dynamic.surfer.at [80.110.126.103]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 4934A3367C80; Mon, 2 Nov 2020 16:42:27 +0100 (CET) Date: Mon, 2 Nov 2020 16:42:24 +0100 From: Danny Milosavljevic To: Mathieu Othacehe Subject: Re: [PATCH] gnu: bootloader: Support for chain loading. Message-ID: <20201102164224.6f745693@scratchpost.org> In-Reply-To: <0DCDD4B0-DC4B-4870-B018-D771C509F9E5@vodafonemail.de> References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201022194630.597302a2@scratchpost.org> <87eelpp0pn.fsf@gnu.org> <20201024033051.00720ac1@scratchpost.org> <87a6wbiofb.fsf@gnu.org> <20201025023345.73d515d2@scratchpost.org> <4FACB9F5-2A1E-45B5-A53F-42F0E098CEAA@vodafonemail.de> <0DCDD4B0-DC4B-4870-B018-D771C509F9E5@vodafonemail.de> X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/sj8HW5XncAJ9QH=SGW2fvh_"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41066 Cc: Stefan , 41066@debbugs.gnu.org, Ludovic =?ISO-8859-1?Q?Court=E8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Sig_/sj8HW5XncAJ9QH=SGW2fvh_ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Mathieu, I've tried to test Stefan's patch on guix master with this configuration: (use-modules (gnu)) (use-service-modules networking ssh) (use-package-modules screen ssh bootloaders) (operating-system (host-name "komputilo") (timezone "Europe/Berlin") (locale "en_US.utf8") (bootloader (bootloader-configuration (bootloader (efi-bootloader-chain (list ;(file-append firmware "/boot/") (plain-file "config.txt" "kernel=3Du-boot.bin") (file-append u-boot-a20-olinuxino-micro "/libexec/u-boot.bin")) grub-efi-netboot-bootloader ;#:hook my-special-bootloader-profile-manipulator #:installer (install-grub-efi-netboot "efi/boot"))) (target "/boot"))) (file-systems (cons (file-system (device (file-system-label "my-root")) (mount-point "/") (type "ext4")) %base-file-systems)) (users (cons (user-account (name "alice") (comment "Bob's sister") (group "users") (supplementary-groups '("wheel" "audio" "video"))) %base-user-accounts)) (packages (cons screen %base-packages)) (services (append (list (service dhcp-client-service-type) (service openssh-service-type (openssh-configuration (openssh openssh-sans-x) (port-number 2222)))) %base-services))) and this command: $ ./pre-inst-env guix system disk-image -t raw raspberry-os.scm And I get this error: ################################################## ]^MESC[Kregistering 296 = items [######################################################]^MESC[Kregis= tering 296 items Backtrace: 5 (primitive-load "/gnu/store/br73py6l6w1x2p0ankqq9d8il4f=E2=80= =A6") In ice-9/eval.scm: 619:8 4 (_ #(# #= =E2=80=A6)) In ./gnu/build/image.scm: 208:4 3 (initialize-root-partition "tmp-root" #:bootcfg _ # _ # =E2=80= =A6) In ice-9/eval.scm: 619:8 2 (_ #(#(#) "/gnu=E2=80=A6"= =E2=80=A6)) 293:34 1 (_ #(#(#) "/gnu=E2=80=A6"= =E2=80=A6)) In unknown file: 0 (string-append "tmp-root" #f "/") ERROR: In procedure string-append: In procedure string-append: Wrong type (expecting string): #f environment variable `PATH' set to `/gnu/store/swwd2i26pqx1jyfg81lrnrw1hq7a= dn05-e2fsprogs-1.45.6/bin:/gnu/store/swwd2i26pqx1jyfg81lrnrw1hq7adn05-e2fsp= rogs-1.45.6/sbin:/gnu/store/ppv9hd6mznmf1p4gagnrwzdivfhvc48z-fakeroot-1.25.= 3/bin:/gnu/store/nqynh6b3jhjh6wiq47jr4l6arckfw9j8-dosfstools-4.1/sbin:/gnu/= store/zms4y35fpbpz5mr8qcb7ky8sqqnq61kh-mtools-4.0.25/bin' installing bootloader... [fails] Before I search for it, would you know why it is? --Sig_/sj8HW5XncAJ9QH=SGW2fvh_ Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl+gKOAACgkQ5xo1VCww uqU7QggAk5FY2VK69a/sxWx0v85pmKq9sIYURROqhIqrLKs2XXjK20yFKRvL3/AX Z6+qlkiMdqUZ+oPqb9AjdMy4DmOBXRgcf3UsGcuA6yqLSiX3DrIpZV5wOzia0rvy y157QjtItg0kl9ykPxGm+ODd/fcoGsg1bjU1lN0EYOgJjb82X3Rq9x+8H7GXsiC7 tk7eJGnrQByhkB4DRkqwVchP62+wgWds1XrMgJB8C06nMHqcLpyBG/EJJbbJMBbA Tt+jJDzkM6pMdiN7FWpsKccD9/T3DdJl1zkTi/ZFXztWHhyF4JXR1jr0SEGSdZnU bYUiZwKCGFnYSnveipQd4NOcbyFPDw== =aM4P -----END PGP SIGNATURE----- --Sig_/sj8HW5XncAJ9QH=SGW2fvh_-- From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 02 11:21:16 2020 Received: (at 41066) by debbugs.gnu.org; 2 Nov 2020 16:21:16 +0000 Received: from localhost ([127.0.0.1]:42355 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZca4-0000Dg-EC for submit@debbugs.gnu.org; Mon, 02 Nov 2020 11:21:16 -0500 Received: from mail-wr1-f49.google.com ([209.85.221.49]:45472) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZca2-0000DS-WB for 41066@debbugs.gnu.org; Mon, 02 Nov 2020 11:21:15 -0500 Received: by mail-wr1-f49.google.com with SMTP id a9so15276606wrg.12 for <41066@debbugs.gnu.org>; Mon, 02 Nov 2020 08:21:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=i3xEpcjZdjlh5XvMhtZWj0FHLBu/JEX/LzKeU2uApAA=; b=Yb0lRzLsz564bO6DkuF7ZXqMh1DPom+eH6lSdavZNcgmd0Bzzo2cCSEe2ypKsNk9hR 4C2gfA4x2AIfwk4HyCoIHoEVWGE3FklY9lFoAIB/Wn2VjtLD0GnoFb6eUI8GPHapQMGP 9QkqCfFpxRKSN2URmudozKq8AHEoADY2Qy8TBo5Ec4CdQLOZXn5sxNoKTbm6PESPtTel umuHW8AkP/Pj01PMMsGn0ChMi46C9n3r2ojMwFFol9CLIWgrRc1EWYZI35MahcvrduhC A10x/wOipFQ0MYKBfga6Knpohx96ifXap4n4GAJ/f14abVNuujK5zQkpNH8zvL/5Jt7W 106A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=i3xEpcjZdjlh5XvMhtZWj0FHLBu/JEX/LzKeU2uApAA=; b=FsnpisKYT8yp5hCauSITAtom4OuIC6Ry/Hq8gHXHsRdkeL3e4gMlc6792AM86l6+FQ 9lbGmhyVBmsEYc2/faV5wJZ0mw3Qp8J+eWiMvtJQBaMbIwaZyI1WdaLA5JoYFcPijI7p FyNlXdHzlHTh6tcIxtM9+YrPa7O43A5o7MonNGnqzugr93lXJagCQ83ivn4NdcE23hN3 EppMgFX0vBMYCkxfDGL9MqXZJenb2UCU3ZpmNjHrFzxxGCdJRF9NMdwfRRSlNKft5gR1 QS/kEu11OdDQMixY75PPqZrejbmMGNzMnjiyyUjAHN0HR8wjcb93z/ckGjdhyV5qUkB8 Rx2w== X-Gm-Message-State: AOAM531PlVV2KhG29RPuDbkScFFHEz91n1MnlYt5a++4nDdRej33QQ6g CG1hKnWdf4dczzTHHrvYzIM6cZmh+KUrog== X-Google-Smtp-Source: ABdhPJyIBjBkIpgzjyvj5f8azI761kE/BGdvhouupzP1AIVqjeAmeoHll0fE+9m/ydPe4sh2JkRO5w== X-Received: by 2002:a5d:5743:: with SMTP id q3mr21030622wrw.167.1604334068691; Mon, 02 Nov 2020 08:21:08 -0800 (PST) Received: from cervin ([2a01:e0a:19b:d9a0:1813:def9:2dcb:55f0]) by smtp.gmail.com with ESMTPSA id t1sm22094454wrs.48.2020.11.02.08.21.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Nov 2020 08:21:07 -0800 (PST) From: Mathieu Othacehe To: Danny Milosavljevic Subject: Re: [PATCH] gnu: bootloader: Support for chain loading. References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201022194630.597302a2@scratchpost.org> <87eelpp0pn.fsf@gnu.org> <20201024033051.00720ac1@scratchpost.org> <87a6wbiofb.fsf@gnu.org> <20201025023345.73d515d2@scratchpost.org> <4FACB9F5-2A1E-45B5-A53F-42F0E098CEAA@vodafonemail.de> <0DCDD4B0-DC4B-4870-B018-D771C509F9E5@vodafonemail.de> <20201102164224.6f745693@scratchpost.org> Date: Mon, 02 Nov 2020 17:21:07 +0100 In-Reply-To: <20201102164224.6f745693@scratchpost.org> (Danny Milosavljevic's message of "Mon, 2 Nov 2020 16:42:24 +0100") Message-ID: <87a6vzbuh8.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 41066 Cc: Stefan , 41066@debbugs.gnu.org, Ludovic =?utf-8?Q?Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Danny, > $ ./pre-inst-env guix system disk-image -t raw raspberry-os.scm The image types are not yet properly documented. However, the "raw" image type corresponds to a raw image built for the current architecture. Using something like: --8<---------------cut here---------------start------------->8--- ./pre-inst-env guix system disk-image -t arm32-raw raspberry-os.scm --8<---------------cut here---------------end--------------->8--- should cross-compile an image targeting an ARM32 architecture (since commit c0458011). Thanks, Mathieu From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 03 04:07:49 2020 Received: (at 41066) by debbugs.gnu.org; 3 Nov 2020 09:07:49 +0000 Received: from localhost ([127.0.0.1]:43364 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZsI9-0007yr-5t for submit@debbugs.gnu.org; Tue, 03 Nov 2020 04:07:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56872) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZsI7-0007yf-Rf for 41066@debbugs.gnu.org; Tue, 03 Nov 2020 04:07:48 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:39757) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZsHz-0006Mf-Vu; Tue, 03 Nov 2020 04:07:40 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=57914 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kZsHy-0000Ht-0w; Tue, 03 Nov 2020 04:07:38 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Mathieu Othacehe Subject: Re: [PATCH] gnu: bootloader: Support for chain loading. References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201022194630.597302a2@scratchpost.org> <87eelpp0pn.fsf@gnu.org> <20201024033051.00720ac1@scratchpost.org> <87a6wbiofb.fsf@gnu.org> <20201025023345.73d515d2@scratchpost.org> <4FACB9F5-2A1E-45B5-A53F-42F0E098CEAA@vodafonemail.de> <0DCDD4B0-DC4B-4870-B018-D771C509F9E5@vodafonemail.de> <20201102164224.6f745693@scratchpost.org> <87a6vzbuh8.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 13 Brumaire an 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 03 Nov 2020 10:07:35 +0100 In-Reply-To: <87a6vzbuh8.fsf@gmail.com> (Mathieu Othacehe's message of "Mon, 02 Nov 2020 17:21:07 +0100") Message-ID: <87lffihkq0.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41066 Cc: Stefan , Danny Milosavljevic , 41066@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Mathieu Othacehe skribis: >> $ ./pre-inst-env guix system disk-image -t raw raspberry-os.scm > > The image types are not yet properly documented. However, the "raw" > image type corresponds to a raw image built for the current > architecture. > > Using something like: > > ./pre-inst-env guix system disk-image -t arm32-raw raspberry-os.scm > > should cross-compile an image targeting an ARM32 architecture (since > commit c0458011). Ah so =E2=80=98-s=E2=80=99 and =E2=80=98--target=E2=80=99 are overridden by= the image type? Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 03 04:32:26 2020 Received: (at 41066) by debbugs.gnu.org; 3 Nov 2020 09:32:26 +0000 Received: from localhost ([127.0.0.1]:43437 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZsfx-0000CK-TM for submit@debbugs.gnu.org; Tue, 03 Nov 2020 04:32:26 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:36454) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZsfw-0000C0-Ah for 41066@debbugs.gnu.org; Tue, 03 Nov 2020 04:32:24 -0500 Received: by mail-wr1-f67.google.com with SMTP id x7so17729983wrl.3 for <41066@debbugs.gnu.org>; Tue, 03 Nov 2020 01:32:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=dz5nNupMTNfB8bRd8AwToJyZ2MzSbnPlmOuSRFPAiGc=; b=qJ0iG7LVRVA2e5/OmLj4wJrbhTizK8+Po4EkffQEX62R4jkUYFdVQkzc6CzDsN8ak6 Upz3z667X0CX5XVZ5YgJJlmjPiDO8rmsilh7J57S4aHS3TKTX5Hl6A0F1JNjogtNNr+a YgItCTF9wdrULaEqCRE1K2F4mkER3UZJNTlnJDzYQf6NK5Fi7IDPvf7ZGO5LNFnumdfM 7UbDTQiNjM2Vec2N1Q+UrqlQKJ2J4DU5+G6QSc8Mp+b1Prs4noJtzriOUH9Qjkqz+Lim uaO5CK7KNZiyXFRMkT9iLGE7VtUJNi04QTZ7LycKCf5tYnt+BbnefHN93iFciNSpwEDv qjyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=dz5nNupMTNfB8bRd8AwToJyZ2MzSbnPlmOuSRFPAiGc=; b=AtYVcjx14tv9TR3MH1aC8h1LlKg2WSTkd5az/JaRK+pJwhJJJ67Ox7BSSp2EkZv88y 1fE7ny+n4NjEchJtpTsy0HMUArXJ6HXrCUg4TWV3sj/0dsgo7cYufV9dl0tcv+2kMEth qHb7ul63fvGkckzGR6muLl9rZ3OXOXBtVwGOS2CalVPYUDfZDrqL4/24MzeV+aBuv4bw hAlLA3hSE8KvpU1vFzT8lNlRUCaTU1ec71IlM3spQSgFttCKxoxslvabTB+5Xs8uUBNP 73c3+aEzPfnoVKg9RmBUMoi+2FE7mkJdKAhNthkf1/dNGvYM/5AwgUt5j5xrfTjB9Cce zs1w== X-Gm-Message-State: AOAM532Bh4nYGyTikeYMLJupe5CsBM4h111HtMah6FiHuAxh9XCflGk4 Ioi4Fxo0Lvul68gCIZmJGTzEJB0BTZt5Kw== X-Google-Smtp-Source: ABdhPJyCL19GXaQoMJ8aKkefL8aNH+hNiXq7JHzD7O75OB+RhgMh7J0tbvB2GuAduNudSAhui09QYg== X-Received: by 2002:a05:6000:1251:: with SMTP id j17mr20858799wrx.425.1604395938220; Tue, 03 Nov 2020 01:32:18 -0800 (PST) Received: from cervin ([2a01:e0a:19b:d9a0:18fc:abbb:ba3a:b87e]) by smtp.gmail.com with ESMTPSA id w1sm15080658wro.44.2020.11.03.01.32.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Nov 2020 01:32:17 -0800 (PST) From: Mathieu Othacehe To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [PATCH] gnu: bootloader: Support for chain loading. References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201022194630.597302a2@scratchpost.org> <87eelpp0pn.fsf@gnu.org> <20201024033051.00720ac1@scratchpost.org> <87a6wbiofb.fsf@gnu.org> <20201025023345.73d515d2@scratchpost.org> <4FACB9F5-2A1E-45B5-A53F-42F0E098CEAA@vodafonemail.de> <0DCDD4B0-DC4B-4870-B018-D771C509F9E5@vodafonemail.de> <20201102164224.6f745693@scratchpost.org> <87a6vzbuh8.fsf@gmail.com> <87lffihkq0.fsf@gnu.org> Date: Tue, 03 Nov 2020 10:32:16 +0100 In-Reply-To: <87lffihkq0.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Tue, 03 Nov 2020 10:07:35 +0100") Message-ID: <871rhaiy5b.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 41066 Cc: Stefan , Danny Milosavljevic , 41066@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hey, > Ah so =E2=80=98-s=E2=80=99 and =E2=80=98--target=E2=80=99 are overridden = by the image type? If a "target" is set in the "image" definition then yes it overrides "--target", otherwise "--target" is honored. This is handled by the following snippet: --8<---------------cut here---------------start------------->8--- (let* ((base-image (os->image os #:type image-type)) (base-target (image-target base-image))) (lower-object (system-image (image (inherit (if label (image-with-label base-image label) base-image)) (target (or base-target target)) (size image-size) (operating-system os)))))) --8<---------------cut here---------------end--------------->8--- There's no particular heuristic for "--system". Mathieu From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 07 16:15:15 2020 Received: (at 41066) by debbugs.gnu.org; 7 Nov 2020 21:15:15 +0000 Received: from localhost ([127.0.0.1]:59333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kbVYJ-0000lV-84 for submit@debbugs.gnu.org; Sat, 07 Nov 2020 16:15:15 -0500 Received: from vsmx011.vodafonemail.xion.oxcs.net ([153.92.174.89]:40565) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kbVYH-0000lI-Lb for 41066@debbugs.gnu.org; Sat, 07 Nov 2020 16:15:14 -0500 Received: from vsmx003.vodafonemail.xion.oxcs.net (unknown [192.168.75.197]) by mta-5-out.mta.xion.oxcs.net (Postfix) with ESMTP id 8047859D0AB; Sat, 7 Nov 2020 21:15:07 +0000 (UTC) Received: from macbook-pro.kuh-wiese.my-router.de (unknown [2.206.141.249]) by mta-7-out.mta.xion.oxcs.net (Postfix) with ESMTPA id 8F12D539A08; Sat, 7 Nov 2020 21:14:58 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [PATCH] gnu: bootloader: Support for chain loading. From: Stefan In-Reply-To: <871rhaiy5b.fsf@gmail.com> Date: Sat, 7 Nov 2020 22:14:57 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <406E80FD-A5E2-4DB5-AC9C-809B1285F775@vodafonemail.de> References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201022194630.597302a2@scratchpost.org> <87eelpp0pn.fsf@gnu.org> <20201024033051.00720ac1@scratchpost.org> <87a6wbiofb.fsf@gnu.org> <20201025023345.73d515d2@scratchpost.org> <4FACB9F5-2A1E-45B5-A53F-42F0E098CEAA@vodafonemail.de> <0DCDD4B0-DC4B-4870-B018-D771C509F9E5@vodafonemail.de> <20201102164224.6f745693@scratchpost.org> <87a6vzbuh8.fsf@gmail.com> <87lffihkq0.fsf@gnu.org> <871rhaiy5b.fsf@gmail.com> To: Danny Milosavljevic , 41066@debbugs.gnu.org X-Mailer: Apple Mail (2.3124) X-VADE-STATUS: LEGIT X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41066 Cc: =?utf-8?Q?Ludovic_Court=C3=A8s?= , Mathieu Othacehe X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi! I did some more improvements to my previous patch. Before copying files, it makes sense to check if the bootloader target = is actually a directory. Also there is the convention for bootloader = installer to check e.g. /mnt/boot/efi for existence and to prefer it = over /boot/efi. If someone implements an own installer procedure, then that installer = gets the bootloader profile passed and may handle the files collection = already, in which case copying them afterwards into the target directory = is not wanted any more. So I added a #:copy-files? option to prevent = copying files, but defaulting to #t. For the generation of a profile a list of hooks is expected. I changed = the #:hook option to be a #:hooks option and allow a single procedure = and a list of procedures. Sch=C3=BCss Stefan= From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 07 16:16:10 2020 Received: (at 41066) by debbugs.gnu.org; 7 Nov 2020 21:16:11 +0000 Received: from localhost ([127.0.0.1]:59337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kbVZC-0000nI-IQ for submit@debbugs.gnu.org; Sat, 07 Nov 2020 16:16:10 -0500 Received: from mx009.vodafonemail.xion.oxcs.net ([153.92.174.39]:6392) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kbVZB-0000n6-4D for 41066@debbugs.gnu.org; Sat, 07 Nov 2020 16:16:09 -0500 Received: from vsmx002.vodafonemail.xion.oxcs.net (unknown [192.168.75.192]) by mta-6-out.mta.xion.oxcs.net (Postfix) with ESMTP id A5B566045B0; Sat, 7 Nov 2020 21:16:03 +0000 (UTC) Received: from macbook-pro.kuh-wiese.my-router.de (unknown [2.206.141.249]) by mta-6-out.mta.xion.oxcs.net (Postfix) with ESMTPA id AAE05604047; Sat, 7 Nov 2020 21:15:54 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [PATCH] gnu: bootloader: Support for chain loading. From: Stefan In-Reply-To: <406E80FD-A5E2-4DB5-AC9C-809B1285F775@vodafonemail.de> Date: Sat, 7 Nov 2020 22:15:53 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201022194630.597302a2@scratchpost.org> <87eelpp0pn.fsf@gnu.org> <20201024033051.00720ac1@scratchpost.org> <87a6wbiofb.fsf@gnu.org> <20201025023345.73d515d2@scratchpost.org> <4FACB9F5-2A1E-45B5-A53F-42F0E098CEAA@vodafonemail.de> <0DCDD4B0-DC4B-4870-B018-D771C509F9E5@vodafonemail.de> <20201102164224.6f745693@scratchpost.org> <87a6vzbuh8.fsf@gmail.com> <87lffihkq0.fsf@gnu.org> <871rhaiy5b.fsf@gmail.com> <406E80FD-A5E2-4DB5-AC9C-809B1285F775@vodafonemail.de> To: Danny Milosavljevic , 41066@debbugs.gnu.org X-Mailer: Apple Mail (2.3124) X-VADE-STATUS: LEGIT X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41066 Cc: =?utf-8?Q?Ludovic_Court=C3=A8s?= , Mathieu Othacehe X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/bootloader.scm (bootloader-profile): New internal function to = build a profile from a package and a collection of files to install. (bootloader-chain): New function to chain a bootloader with a collection = of additional files like other bootloaders, configuration files or = device-trees. This allows to chain GRUB with U-Boot, device-tree-files, plain = configuration files, etc. mainly for single-board-computers like this: (operating-system (bootloader (bootloader-configuration (bootloader (bootloader-chain (list (file-append firmware "/boot/") (file-append u-boot-my-scb "/libexec/u-boot.bin") (plain-file "config.txt" "kernel=3Du-boot.bin")) grub-efi-netboot-bootloader #:hooks my-special-bootloader-profile-manipulator #:installer (install-grub-efi-netboot "efi/boot") #:copy-files? #t) (target "/boot")))) =E2=80=A6) --- gnu/bootloader.scm | 139 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 138 insertions(+), 1 deletion(-) diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm index 2eebb8e9d9..fe51c90743 100644 --- a/gnu/bootloader.scm +++ b/gnu/bootloader.scm @@ -22,6 +22,8 @@ =20 (define-module (gnu bootloader) #:use-module (guix discovery) + #:use-module (guix gexp) + #:use-module (guix profiles) #:use-module (guix records) #:use-module (guix ui) #:use-module (srfi srfi-1) @@ -66,7 +68,9 @@ bootloader-configuration-additional-configuration =20 %bootloaders - lookup-bootloader-by-name)) + lookup-bootloader-by-name + + bootloader-chain)) =20 ^L ;;; @@ -227,3 +231,136 @@ record." (eq? name (bootloader-name bootloader))) (force %bootloaders)) (leave (G_ "~a: no such bootloader~%") name))) + +(define (bootloader-profile files bootloader-package hooks) + "Creates a profile with BOOTLOADER-PACKAGE and a directory = collection/ with +links to additional FILES from the store. This collection is meant to = be used +by the bootloader installer. + +FILES is a list of file or directory names from the store, which will = be +symlinked into the collection/ directory. If a directory name ends = with '/', +then the directory content instead of the directory itself will be = symlinked +into the collection/ directory. + +FILES may contain file like objects produced by functions like = plain-file, +local-file, etc., or package contents produced with file-append. + +HOOKS lists additional hook functions to modify the profile." + (define (bootloader-collection manifest) + (define build + (with-imported-modules '((guix build utils) + (ice-9 ftw) + (srfi srfi-1) + (srfi srfi-26)) + #~(begin + (use-modules ((guix build utils) + #:select (mkdir-p strip-store-file-name)) + ((ice-9 ftw) + #:select (scandir)) + ((srfi srfi-1) + #:select (append-map every remove)) + ((srfi srfi-26) + #:select (cut))) + (define (symlink-to file directory transform) + "Creates a symlink to FILE named (TRANSFORM FILE) in = DIRECTORY." + (symlink file (string-append directory "/" (transform = file)))) + (define (directory-content directory) + "Creates a list of absolute path names inside DIRECTORY." + (map (lambda (name) + (string-append directory name)) + (or (scandir directory (lambda (name) + (not (member name '("." = ".."))))) + '()))) + (define name-ends-with-/? (cut string-suffix? "/" <>)) + (define (name-is-store-entry? name) + "Return #t if NAME is a direct store entry and nothing = inside." + (not (string-index (strip-store-file-name name) #\/))) + (let* ((collection (string-append #$output "/collection")) + (files '#$files) + (directories (filter name-ends-with-/? files)) + (names-from-directories + (append-map (lambda (directory) + (directory-content directory)) + directories)) + (names (append names-from-directories + (remove name-ends-with-/? files)))) + (mkdir-p collection) + (if (every file-exists? names) + (begin + (for-each (lambda (name) + (symlink-to name collection + (if (name-is-store-entry? = name) + strip-store-file-name + basename))) + names) + #t) + #f))))) + + (gexp->derivation "bootloader-collection" + build + #:local-build? #t + #:substitutable? #f + #:properties + `((type . profile-hook) + (hook . bootloader-collection)))) + + (profile (content (packages->manifest (list bootloader-package))) + (name "bootloader-profile") + (hooks (append (list bootloader-collection) hooks)) + (locales? #f) + (allow-collisions? #f) + (relative-symlinks? #f))) + +(define* (bootloader-chain files + final-bootloader + #:key + (hooks '()) + installer + (copy-files? #t)) + "Defines a bootloader chain with FINAL-BOOTLOADER as the final = bootloader and +certain directories and files from the store given in the list of = FILES. + +FILES may contain file like objects produced by functions like = plain-file, +local-file, etc., or package contents produced with file-append. They = will be +collected inside a directory collection/ inside a generated bootloader = profile, +which will be passed to the INSTALLER. + +If a directory name in FILES ends with '/', then the directory content = instead +of the directory itself will be symlinked into the collection/ = directory. + +The functions in the HOOKS list can be used to further modify the = bootloader +profile. It is possible to pass a single function instead of a list. + +If the INSTALLER argument is used, then this function will be called to = install +the bootloader. Otherwise the installer of the FINAL-BOOTLOADER will = be called. + +If COPY-FILES? is #t and the bootloader target is a directory, then all = files in +the mentioned collection/ directory of the bootloader profile will be = copied +into the bootloader target directory after the bootloader installer has = been +called. Otherwise the /collection content is left for use by the = INSTALLER." + (let* ((final-installer (or installer + (bootloader-installer final-bootloader))) + (profile (bootloader-profile files + (bootloader-package = final-bootloader) + (if (list? hooks) + hooks + (list hooks))))) + (bootloader + (inherit final-bootloader) + (package profile) + (installer + #~(lambda (bootloader target mount-point) + (#$final-installer bootloader target mount-point) + (when #$copy-files? + (let* ((mount-point/target (string-append mount-point = target)) + ;; When installing Guix, it's common to mount TARGET = below + ;; MOUNT-POINT rather than below the root directory. + (bootloader-target (if (file-exists? = mount-point/target) + mount-point/target + target))) + (when (eq? (and=3D> (stat bootloader-target #f) stat:type) + 'directory) + (copy-recursively (string-append bootloader = "/collection") + bootloader-target + #:follow-symlinks? #t + #:log (%make-void-port "w")))))))))) --=20 2.26.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 16 04:33:50 2020 Received: (at 41066-done) by debbugs.gnu.org; 16 Nov 2020 09:33:50 +0000 Received: from localhost ([127.0.0.1]:55079 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1keatS-0001os-8q for submit@debbugs.gnu.org; Mon, 16 Nov 2020 04:33:50 -0500 Received: from dd26836.kasserver.com ([85.13.145.193]:57432) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1keatQ-0001oj-F0 for 41066-done@debbugs.gnu.org; Mon, 16 Nov 2020 04:33:48 -0500 Received: from localhost (80-110-126-103.cgn.dynamic.surfer.at [80.110.126.103]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 178563363BA3; Mon, 16 Nov 2020 10:33:47 +0100 (CET) Date: Mon, 16 Nov 2020 10:33:46 +0100 From: Danny Milosavljevic To: Stefan Subject: Re: [PATCH] gnu: bootloader: Support for chain loading. Message-ID: <20201116103346.55ff8422@scratchpost.org> In-Reply-To: <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/RbKBut/G83vs.T0VWevc6mM"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41066-done Cc: 41066-done@debbugs.gnu.org, Mathieu Othacehe , Efraim Flashner , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Sig_/RbKBut/G83vs.T0VWevc6mM Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Pushed to guix master as commit 74eeb11daee906cb012f10b6bb3afd254f9ea5c2, after renaming bootloader-chain to efi-bootloader-chain. --Sig_/RbKBut/G83vs.T0VWevc6mM Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl+yR3oACgkQ5xo1VCww uqXT6wf/SUj9+2bWe/Uj9Pbuiw1ZhG6RHk7z8iI0YOWhyP6sKOVNdwDIGHDzi0yy 0KPT3doONjRXY9JwCVP/rJB2aBcjXMCF3MQnJR1sE49aoOOnmO3alDep1h2KTwhk lXememkhEQBr4x7DXAZxG/6fu2AO+n8I2xFrmSrYLFbW7quC65pu1/PWmHWaQbHl wxL25XR9ZxpXl/hCwpKEiYb+vwXqZrDZ/K1WNiQcow0cOIIGsyijCqojVeZUc0p2 knbS5bU6apzPGi5nV1ORsz0UuctS7X+VFgS2qfrL5bueV3WsYBOHa5SH2SRtpfEn wavD5Vv3Z5qsKzJLg2Znhp7/xVpKqQ== =vI6i -----END PGP SIGNATURE----- --Sig_/RbKBut/G83vs.T0VWevc6mM-- From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 17 09:26:21 2020 Received: (at 41066-done) by debbugs.gnu.org; 17 Nov 2020 14:26:21 +0000 Received: from localhost ([127.0.0.1]:58756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kf1w5-0006XY-38 for submit@debbugs.gnu.org; Tue, 17 Nov 2020 09:26:21 -0500 Received: from vsmx012.vodafonemail.xion.oxcs.net ([153.92.174.90]:55816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kf1w2-0006XG-7M for 41066-done@debbugs.gnu.org; Tue, 17 Nov 2020 09:26:19 -0500 Received: from vsmx004.vodafonemail.xion.oxcs.net (unknown [192.168.75.198]) by mta-8-out.mta.xion.oxcs.net (Postfix) with ESMTP id 41625F353B8; Tue, 17 Nov 2020 14:26:12 +0000 (UTC) Received: from macbook-pro.kuh-wiese.my-router.de (unknown [145.254.41.84]) by mta-8-out.mta.xion.oxcs.net (Postfix) with ESMTPA id 86D7F19ADEC; Tue, 17 Nov 2020 14:26:01 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [PATCH] gnu: bootloader: Support for chain loading. From: Stefan In-Reply-To: <20201116103346.55ff8422@scratchpost.org> Date: Tue, 17 Nov 2020 15:26:00 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201116103346.55ff8422@scratchpost.org> To: Danny Milosavljevic X-Mailer: Apple Mail (2.3124) X-VADE-STATUS: LEGIT X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41066-done Cc: 41066-done@debbugs.gnu.org, Mathieu Othacehe , Efraim Flashner , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Danny! > Pushed to guix master as commit = 74eeb11daee906cb012f10b6bb3afd254f9ea5c2, > after renaming bootloader-chain to efi-bootloader-chain. You missed my last patch-set, unfortunately. Is it possible to push that = as well? https://lists.gnu.org/archive/html/guix-patches/2020-11/msg00212.html https://lists.gnu.org/archive/html/guix-patches/2020-11/msg00213.html Bye Stefan= From unknown Thu Jun 19 14:07:58 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: Did not alter fixed versions and reopened. Date: Tue, 17 Nov 2020 15:37:01 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # Did not alter fixed versions and reopened. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 17 10:48:01 2020 Received: (at 41066) by debbugs.gnu.org; 17 Nov 2020 15:48:01 +0000 Received: from localhost ([127.0.0.1]:60932 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kf3D6-0004ok-VU for submit@debbugs.gnu.org; Tue, 17 Nov 2020 10:48:01 -0500 Received: from dd26836.kasserver.com ([85.13.145.193]:47288) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kf3D5-0004oc-GU for 41066@debbugs.gnu.org; Tue, 17 Nov 2020 10:48:00 -0500 Received: from localhost (80-110-126-103.cgn.dynamic.surfer.at [80.110.126.103]) by dd26836.kasserver.com (Postfix) with ESMTPSA id D29453363365; Tue, 17 Nov 2020 16:47:57 +0100 (CET) Date: Tue, 17 Nov 2020 16:47:55 +0100 From: Danny Milosavljevic To: Stefan Subject: Re: [PATCH] gnu: bootloader: Support for chain loading. Message-ID: <20201117164755.1a27422b@scratchpost.org> In-Reply-To: References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201116103346.55ff8422@scratchpost.org> X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/13Pxte/5tFF31QVpcSmkxIC"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41066 Cc: 41066@debbugs.gnu.org, Mathieu Othacehe , Efraim Flashner , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Sig_/13Pxte/5tFF31QVpcSmkxIC Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Stefan, oops. I've reviewed and pushed the first part (s;HOOK;HOOKS;) now as guix master commit ede4117f7f18e118003f2599f5c8e985dfbdf9a5. But I'm not sure whether the COPY-FILES? thing is a nice API (and I mean no= t just the flag). I would prefer if the user would just change the INSTALLER in the case he w= ants to not use the profile (which is kinda weird?!) or pack it or whatever. In case the user wanted to index the profile content, the user would use a = HOOK to do that. It really depends on what exactly efi-bootloader-chain is being presented a= s. Is it a profile ? Then it shouldn't have weird flags like that--if possible--and instead use the standard methods. For example you could do instead (I cut&pasted to show the idea--untested!): (define* (efi-bootloader-chain files final-bootloader #:key (hooks '()) installer) (let* ((final-installer (or installer (lambda (bootloader target mount-point) ((bootloader-installer bootloader) bootload= er target mount-point) (let* ((mount-point/target (string-append mount-point target)) ;; When installing Guix, it's common to mount TARGET b= elow ;; MOUNT-POINT rather than below the root directory. (bootloader-target (if (file-exists? mount-point/targe= t) mount-point/target target))) (when (eq? (and=3D> (stat bootloader-target #f) stat:type) 'directory) (copy-recursively (string-append bootloader "/collection") bootloader-target #:follow-symlinks? #t #:log (%make-void-port "w"))))))))))))) (profile (efi-bootloader-profile files (bootloader-package final-bootloa= der) (if (list? hooks) hooks (list hooks))))) (bootloader (inherit final-bootloader) (package profile) (installer #~(lambda (bootloader target mount-point) (#$final-installer bootloader target mount-point)))) This way the weird flag COPY-FILES? is gone with no loss of functionality to the customizer. It's possible for the customizer to read the bootloader package (profile), so it's still possible to copy stuff if it's required (pass a custom INSTALLER which does the copying and also some custom installation). I have a few questions: (1) Why is there a $output/collection subdirectory? Is there something else than that in the profile output? =20 If there are no good reasons to do it like that, I'd just put the profile into $output directly instead--it's easier to understand, and also = it's how other profiles are being used. (2) The COPY-FILES? flag is kinda weird. I would prefer if INSTALLER just defaulted to a procedure that: does copy files, and then calls the final bootloader installer. If the user doesn't want it then the user could still pass a INSTALLER that doesn't (for example the user could pass #:installer (bootloader-installer final-bootloader)). (3) Why isn't the final bootloader installed last? I would have expected it to be installed last so that if it does packing of the profile contents in order to quickly find it at boot, it would have to have all the files of the profiles already, no? Could you explain what this is for in your use case? I don't yet understand the reason for this complexity. --Sig_/13Pxte/5tFF31QVpcSmkxIC Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl+z8KsACgkQ5xo1VCww uqWa5gf/VmU7x4rkms0UMJ6IWEzMb9yceeIDKu2HjNpFNE+ln2EE+MWmKqIa2YjL 3goybNtIQyuoThocU0ej2niTjZR0LFT7Bf3tENjYQyX+WKCrk01jM+F5jmoiNFNW g0vKB5KPrXB2hql6cZyEbpy0pviwNeGACjIY98z5Kv3Ufdv6l1Vuj1tJa8NJrdDe b3YLi8QqfjNNI+W/4V2yjbS13WutguqfvI4bDqiXFqd7347YIJzi9ovIhLK9izY7 1BqZ0YRGqoz6foLLbXPnEkqXtJn8jx08USx6Unib2QPETKjnF36JvKocn+xnQXKA 1od3TWJX1gafKkjdhy+Tg37ytJyKIg== =ut6R -----END PGP SIGNATURE----- --Sig_/13Pxte/5tFF31QVpcSmkxIC-- From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 17 11:17:33 2020 Received: (at 41066) by debbugs.gnu.org; 17 Nov 2020 16:17:33 +0000 Received: from localhost ([127.0.0.1]:60951 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kf3fh-0005WQ-HJ for submit@debbugs.gnu.org; Tue, 17 Nov 2020 11:17:33 -0500 Received: from dd26836.kasserver.com ([85.13.145.193]:49684) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kf3fe-0005W6-HY for 41066@debbugs.gnu.org; Tue, 17 Nov 2020 11:17:32 -0500 Received: from localhost (80-110-126-103.cgn.dynamic.surfer.at [80.110.126.103]) by dd26836.kasserver.com (Postfix) with ESMTPSA id BBCB93362BD4; Tue, 17 Nov 2020 17:17:28 +0100 (CET) Date: Tue, 17 Nov 2020 17:17:14 +0100 From: Danny Milosavljevic To: Stefan Subject: Re: [PATCH] gnu: bootloader: Support for chain loading. Message-ID: <20201117171714.4c44d169@scratchpost.org> In-Reply-To: <20201117164755.1a27422b@scratchpost.org> References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201116103346.55ff8422@scratchpost.org> <20201117164755.1a27422b@scratchpost.org> X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/NbWGRKJGx3YyWE49fQIEPYI"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41066 Cc: 41066@debbugs.gnu.org, Mathieu Othacehe , ludo@gnu.org, Efraim Flashner , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Sig_/NbWGRKJGx3YyWE49fQIEPYI Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Also, please keep in mind Ludo's suggestion of using the first class profil= es of G-Expressions. I'm not sure it's applicable in this case (!)--but still= , it would be nice, for a future version of raspberry efi netboot or of similar things, to be able to do this, right from config.scm: (operating-system (bootloader (bootloader-configuration (bootloader ; field in bootloader-configuration (bootloader ; bootloader record constructor (inherit grub-efi-netboot-bootloader) ; so we have the installer (package ; override bootloader's package (profile ; create a profile (content (list (file-append firmware "/boot/") (file-append u-boot-my-scb "/libexec/u-boot.bin") (plain-file "config.txt" "kernel=3Du-boot.bin") (bootloader-package grub-efi-netboot-bootloader))))) ;= and put the package we've overridden back into the profile (target "/boot")))) This way, maybe the procedures efi-bootloader-chain and efi-bootloader-profile would be superfluous. Note: I haven't used this myself yet.=20 --Sig_/NbWGRKJGx3YyWE49fQIEPYI Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl+z94oACgkQ5xo1VCww uqVGcAf+NKG/ITUMmZF9+grqZ69EJSd6ZyYRrRrJHJRxZ0sGBiL6ALFCZ02hi9RI JoKrzomNUJSkU8Bau+lFqey7cYtzZ/hJHxbBkRCua1dMLnM7WUKvEVDbRIv1ZfDI zE5tLM2vV58m4v2efcOMbgkem/8bV3dyG2P8PGE9YPKa1ecPlzdZZqGHUFNrZ8jQ WBUqusu1r537i093ZO4PyA3R+/iCrXtnZmGQ/dBczvUCz+i1Aubf4fWInRDxCzkj LKS9yum2wUgK/c7l5b42qHefQlrZegiWqRFoHejmbcj1GQCfIcSdQ0qdIzisRZHk VLOHWq7NDcUfSzjGoqbU8kMM3Zsn1w== =LUVh -----END PGP SIGNATURE----- --Sig_/NbWGRKJGx3YyWE49fQIEPYI-- From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 17 15:28:02 2020 Received: (at 41066) by debbugs.gnu.org; 17 Nov 2020 20:28:02 +0000 Received: from localhost ([127.0.0.1]:33055 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kf7a6-0005Md-Aw for submit@debbugs.gnu.org; Tue, 17 Nov 2020 15:28:02 -0500 Received: from mx009.vodafonemail.xion.oxcs.net ([153.92.174.39]:9829) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kf7a4-0005M3-0y for 41066@debbugs.gnu.org; Tue, 17 Nov 2020 15:28:01 -0500 Received: from vsmx002.vodafonemail.xion.oxcs.net (unknown [192.168.75.192]) by mta-6-out.mta.xion.oxcs.net (Postfix) with ESMTP id 6D215603F12; Tue, 17 Nov 2020 20:27:54 +0000 (UTC) Received: from macbook-pro.kuh-wiese.my-router.de (unknown [145.254.41.84]) by mta-6-out.mta.xion.oxcs.net (Postfix) with ESMTPA id 3C912604278; Tue, 17 Nov 2020 20:27:43 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [PATCH] gnu: bootloader: Support for chain loading. From: Stefan In-Reply-To: <20201117164755.1a27422b@scratchpost.org> Date: Tue, 17 Nov 2020 21:27:42 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201116103346.55ff8422@scratchpost.org> <20201117164755.1a27422b@scratchpost.org> To: Danny Milosavljevic X-Mailer: Apple Mail (2.3124) X-VADE-STATUS: LEGIT X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41066 Cc: 41066@debbugs.gnu.org, Mathieu Othacehe , Efraim Flashner , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Danny! > I've reviewed and pushed the first part (s;HOOK;HOOKS;) now as guix = master > commit ede4117f7f18e118003f2599f5c8e985dfbdf9a5. OK, thanks. > Could you explain what this is for in your use case? I don't yet = understand > the reason for this complexity. Sure. > (1) Why is there a $output/collection subdirectory? Is there = something > else than that in the profile output? =20 The profile contains first of all the GRUB package with all its tools = and files. This profile is the =E2=80=98package=E2=80=99 argument to the = GRUB installer. Having the profile hook create the collection folder = eases the task for an installer. The simple idea is to copy all the = additional files along with the installed GRUB bootloader into /boot. = Without the collection/ the installer would require the list of files as = well and reimplement the same functionality as already inside the hook, = to copy the files into the /boot/ folder. For example the profile contains at least these folders from the grub = package, plus the collection/: /gnu/store/=E2=80=A6-bootloader-profile/collection /gnu/store/=E2=80=A6-bootloader-profile/etc /gnu/store/=E2=80=A6-bootloader-profile/share /gnu/store/=E2=80=A6-bootloader-profile/lib /gnu/store/=E2=80=A6-bootloader-profile/bin /gnu/store/=E2=80=A6-bootloader-profile/sbin But the /boot/ folder finally contains something like this, with most of = it being content from the collection/, where the GRUB files get = installed belaw /boot/efi/: /boot/bcm2710-rpi-3-b.dtb /boot/bootcode.bin /boot/bootloader.txt /boot/config.txt /boot/custom.txt /boot/efi/ /boot/fixup.dat /boot/gnu/ /boot/grub/ /boot/overlays/ /boot/u-boot.bin Actually one could say that the profile hook is a kind of = =E2=80=98pre-installer=E2=80=99 for everything not related to GRUB, able = to prepare everything, but unable to write into the /boot folder. > If there are no good reasons to do it like that, I'd just put the > profile into $output directly instead--it's easier to understand, and = also it's > how other profiles are being used. Not having the collection folder would mean that the installer would = need to assume much more about the result of the profile hook, to copy = the right files to /boot. > (2) The COPY-FILES? flag is kinda weird. > I would prefer if INSTALLER just defaulted to a procedure that: does = copy > files, and then calls the final bootloader installer. > If the user doesn't want it then the user could still pass a INSTALLER > that doesn't (for example the user could pass #:installer > (bootloader-installer final-bootloader)). Agreed. Another possibility would be to remove the collection folder = within a hook. > I would prefer if the user would just change the INSTALLER in the case = he wants > to not use the profile (which is kinda weird?!) or pack it or = whatever. OK, I see, in case of a custom installer we can skip the copying = completely. That makes sense.=20 > (3) Why isn't the final bootloader installed last? I would have = expected > it to be installed last so that if it does packing of the profile = contents > in order to quickly find it at boot, it would have to have all the = files > of the profiles already, no? I thought about the order as well. My conclusion was that a file from = the collection should be able to overwrite a file installed from = final-bootloader, for example to install own device-tree files. What do think? Bye Stefan= From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 18 13:06:12 2020 Received: (at 41066) by debbugs.gnu.org; 18 Nov 2020 18:06:12 +0000 Received: from localhost ([127.0.0.1]:36440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kfRqN-00051Y-Lq for submit@debbugs.gnu.org; Wed, 18 Nov 2020 13:06:11 -0500 Received: from dd26836.kasserver.com ([85.13.145.193]:45692) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kfRqJ-00051M-8t for 41066@debbugs.gnu.org; Wed, 18 Nov 2020 13:06:10 -0500 Received: from localhost (80-110-126-103.cgn.dynamic.surfer.at [80.110.126.103]) by dd26836.kasserver.com (Postfix) with ESMTPSA id ABAD3336066C; Wed, 18 Nov 2020 19:06:04 +0100 (CET) Date: Wed, 18 Nov 2020 19:05:59 +0100 From: Danny Milosavljevic To: Stefan Subject: Re: [PATCH] gnu: bootloader: Support for chain loading. Message-ID: <20201118190559.1f9fed82@scratchpost.org> In-Reply-To: References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201116103346.55ff8422@scratchpost.org> <20201117164755.1a27422b@scratchpost.org> X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/rRLsv7NFicm8sG6adOME+zT"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41066 Cc: 41066@debbugs.gnu.org, Mathieu Othacehe , Efraim Flashner , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Sig_/rRLsv7NFicm8sG6adOME+zT Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Stefan, On Tue, 17 Nov 2020 21:27:42 +0100 Stefan wrote: > For example the profile contains at least these folders from the grub pac= kage, plus the collection/: >=20 > /gnu/store/=E2=80=A6-bootloader-profile/collection > /gnu/store/=E2=80=A6-bootloader-profile/etc > /gnu/store/=E2=80=A6-bootloader-profile/share > /gnu/store/=E2=80=A6-bootloader-profile/lib > /gnu/store/=E2=80=A6-bootloader-profile/bin > /gnu/store/=E2=80=A6-bootloader-profile/sbin Ohhh, that's right. It actually contains the grub installer--which it got = from the grub-efi derivation. The actual boot EFI file is not in the grub-efi derivation. I wonder if it is possible (one day!) to have a package that actually conta= ins the EFI boot file that the grub installer generated. That would be a lot nicer--though I'm not sure whether that stuff depends on the system and thus cannot be "pre-generated". > But the /boot/ folder finally contains something like this, with most of = it being content from the collection/, where the GRUB files get installed b= elaw /boot/efi/: >=20 > /boot/bcm2710-rpi-3-b.dtb > /boot/bootcode.bin > /boot/bootloader.txt > /boot/config.txt > /boot/custom.txt > /boot/efi/ > /boot/fixup.dat > /boot/gnu/ > /boot/grub/ > /boot/overlays/ > /boot/u-boot.bin >=20 > Actually one could say that the profile hook is a kind of =E2=80=98pre-in= staller=E2=80=99 for everything not related to GRUB, able to prepare everyt= hing, but unable to write into the /boot folder. >=20 > > If there are no good reasons to do it like that, I'd just put the > > profile into $output directly instead--it's easier to understand, and a= lso it's > > how other profiles are being used. =20 >=20 > Not having the collection folder would mean that the installer would need= to assume much more about the result of the profile hook, to copy the righ= t files to /boot. I agree. Let's leave it inside subdir "collection". > > (2) The COPY-FILES? flag is kinda weird. > > I would prefer if INSTALLER just defaulted to a procedure that: does co= py > > files, and then calls the final bootloader installer. > > If the user doesn't want it then the user could still pass a INSTALLER > > that doesn't (for example the user could pass #:installer > > (bootloader-installer final-bootloader)). =20 >=20 > Agreed. > Another possibility would be to remove the collection folder within a hoo= k. I don't like that that much because it's mutating too much and thus composability goes down. > > I would prefer if the user would just change the INSTALLER in the case = he wants > > to not use the profile (which is kinda weird?!) or pack it or whatever.= =20 >=20 > OK, I see, in case of a custom installer we can skip the copying complete= ly. That makes sense.=20 Could you send an updated patch that does it like that? Or do you rather w= ant the old variant ? > > (3) Why isn't the final bootloader installed last? I would have expect= ed > > it to be installed last so that if it does packing of the profile conte= nts > > in order to quickly find it at boot, it would have to have all the files > > of the profiles already, no? =20 >=20 > I thought about the order as well. My conclusion was that a file from the= collection should be able to overwrite a file installed from final-bootloa= der, for example to install own device-tree files. Yeah, that makes sense--if a little unusual (thus should be documented). --Sig_/rRLsv7NFicm8sG6adOME+zT Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl+1YocACgkQ5xo1VCww uqV6YAgAhtQPVeHSg98Cr8TqymrJJ86pgWQFpxSYaIQvbcXgdaWdFwDGv1Y1DPi0 X9nrmL1aw97NX81PFghjuHeMoEVqMDRdrEvSNlf7xyJZ4XEHdzH6vgl2zd9r5xfb jp6mAhtO7zFB+kYUHvy6gzVvtUCeDARbXlF6i954dkSw4cY+/mMUn6SBncLh0Bym rzqovKaKlk67tb4nz4jUY8b3z1rL8zfoxB0KFwVS8u8QX/NwFS80cO28I5DTLW3r A7bHeczgVE+LOKT4/iRWKj0YVWNphsdP9qnVClfUmA4UtiyG/rGiK5NDNVDtcXej i8+VHkZoJnY5KLuGO+R+5aSf817s4A== =ncES -----END PGP SIGNATURE----- --Sig_/rRLsv7NFicm8sG6adOME+zT-- From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 18 13:20:26 2020 Received: (at 41066) by debbugs.gnu.org; 18 Nov 2020 18:20:26 +0000 Received: from localhost ([127.0.0.1]:36456 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kfS49-0005Mh-MM for submit@debbugs.gnu.org; Wed, 18 Nov 2020 13:20:25 -0500 Received: from vsmx011.vodafonemail.xion.oxcs.net ([153.92.174.89]:59643) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kfS47-0005MM-55 for 41066@debbugs.gnu.org; Wed, 18 Nov 2020 13:20:24 -0500 Received: from vsmx003.vodafonemail.xion.oxcs.net (unknown [192.168.75.197]) by mta-5-out.mta.xion.oxcs.net (Postfix) with ESMTP id AD1C059D38F; Wed, 18 Nov 2020 18:20:17 +0000 (UTC) Received: from macbook-pro.kuh-wiese.my-router.de (unknown [88.70.113.67]) by mta-7-out.mta.xion.oxcs.net (Postfix) with ESMTPA id BC08C5399DF; Wed, 18 Nov 2020 18:20:06 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [PATCH] gnu: bootloader: Support for chain loading. From: Stefan In-Reply-To: <20201118190559.1f9fed82@scratchpost.org> Date: Wed, 18 Nov 2020 19:20:05 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <10AB4620-ECD3-4199-A9E4-CE0F906AC3BE@vodafonemail.de> References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201116103346.55ff8422@scratchpost.org> <20201117164755.1a27422b@scratchpost.org> <20201118190559.1f9fed82@scratchpost.org> To: Danny Milosavljevic X-Mailer: Apple Mail (2.3124) X-VADE-STATUS: LEGIT X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41066 Cc: 41066@debbugs.gnu.org, Mathieu Othacehe , Efraim Flashner , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Danny! > Could you send an updated patch that does it like that? Sure, it=E2=80=99ll just need a little while. Bye Stefan= From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 28 17:15:07 2020 Received: (at 41066) by debbugs.gnu.org; 28 Nov 2020 22:15:07 +0000 Received: from localhost ([127.0.0.1]:49296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kj8Ul-0005aN-1z for submit@debbugs.gnu.org; Sat, 28 Nov 2020 17:15:07 -0500 Received: from vsmx011.vodafonemail.xion.oxcs.net ([153.92.174.89]:31218) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kj8Ui-0005ZV-Cw for 41066@debbugs.gnu.org; Sat, 28 Nov 2020 17:15:05 -0500 Received: from vsmx003.vodafonemail.xion.oxcs.net (unknown [192.168.75.197]) by mta-5-out.mta.xion.oxcs.net (Postfix) with ESMTP id D71C559D646; Sat, 28 Nov 2020 22:14:58 +0000 (UTC) Received: from macbook-pro.kuh-wiese.my-router.de (unknown [88.70.113.247]) by mta-7-out.mta.xion.oxcs.net (Postfix) with ESMTPA id 045E65399F0; Sat, 28 Nov 2020 22:14:47 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: [PATCH] gnu: bootloader: Improve support for chain loading. From: Stefan In-Reply-To: <10AB4620-ECD3-4199-A9E4-CE0F906AC3BE@vodafonemail.de> Date: Sat, 28 Nov 2020 23:14:47 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <98EF392F-E84E-4CEB-8166-C28D16552057@vodafonemail.de> References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201116103346.55ff8422@scratchpost.org> <20201117164755.1a27422b@scratchpost.org> <20201118190559.1f9fed82@scratchpost.org> <10AB4620-ECD3-4199-A9E4-CE0F906AC3BE@vodafonemail.de> To: Danny Milosavljevic X-Mailer: Apple Mail (2.3124) X-VADE-STATUS: LEGIT X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41066 Cc: 41066@debbugs.gnu.org, Mathieu Othacehe , Efraim Flashner , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * gnu/bootloader.scm (chain-bootloader-installer): New function to call = its final-installer argument before copying files from the collection = directory of a bootloader profile to the bootloader target directory, preferring a = target of /mnt/boot/efi over /boot/efi, and only copying if source and = destination directories exist. * (efi-bootloader-chain): Using (chain-bootloader-installer) if the = #:installer argument is false. * (bootloader-collection manifest): Removed unneeded imported modules. * gnu/bootloader/grub.scm (font-file): Using (canonicalize-path), as = symlinks from a bootloader profile do not work on a tftp server when network = booting. The new chain-bootloader-installer allows a customization of installers = like (install-grub-efi-netboot): (operating-system (bootloader (bootloader-configuration (bootloader (efi-bootloader-chain (list (file-append firmware "/boot/") (file-append u-boot-my-scb "/libexec/u-boot.bin") (plain-file "config.txt" "kernel=3Du-boot.bin")) grub-efi-netboot-bootloader #:hooks my-special-bootloader-profile-manipulator #:installer (chain-bootloader-installer (install-grub-efi-netboot = "efi/boot"))) (target "/boot")))) --- gnu/bootloader.scm | 70 ++++++++++++++++++++++++++++------------- gnu/bootloader/grub.scm | 15 +++++++-- 2 files changed, 61 insertions(+), 24 deletions(-) diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm index 6d7352ddd2..491a839a65 100644 --- a/gnu/bootloader.scm +++ b/gnu/bootloader.scm @@ -70,6 +70,7 @@ %bootloaders lookup-bootloader-by-name =20 + chain-bootloader-installer efi-bootloader-chain)) =20 ^L @@ -233,14 +234,14 @@ record." (leave (G_ "~a: no such bootloader~%") name))) =20 (define (efi-bootloader-profile files bootloader-package hooks) - "Creates a profile with BOOTLOADER-PACKAGE and a directory = collection/ with + "Creates a profile with BOOTLOADER-PACKAGE and a directory collection = with links to additional FILES from the store. This collection is meant to = be used by the bootloader installer. =20 FILES is a list of file or directory names from the store, which will = be -symlinked into the collection/ directory. If a directory name ends = with '/', +symlinked into the collection directory. If a directory name ends with = '/', then the directory content instead of the directory itself will be = symlinked -into the collection/ directory. +into the collection directory. =20 FILES may contain file like objects produced by functions like = plain-file, local-file, etc., or package contents produced with file-append. @@ -248,10 +249,7 @@ local-file, etc., or package contents produced with = file-append. HOOKS lists additional hook functions to modify the profile." (define (bootloader-collection manifest) (define build - (with-imported-modules '((guix build utils) - (ice-9 ftw) - (srfi srfi-1) - (srfi srfi-26)) + (with-imported-modules '((guix build utils)) #~(begin (use-modules ((guix build utils) #:select (mkdir-p strip-store-file-name)) @@ -311,6 +309,37 @@ HOOKS lists additional hook functions to modify the = profile." (allow-collisions? #f) (relative-symlinks? #f))) =20 +(define (chain-bootloader-installer final-installer) + "Define a new bootloader installer gexp, which will invoke = FINAL-INSTALLER +before it will copy the content from a collection directory of its = 'bootloader' +argument into the directory of its 'target' argument. + +This order is by intention to allow overwriting bootloader files like +device-trees with own files provided in that collection directory. + +The generated bootloader function will usually be used in this way: + + (efi-bootloader-chain =E2=80=A6 #:installer = (chain-bootloader-installer =E2=80=A6))" + + #~(lambda (bootloader target mount-point) + (#$final-installer bootloader target mount-point) + (let* ((mount-point/target (string-append mount-point target)) + ;; When installing Guix, it is common to mount TARGET = below + ;; MOUNT-POINT rather than the root directory. + (bootloader-target (if (file-exists? mount-point/target) + mount-point/target + target)) + (collection (string-append bootloader "/collection"))) + (when (and (eq? (and=3D> (stat collection #f) stat:type) + 'directory) + (eq? (and=3D> (stat bootloader-target #f) stat:type) + 'directory)) + ;; Now copy the content of the collection directory. + (copy-recursively collection bootloader-target + #:follow-symlinks? #t + #:log (%make-void-port "w")))))) + + (define* (efi-bootloader-chain files final-bootloader #:key @@ -319,21 +348,27 @@ HOOKS lists additional hook functions to modify = the profile." "Define a bootloader chain with FINAL-BOOTLOADER as the final = bootloader and certain directories and files from the store given in the list of = FILES. =20 -FILES may contain file like objects produced by functions like = plain-file, +FILES may contain file like objects produced by procedures like = plain-file, local-file, etc., or package contents produced with file-append. They = will be -collected inside a directory collection/ inside a generated bootloader = profile, +collected inside a directory collection inside a generated bootloader = profile, which will be passed to the INSTALLER. =20 If a directory name in FILES ends with '/', then the directory content = instead -of the directory itself will be symlinked into the collection/ = directory. +of the directory itself will be symlinked into the collection = directory. =20 The procedures in the HOOKS list can be used to further modify the = bootloader profile. It is possible to pass a single function instead of a list. =20 -If the INSTALLER argument is used, then this function will be called to = install -the bootloader. Otherwise the installer of the FINAL-BOOTLOADER will = be called." +If the INSTALLER argument is used, then this procedure will be called = to install +the bootloader and handle the files inside the collection directory of = the +profile. Otherwise the generated procedure from + + (chain-bootloader-installer (bootloader-installer FINAL-BOOTLOADER)) + +will be used to install the bootloader." (let* ((final-installer (or installer - (bootloader-installer final-bootloader))) + (chain-bootloader-installer + (bootloader-installer = final-bootloader)))) (profile (efi-bootloader-profile files (bootloader-package = final-bootloader) (if (list? hooks) @@ -342,11 +377,4 @@ the bootloader. Otherwise the installer of the = FINAL-BOOTLOADER will be called. (bootloader (inherit final-bootloader) (package profile) - (installer - #~(lambda (bootloader target mount-point) - (#$final-installer bootloader target mount-point) - (copy-recursively - (string-append bootloader "/collection") - (string-append mount-point target) - #:follow-symlinks? #t - #:log (%make-void-port "w"))))))) + (installer final-installer)))) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index af7b7561ff..3177452dfb 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -191,9 +191,18 @@ fi~%" (define font-file (let* ((bootloader (bootloader-configuration-bootloader config)) (grub (bootloader-package bootloader))) - (normalize-file (file-append grub "/share/grub/unicode.pf2") - store-mount-point - store-directory-prefix))) + ;; The bootloader-package may be a profile with only symlinks. + ;; If network booting, then a symlink to the font may not work on = the + ;; server side. Therefore we canonicalize the file name of the = font. + ;; TODO: The font gets installed by (install-grub-efi-netboot) = and + ;; (install-grub-efi). The installed font could be referred to = as + ;; "unicode". But it is currently unclear if = (install-grub-disk-image) + ;; and (install-grub) both install the font as well. + ;; Actually this should be preferred. + #~(canonicalize-path + #+(normalize-file (file-append grub "/share/grub/unicode.pf2") + store-mount-point + store-directory-prefix)))) =20 (define image (normalize-file (grub-background-image config) --=20 2.29.2 From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 12 12:14:52 2020 Received: (at 41066) by debbugs.gnu.org; 12 Dec 2020 17:14:52 +0000 Received: from localhost ([127.0.0.1]:46324 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ko8Tr-0006qB-Vt for submit@debbugs.gnu.org; Sat, 12 Dec 2020 12:14:52 -0500 Received: from smtpout2.vodafonemail.de ([145.253.239.133]:59212) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ko8Tp-0006pw-KY for 41066@debbugs.gnu.org; Sat, 12 Dec 2020 12:14:50 -0500 Received: from smtp.vodafone.de (unknown [10.2.0.34]) by smtpout2.vodafonemail.de (Postfix) with ESMTP id 12B35126B55; Sat, 12 Dec 2020 18:14:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de; s=vfde-smtpout-mb-15sep; t=1607793283; bh=Gs/PMyPaLB4HzUG1taOZ09H2sAeyst6zJeIUDhSNBuw=; h=Subject:From:In-Reply-To:Date:References:To; b=igXr5JJ3m2HWhw4hKo5zZ8SwrfOIRAvSNUABMbme6s6wRjfiFCdKY9/CzUVLCzESz iIWzpLO78xfAXhJcHZAcop4RQg6YGD0w5YEFcb5kP/yFZ3N2bZ3cJOS5hbQ4R4HuBq ElFa6FwI+uvgoBg0RVgdNawsiZ1GN6WnobOCJ1E0= Received: from macbook-pro.kuh-wiese.my-router.de (dslb-002-202-077-025.002.202.pools.vodafone-ip.de [2.202.77.25]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.vodafone.de (Postfix) with ESMTPSA id 9B0B814103D; Sat, 12 Dec 2020 17:14:42 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [PATCH] gnu: bootloader: Improve support for chain loading. From: Stefan In-Reply-To: <98EF392F-E84E-4CEB-8166-C28D16552057@vodafonemail.de> Date: Sat, 12 Dec 2020 18:14:37 +0100 Content-Transfer-Encoding: 7bit Message-Id: <7FDE10B2-EA52-4598-AE22-25181DE76A86@vodafonemail.de> References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201116103346.55ff8422@scratchpost.org> <20201117164755.1a27422b@scratchpost.org> <20201118190559.1f9fed82@scratchpost.org> <10AB4620-ECD3-4199-A9E4-CE0F906AC3BE@vodafonemail.de> <98EF392F-E84E-4CEB-8166-C28D16552057@vodafonemail.de> To: Danny Milosavljevic , Maxim Cournoyer , Efraim Flashner , Mathieu Othacehe , 41066@debbugs.gnu.org X-Mailer: Apple Mail (2.3124) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 88 X-purgate-ID: 155817::1607793282-000006AA-CCC5EDED/0/0 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41066 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi! A friendly ping. :-) https://issues.guix.gnu.org/41066#29 Bye Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 13 09:42:21 2020 Received: (at 41066) by debbugs.gnu.org; 13 Dec 2020 14:42:21 +0000 Received: from localhost ([127.0.0.1]:47827 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koSZp-0004uC-7C for submit@debbugs.gnu.org; Sun, 13 Dec 2020 09:42:21 -0500 Received: from dd26836.kasserver.com ([85.13.145.193]:54410) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koSZn-0004u3-AM for 41066@debbugs.gnu.org; Sun, 13 Dec 2020 09:42:19 -0500 Received: from localhost (80-110-125-229.cgn.dynamic.surfer.at [80.110.125.229]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 55E61336389B; Sun, 13 Dec 2020 15:42:17 +0100 (CET) Date: Sun, 13 Dec 2020 15:42:14 +0100 From: Danny Milosavljevic To: Stefan Subject: Re: [PATCH] gnu: bootloader: Improve support for chain loading. Message-ID: <20201213154149.47423b18@scratchpost.org> In-Reply-To: <7FDE10B2-EA52-4598-AE22-25181DE76A86@vodafonemail.de> References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201116103346.55ff8422@scratchpost.org> <20201117164755.1a27422b@scratchpost.org> <20201118190559.1f9fed82@scratchpost.org> <10AB4620-ECD3-4199-A9E4-CE0F906AC3BE@vodafonemail.de> <98EF392F-E84E-4CEB-8166-C28D16552057@vodafonemail.de> <7FDE10B2-EA52-4598-AE22-25181DE76A86@vodafonemail.de> X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/mLZZU7aJUGcgMbcUDlWNUSM"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41066 Cc: 41066@debbugs.gnu.org, Mathieu Othacehe , Efraim Flashner , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Sig_/mLZZU7aJUGcgMbcUDlWNUSM Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Stefan, thanks! Like mentioned in recent e-mails on the mailing list by Mark Weaver (in gen= eral, not to you), please seperate cosmetic patches from non-cosmetic patches. This is mostly so users can see which commits change what and why without having to read through unrelated stuff. Your latest patch does: (1) Export chain-bootloader-installer. I totally agree with Ludo's earlier comment in that this is not the right abstraction for GENERAL bootloader chaining (which would be a LOT more difficult/impossible to do). Regardless, since we want to use this for efi-bootloader-chain, that should= be called "efi-chain-bootloader-installer" instead. I'm not sure whether "efi-bootloader-chain-installer" would be better (use whatever you think is best)--in any case, please do not make it seem like this function is in any way generic, which it is absolutely not. It only works if there is a special partition which contains the bootloader, which is not a given (and was pretty uncommon until a few years ago--a bootloader on a FILESYSTEM? What? :) ). (2) efi-bootloader-profile cosmetic comment and import cleanup. Also, some more cosmetic comment cleanup in some other procedure. Please use extra patch(es). (3) Definition of procedure chain-bootloader-installer. This procedure does not fail if the conditions are weird (collection is not a directory, bootloader-target is not a directory). If there is no good reason for that, please use (error "...") to make it fail instead of silently continuing. If there are good reasons, nevermind. Since this is merely moving the existing procedure, please, if you do these changes I suggest, do those in an extra commit (so the moving commit is clearing only moving the procedure, not changing it). (4) gnu/bootloader/grub.scm font installer doesn't use symlinks anymore. Fine, but maybe also make an extra patch for that. Please use your judgeme= nt. --Sig_/mLZZU7aJUGcgMbcUDlWNUSM Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl/WKEYACgkQ5xo1VCww uqWjvwgAkxIFOwSz3bhI589vJaKtS9yGMYGcrXzA2Hd0EXk315u/RD2xyfGu3D3a BSSIhloPqDtWuMFVU9P6PQrYaFgclULyVPRREBLxvViePW1HZxThqfjit9Wvxnbm eP8ywx7mPSxePeFIpMfVWcOFhrNvcpK2Ogpogq/qX8lMTTLD2uin/BVaBnn+reLf tfEkLRRzRMEQQAZvgI5SfJz/bJCNDCLIS6iFpSrUsHXh7VU9sTCprkGmsQUvLo4m 6gTc24UBqHyLamKV2saxvnHZeFhIT5KeBUlFB2/QRAj5hN0jlp7+YRntrHcw/EO5 IG9vYX/MGKXNBlaPeL9M8sbH6Fg8sQ== =/w0+ -----END PGP SIGNATURE----- --Sig_/mLZZU7aJUGcgMbcUDlWNUSM-- From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 13 12:25:03 2020 Received: (at 41066) by debbugs.gnu.org; 13 Dec 2020 17:25:03 +0000 Received: from localhost ([127.0.0.1]:50013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koV7H-0001Vw-3k for submit@debbugs.gnu.org; Sun, 13 Dec 2020 12:25:03 -0500 Received: from smtpout2.vodafonemail.de ([145.253.239.133]:43984) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koV7F-0001V1-Ft for 41066@debbugs.gnu.org; Sun, 13 Dec 2020 12:25:02 -0500 Received: from smtp.vodafone.de (unknown [10.2.0.35]) by smtpout2.vodafonemail.de (Postfix) with ESMTP id 163601270FC; Sun, 13 Dec 2020 18:24:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de; s=vfde-smtpout-mb-15sep; t=1607880295; bh=5u8kiCFDlJN3TCecHOSZJE7PXvb1FqJNQttYxTuurLQ=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=itgGUrTa4AuJtQ5UGHypUOSTcPmBH43pmA1KL8wMYShcEoBHzoGAHfruIXbVGs12I pBta+NGO+Yi18/366pfnpwypatkOu9Oey4gAyGPgcPTP1WEEM2zux3mlyLK9F118wj 7p+ep4bJaGbSURIarOVkyy3+vpzp/PzhzWpwqBKM= Received: from macbook-pro.kuh-wiese.my-router.de (dslb-002-202-077-025.002.202.pools.vodafone-ip.de [2.202.77.25]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.vodafone.de (Postfix) with ESMTPSA id D541D1420C3; Sun, 13 Dec 2020 17:24:54 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [PATCH] gnu: bootloader: Improve support for chain loading. From: Stefan In-Reply-To: <20201213154149.47423b18@scratchpost.org> Date: Sun, 13 Dec 2020 18:24:53 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <9A42CB53-1D8B-406C-B046-46883BC9962F@vodafonemail.de> References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201116103346.55ff8422@scratchpost.org> <20201117164755.1a27422b@scratchpost.org> <20201118190559.1f9fed82@scratchpost.org> <10AB4620-ECD3-4199-A9E4-CE0F906AC3BE@vodafonemail.de> <98EF392F-E84E-4CEB-8166-C28D16552057@vodafonemail.de> <7FDE10B2-EA52-4598-AE22-25181DE76A86@vodafonemail.de> <20201213154149.47423b18@scratchpost.org> To: Danny Milosavljevic X-Mailer: Apple Mail (2.3124) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 1726 X-purgate-ID: 155817::1607880294-000006C0-B2302219/0/0 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41066 Cc: 41066@debbugs.gnu.org, Mathieu Othacehe , Efraim Flashner , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Danny! > (1) Export chain-bootloader-installer. I totally agree with Ludo's = earlier > comment in that this is not the right abstraction for GENERAL = bootloader > chaining (which would be a LOT more difficult/impossible to do). > I'm not sure whether "efi-bootloader-chain-installer" would be better = (use > whatever you think is best)--in any case, please do not make it seem = like > this function is in any way generic, which it is absolutely not. Done, I chose chain-efi-bootloader-installer. > (2) efi-bootloader-profile cosmetic comment and import cleanup. Also, = some > more cosmetic comment cleanup in some other procedure. Please use = extra > patch(es). Undone. > (3) Definition of procedure chain-bootloader-installer. This = procedure does > not fail if the conditions are weird (collection is not a directory, > bootloader-target is not a directory). If there is no good reason for = that, > please use (error "...") to make it fail instead of silently = continuing. > If there are good reasons, nevermind. Done. > Since this is merely moving the existing procedure, please, if you do > these changes I suggest, do those in an extra commit (so the moving = commit > is clearing only moving the procedure, not changing it). No, it=E2=80=99s not strictly moving. Its pulling functionality out of = efi-bootloader-chain into the new function = chain-efi-bootloader-installer, which I put on top. Putting it below = doesn=E2=80=99t make the diff prettier. > (4) gnu/bootloader/grub.scm font installer doesn't use symlinks = anymore. > Fine, but maybe also make an extra patch for that. Please use your = judgement. Done. Bye Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 13 14:46:06 2020 Received: (at 41066) by debbugs.gnu.org; 13 Dec 2020 19:46:06 +0000 Received: from localhost ([127.0.0.1]:50316 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koXJl-0000Xh-NS for submit@debbugs.gnu.org; Sun, 13 Dec 2020 14:46:06 -0500 Received: from smtpout2.vodafonemail.de ([145.253.239.133]:58484) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koXJi-0000WG-TM for 41066@debbugs.gnu.org; Sun, 13 Dec 2020 14:46:04 -0500 Received: from smtp.vodafone.de (unknown [10.2.0.34]) by smtpout2.vodafonemail.de (Postfix) with ESMTP id 9C1D9127165; Sun, 13 Dec 2020 20:28:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de; s=vfde-smtpout-mb-15sep; t=1607887738; bh=Px+2IVbzpgznVtt6PaLFpQqZbMbwzEumBYBxWDYL5fc=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=PPK/kcsVTEX3gKeddZpui3dkr9Fx/Pg9VrcbpWVxFYy4kMqwsn5JQN0JZnu7nTfql u8JGWobz9RCMdTENpJeigSSiAFFYQdzrPpebQNWfsuFG2HJzwhFsLhirttwAzsEBb7 fBTa0ujslwuP+XroNpsJPvwD/sAgylDhiwdpAwBc= Received: from macbook-pro.kuh-wiese.my-router.de (dslb-002-202-077-025.002.202.pools.vodafone-ip.de [2.202.77.25]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.vodafone.de (Postfix) with ESMTPSA id 60736140236; Sun, 13 Dec 2020 19:28:58 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [PATCH] gnu: bootloader: Improve support for chain loading. From: Stefan In-Reply-To: <9A42CB53-1D8B-406C-B046-46883BC9962F@vodafonemail.de> Date: Sun, 13 Dec 2020 20:28:57 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <101A8A97-C37B-46B4-84E2-DDE68D74B3F0@vodafonemail.de> References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201116103346.55ff8422@scratchpost.org> <20201117164755.1a27422b@scratchpost.org> <20201118190559.1f9fed82@scratchpost.org> <10AB4620-ECD3-4199-A9E4-CE0F906AC3BE@vodafonemail.de> <98EF392F-E84E-4CEB-8166-C28D16552057@vodafonemail.de> <7FDE10B2-EA52-4598-AE22-25181DE76A86@vodafonemail.de> <20201213154149.47423b18@scratchpost.org> <9A42CB53-1D8B-406C-B046-46883BC9962F@vodafonemail.de> To: Danny Milosavljevic X-Mailer: Apple Mail (2.3124) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 5458 X-purgate-ID: 155817::1607887738-000006AA-6996ED6B/0/0 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41066 Cc: 41066@debbugs.gnu.org, Mathieu Othacehe , Efraim Flashner , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * gnu/bootloader.scm (chain-efi-bootloader-installer): New function to = call its final-installer argument before copying files from the collection = directory of a bootloader profile to the bootloader target directory, preferring a = target of /mnt/boot/efi over /boot/efi, and only copying if source and destination directories exist. * (efi-bootloader-chain): Using (chain-efi-bootloader-installer) if the = #:installer argument is false. The new chain-efi-bootloader-installer allows a customization of = installers like (install-grub-efi-netboot): (operating-system (bootloader (bootloader-configuration (bootloader (efi-bootloader-chain (list (file-append firmware "/boot/") (file-append u-boot-my-scb "/libexec/u-boot.bin") (plain-file "config.txt" "kernel=3Du-boot.bin")) grub-efi-netboot-bootloader #:hooks my-special-bootloader-profile-manipulator #:installer (chain-efi-bootloader-installer (install-grub-efi-netboot = "efi/boot"))) (target "/boot")))) --- gnu/bootloader.scm | 54 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 11 deletions(-) diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm index 6d7352ddd2..ce62d315ef 100644 --- a/gnu/bootloader.scm +++ b/gnu/bootloader.scm @@ -70,6 +70,7 @@ %bootloaders lookup-bootloader-by-name =20 + chain-efi-bootloader-installer efi-bootloader-chain)) =20 ^L @@ -311,6 +312,38 @@ HOOKS lists additional hook functions to modify the = profile." (allow-collisions? #f) (relative-symlinks? #f))) =20 +(define (chain-efi-bootloader-installer final-installer) + "Define a new bootloader installer gexp, which will invoke = FINAL-INSTALLER +before it will copy the content from a collection/ directory of its = 'bootloader' +argument into the directory of its 'target' argument. + +This order is by intention to allow overwriting bootloader files like +device-trees with own files provided in that collection/ directory. + +The generated bootloader function will usually be used in this way: + + (efi-bootloader-chain =E2=80=A6 #:installer = (chain-efi-bootloader-installer =E2=80=A6))" + + #~(lambda (bootloader target mount-point) + (#$final-installer bootloader target mount-point) + (let* ((mount-point/target (string-append mount-point target)) + ;; When installing Guix, it is common to mount TARGET = below + ;; MOUNT-POINT rather than the root directory. + (bootloader-target (if (file-exists? mount-point/target) + mount-point/target + target)) + (collection (string-append bootloader "/collection"))) + (if (and (eq? (and=3D> (stat collection #f) stat:type) + 'directory) + (eq? (and=3D> (stat bootloader-target #f) stat:type) + 'directory)) + ;; Now copy the content of the collection directory. + (copy-recursively collection bootloader-target + #:follow-symlinks? #t + #:log (%make-void-port "w")) + (error "expecting two directories for bootloader = installation" + collection bootloader-target))))) + (define* (efi-bootloader-chain files final-bootloader #:key @@ -330,10 +363,16 @@ of the directory itself will be symlinked into the = collection/ directory. The procedures in the HOOKS list can be used to further modify the = bootloader profile. It is possible to pass a single function instead of a list. =20 -If the INSTALLER argument is used, then this function will be called to = install -the bootloader. Otherwise the installer of the FINAL-BOOTLOADER will = be called." +If the INSTALLER argument is used, then this procedure will be called = to install +the bootloader and handle the files inside the collection directory of = the +profile. Otherwise the generated procedure from + + (chain-efi-bootloader-installer (bootloader-installer = FINAL-BOOTLOADER)) + +will be used to install the bootloader." (let* ((final-installer (or installer - (bootloader-installer final-bootloader))) + (chain-efi-bootloader-installer + (bootloader-installer = final-bootloader)))) (profile (efi-bootloader-profile files (bootloader-package = final-bootloader) (if (list? hooks) @@ -342,11 +381,4 @@ the bootloader. Otherwise the installer of the = FINAL-BOOTLOADER will be called. (bootloader (inherit final-bootloader) (package profile) - (installer - #~(lambda (bootloader target mount-point) - (#$final-installer bootloader target mount-point) - (copy-recursively - (string-append bootloader "/collection") - (string-append mount-point target) - #:follow-symlinks? #t - #:log (%make-void-port "w"))))))) + (installer final-installer)))) --=20 2.29.2 From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 28 14:02:46 2020 Received: (at 41066) by debbugs.gnu.org; 28 Dec 2020 19:02:46 +0000 Received: from localhost ([127.0.0.1]:36916 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ktxn3-0001TT-Tv for submit@debbugs.gnu.org; Mon, 28 Dec 2020 14:02:46 -0500 Received: from smtpout2.vodafonemail.de ([145.253.239.133]:34080) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ktxn1-0001TF-Im for 41066@debbugs.gnu.org; Mon, 28 Dec 2020 14:02:45 -0500 Received: from smtp.vodafone.de (unknown [10.2.0.32]) by smtpout2.vodafonemail.de (Postfix) with ESMTP id 1577C123CDA; Mon, 28 Dec 2020 20:02:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de; s=vfde-smtpout-mb-15sep; t=1609182157; bh=qAvH8KpL3p+DYjYTlRwDka3C1AUSjWVUq3IFlLTrimE=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=YWhhkNwjTDMgZkRRyUTdxNqeP9hv60cLUeBIjzHjHucZd0+lQAMHKfhPzSvyzFQQ0 9rtQlQTANjx3iGj8S1ZtJmD3atBgQi9TIJ2NOghQXj0vNexWOXEaOT4jDFWmeKEynf YK+Itoai7JeJfEHFVlNGQrmPj/VY0+wWWZ21XAvQ= Received: from macbook-pro.kuh-wiese.my-router.de (dialin-145-254-041-118.pools.arcor-ip.net [145.254.41.118]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.vodafone.de (Postfix) with ESMTPSA id BFB2D6185A; Mon, 28 Dec 2020 19:02:36 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [PATCH] gnu: bootloader: Improve support for chain loading. From: Stefan In-Reply-To: <101A8A97-C37B-46B4-84E2-DDE68D74B3F0@vodafonemail.de> Date: Mon, 28 Dec 2020 20:02:35 +0100 Content-Transfer-Encoding: 7bit Message-Id: <24C30CF6-0B20-45C1-89C8-DFB59EEC1A82@vodafonemail.de> References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201116103346.55ff8422@scratchpost.org> <20201117164755.1a27422b@scratchpost.org> <20201118190559.1f9fed82@scratchpost.org> <10AB4620-ECD3-4199-A9E4-CE0F906AC3BE@vodafonemail.de> <98EF392F-E84E-4CEB-8166-C28D16552057@vodafonemail.de> <7FDE10B2-EA52-4598-AE22-25181DE76A86@vodafonemail.de> <20201213154149.47423b18@scratchpost.org> <9A42CB53-1D8B-406C-B046-46883BC9962F@vodafonemail.de> <101A8A97-C37B-46B4-84E2-DDE68D74B3F0@vodafonemail.de> To: Danny Milosavljevic X-Mailer: Apple Mail (2.3124) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 48 X-purgate-ID: 155817::1609182156-0000068B-27F6C159/0/0 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41066 Cc: 41066@debbugs.gnu.org, Mathieu Othacehe , Efraim Flashner , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi! A friendly ping! :-) Bye Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 27 12:48:32 2021 Received: (at 41066-done) by debbugs.gnu.org; 27 Mar 2021 16:48:32 +0000 Received: from localhost ([127.0.0.1]:44776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lQC6x-0000tj-Rv for submit@debbugs.gnu.org; Sat, 27 Mar 2021 12:48:32 -0400 Received: from smtpout2.vodafonemail.de ([145.253.239.133]:57862) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lQC6w-0000tW-CG for 41066-done@debbugs.gnu.org; Sat, 27 Mar 2021 12:48:31 -0400 Received: from smtp.vodafone.de (smtpa03.fra-mediabeam.com [10.2.0.34]) by smtpout2.vodafonemail.de (Postfix) with ESMTP id B9531120A0F for <41066-done@debbugs.gnu.org>; Sat, 27 Mar 2021 17:48:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de; s=vfde-smtpout-mb-15sep; t=1616863704; bh=t2DJ0ECYun+gTT1lFhDEUEVxvGzdV9UI+D+3r076pVQ=; h=Subject:From:In-Reply-To:Date:References:To; b=WfmIyMoo680YerveyjuW3K/R66q7bw/36kDUcE5bGYRJsL5/MqWpzoKYLVyMz9QOb 9hONff4Wsrae4xU7iiSs8pcC83HrGeFW9BYlANTfI9jgvEA4SzOvBQPmt40LKIGPlH vrvtLMYrpq9zNpuHOqurvaueeT6fu6vQcWeau+Kk= Received: from macbook-pro.kuh-wiese.my-router.de (dslb-178-005-077-213.178.005.pools.vodafone-ip.de [178.5.77.213]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.vodafone.de (Postfix) with ESMTPSA id 9878414027D for <41066-done@debbugs.gnu.org>; Sat, 27 Mar 2021 16:48:24 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [PATCH] gnu: bootloader: Improve support for chain loading. From: Stefan In-Reply-To: <24C30CF6-0B20-45C1-89C8-DFB59EEC1A82@vodafonemail.de> Date: Sat, 27 Mar 2021 17:48:23 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <7A4ABEA8-4500-4D55-BCCE-BFB37FB06B2C@vodafonemail.de> <20200524131316.4c6e8a50@scratchpost.org> <3197004D-0131-4781-99FD-60EBE434E794@vodafonemail.de> <023CBBED-35CD-4AD3-97C4-0DE0B7623B9A@vodafonemail.de> <6E5ECFBA-57F4-485F-9403-1D04CF82062D@vodafonemail.de> <4D71A75A-5722-457C-A5CE-98CE51A53450@vodafonemail.de> <975EC414-6A81-444B-9BB0-AE303C6A9511@vodafonemail.de> <20201116103346.55ff8422@scratchpost.org> <20201117164755.1a27422b@scratchpost.org> <20201118190559.1f9fed82@scratchpost.org> <10AB4620-ECD3-4199-A9E4-CE0F906AC3BE@vodafonemail.de> <98EF392F-E84E-4CEB-8166-C28D16552057@vodafonemail.de> <7FDE10B2-EA52-4598-AE22-25181DE76A86@vodafonemail.de> <20201213154149.47423b18@scratchpost.org> <9A42CB53-1D8B-406C-B046-46883BC9962F@vodafonemail.de> <101A8A97-C37B-46B4-84E2-DDE68D74B3F0@vodafonemail.de> <24C30CF6-0B20-45C1-89C8-DFB59EEC1A82@vodafonemail.de> To: 41066-done@debbugs.gnu.org X-Mailer: Apple Mail (2.3124) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 165 X-purgate-ID: 155817::1616863704-0000600F-FC8EF235/0/0 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41066-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi! I=E2=80=99m working on a different improvement, which will make the = still outstanding patch in this ticket obsolete. So this is done. Bye Stefan= From unknown Thu Jun 19 14:07:58 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 25 Apr 2021 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator