From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id sGe/Bdwe82a5LwAA62LTzQ:P1 (envelope-from ) for ; Tue, 24 Sep 2024 20:19:40 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id sGe/Bdwe82a5LwAA62LTzQ (envelope-from ) for ; Tue, 24 Sep 2024 22:19:40 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=bfbAjUbv; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=V43sNMwW; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1727209179; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=FIketAktveWs0rb636qig/lguh/XRJ+s9XFkJw9aJhg=; b=do8O3vv7GKhqsR5EMC7O0IOwEuykIkLS1P8mP08A8iSvOafZGsjcXAAWskNxPOUVQkEth0 yLd/oDu/jGj1N5EoT7Nv5MqaSBV6RrGnsNg7OyOkA/Zkccp21dePOmLmNSLIdyyR4KNUHl wp6YISGaaVIG7jos6n1CrmApczWiPCb4lUXzJ2fajh8ffPz7Y3R57BmTYcfpMhFtPhysMT 4mMRa196t6FOciUN18qW1LKzHGEEOpfq8s4xN9JSJ/fFN7XOqGmd6c4Jzkden1XBSVCveM 96PBZ/nn2ygVcCn6DUde8zfzAunEqRDKDOZVzxOrx7OUywi2v/Fo1UA/kwtKQQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1727209179; a=rsa-sha256; cv=none; b=fAr10XIMSRXyPDfE50eg5xwFZmcsK3a8Nvd4Oiy6WsLLBa7ywHnT3gaeG5M7E+xRvhokoW jNlBSSQhNUoXFkUhBH73fuhWVcU21Otmf0ghPPryDXUuwCLfYgqgaYI6R0zm6AANctDfJS 0HG8pmOWgqY/IHPocL3jFVA4kWvj2f5o8D7nC/7Xx8eQP+yOelYInJ42q+BscMYz1PKMTy oknpkA2aWTPiym/AERvveIk/7sGclQ4FEvvXXiLON6mDDRhWqCdiQltfmlIVcBTDNoawN1 g9KmBDscQ8+iBk2TrZRqcw6c6KgMx+udolsG1P5ba9hRC3IYh1KfLsLM4abCfQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=bfbAjUbv; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=V43sNMwW; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D3D86BBB5 for ; Tue, 24 Sep 2024 22:19:39 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stBzf-0004Ck-LL; Tue, 24 Sep 2024 16:18:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1stBzb-0003t0-KD for guix-patches@gnu.org; Tue, 24 Sep 2024 16:18:39 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1stBza-0002jT-K6; Tue, 24 Sep 2024 16:18:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:In-Reply-To:References:Subject; bh=FIketAktveWs0rb636qig/lguh/XRJ+s9XFkJw9aJhg=; b=bfbAjUbv1VoB460fTkDXOVZyQuOJPk1FqemyCo4ipShXsGfVlS3drnRWMKBN0ww7FwOYol75FurkKpju8sOgOmjulIywXrGifWIEXxRsH4AATnaeECCck3DYtsj3Om8gu5it/U8BlnG2xZmNVWYyrDEewUdNXw0obvfGnze9ZERXhKfzNfNJieLOtovGbYb/DSlZYepcJzrKs1scWPGsAzX1iOhJkQlt84tZbj+TLWwA95TDwcpL5C2LiFIDHAOSM6i6/ayp/DQuvH2dCcRz7DnuxFawgsWrEf9aMmj1G2oIaGQdM5rvRHOux/L788gqsYY7Xv0whP/yoEIX216ZXQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stBzy-0004lg-LY; Tue, 24 Sep 2024 16:19:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#72457] [PATCH v6 00/12] Rewrite bootloader subsystem. References: In-Reply-To: Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: pelzflorian@pelzflorian.de, ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Tue, 24 Sep 2024 20:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72457 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 72457@debbugs.gnu.org Cc: Florian Pelz , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Maxim Cournoyer X-Debbugs-Original-Xcc: Florian Pelz , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Maxim Cournoyer Received: via spool by 72457-submit@debbugs.gnu.org id=B72457.172720911518168 (code B ref 72457); Tue, 24 Sep 2024 20:19:02 +0000 Received: (at 72457) by debbugs.gnu.org; 24 Sep 2024 20:18:35 +0000 Received: from localhost ([127.0.0.1]:38406 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stBzW-0004iv-Bq for submit@debbugs.gnu.org; Tue, 24 Sep 2024 16:18:34 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:39007 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stBzT-0004iX-IE for 72457@debbugs.gnu.org; Tue, 24 Sep 2024 16:18:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1727202610; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=FIketAktveWs0rb636qig/lguh/XRJ+s9XFkJw9aJhg=; b=V43sNMwWSJrLplKP6SLYc15ZjU95M9zt/TvUMSSeGD3mjf2ykyOEmX0xXSV0Rnvijs5wmk eXxy3w9pnCFozbawO5dqxado/dSwwusz0M4vCjKVegW+ftRgFhUrezpm0urViXhIGeNICM G2OxW4sL/j9n+2qqRp9/3FLoSOoy/I1P30rJ6tlp4wtoJQjltwoyuFMd1BM6YCfcWEZoSS JZuc3gJxDdkfqHPc1jZ1ga+g97pyb9Gl7TPbwPVO9wfve2yFtt+oYXHRnBCa22RAcWRIHB eW63AZzFXaknl4L7YOjaxwCNuoHl0YlYIbxq04gTM4jjPBnyvS0LykysrHG5Xw== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 1ad6f86c (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <72457@debbugs.gnu.org>; Tue, 24 Sep 2024 18:30:08 +0000 (UTC) Date: Tue, 24 Sep 2024 20:29:07 +0200 Message-ID: X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches From: Herman Rimm via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.91 X-Spam-Score: -2.91 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Queue-Id: D3D86BBB5 X-TUID: i199PYuuIV8b Hi all, If you did not already know, some of the patch series contents was moved to issue #73202 as separate commits, and patches relating to UKI will be posted in #68524. This patch series is based on v2 of issue #70131 (as well as #73202), so I could test the rewritten U-Boot bootloader on a Nano Pi R4S. It works... unless you use guix deploy, in which case extlinux.conf is not installed to /boot/extlinux, but /extlinux/boot! Sergey fixed a GRUB bootloader paren. I did so for U-Boot, and fixed extlinux.conf installation (a bit). Lilah updated the bootloader-configuration-targets sanitizer to detect for 'part type targets. I made it more strict so nvme0n1, mmcblk0, etc. are still 'disk. I rephrased some comments and documentation, used capital letters and punctuation, and two spaces after periods. I aligned the arguments of procedures, mostly 'if' and 'and', only indenting by two columns for 'begin', 'let' or 'with-*' procedures. I used 'match' and 'match-lambda' instead of 'car', 'cddr', etc.. I added core.cfg->core.img and make-grub.cfg to reduce indentation. It's easier to see significant changes with 'git diff -w --color-moved'. But I'm thinking of using define-configuration, to replace make-grub.cfg with serialize-configuration, and to generate documentation with type annotations. In edge cases grub.cfg could then be overriden, so the bootloader-configuration record is only left with fields which are useful for multiple bootloaders and most common configurations, e.g.: (bootloader (bootloader-configuration (inherit %base-grub-configuration) (override (lambda (config) ;; Record made with define-configuration. (grub-configuration (inherit config) (keyboard-layout keyboard-layout) (extra-initrd "~/just-for-grub.cfg.cpio.gz")))))) ;; Defaults per bootloader instead of singular record field defaults. (define %base-grub-configuration (bootloader-configuration (bootloader grub-efi-bootloader) (targets (list "/boot/efi")) ;; Same for each bootloader: should be a record field default. (override identity))) I also want to make some record fields mutually exclusive, instead of documenting which fields are required, or take priority, etc.. This also applies to #73202. For example: (define-record-type* bootloader-target make-bootloader-target bootloader-target? (type bootloader-target-type) ; symbol (expected? bootloader-target-expected? (default #f)) ; bool - (path bootloader-target-path (default #f)) ; string|#f - (offset bootloader-target-offset (thunked) ; symbol|#f - (default (and (bootloader-target-path this-record) - (not (eq? (bootloader-target-type this-record) 'root)) - 'root))) - (device bootloader-target-device (default #f)) ; string|#f - (file-system bootloader-target-file-system (default #f)) ; string|#f - (label bootloader-target-label (default #f)) ; string|#f - (uuid bootloader-target-uuid (default #f))) ; uuid|#f + ;; Device is either a path-device, uuid, or string label. + (device bootloader-target-device) + (file-system bootloader-target-file-system (default #f))); string|#f + +(define-record-type* + path-device make-path-device path-device? + (path path-device-path) ; string + (offset path-device-offset (thunked) (default 'root))) ; symbol|#f Of course I will do more formatting, making use of the flat-map procedure added in #73202. The 'ESP full' warning should be limited to one in total, instead of for each missing entry. It could also refer to 'guix system delete-generations'. By the way, my Nano Pi R4S has the root partition on an HDD and the boot partition on a microSD. Whenever I reconfigure with a new kernel and initrd, I need to copy them to /boot/gnu/store/, or U-boot will fall back to an older generation. Would it be a good idea to make Guix copy these during installation, if it detects that the root and boot partition are not on the same device? Finally, changing the install procedure like so: - (let ((os-dir (derivation->output-path os-drv)) - (format (lift format %store-monad)) - (populate (lift2 populate-root-file-system %store-monad)) - (profile (string-append target "/var/guix/profiles/system"))) - (mbegin %store-monad + (let* ((os-dir (derivation->output-path os-drv)) + (format (lift format %store-monad)) + (populate (lift2 populate-root-file-system %store-monad)) + (profile (string-append target "/var/guix/profiles/system")) + (alt (generation->boot-alternative profile 1))) + (mlet %store-monad + ((inst (apply install-bootloader local-eval bootloaders + (list alt) #:dry-run? (not install-bootloader?) + #:root-offset target bootmeta))) ;; Create a bunch of system files. (format log-port "populating '~a'...~%" target) (populate os-dir target) ;; Copy the bootloader's closure, which includes OS-DIR, ;; eventual background image and so on. - (mlet* %store-monad - ((alt -> (generation->boot-alternative profile 1)) - (inst (apply install-bootloader local-eval bootloaders - (list alt) #:dry-run? (not install-bootloader?) - #:root-offset target bootmeta))) - (maybe-copy (derivation->output-path inst))) + (maybe-copy (derivation->output-path inst)) ... makes %test-installed-os fail sooner, before the CPAN build error. I don't know why. I left it out of the patch series, though reconfigure works. Cheers, Herman Herman Rimm (1): gnu: system: image: Reduce subprocedure indentation. Lilah Tascheter (11): gnu: bootloader: Remove obsolete bootloader fields. gnu: bootloader: grub: Rewrite entirely. gnu: bootloader: Update bootloader-configuration targets field. gnu: Core bootloader changes. gnu: bootloader: depthcharge: Rewrite completely. gnu: bootloader: extlinux: Rewrite completely. gnu: bootloader: u-boot: Rewrite completely. gnu: bootloader: Add Raspberry Pi bootloader. gnu: tests: Update tests to new targets system. gnu: system: Update examples. doc: Update bootloader documentation. doc/guix.texi | 415 ++--- gnu/bootloader.scm | 200 +-- gnu/bootloader/depthcharge.scm | 154 +- gnu/bootloader/extlinux.scm | 153 +- gnu/bootloader/grub.scm | 1332 +++++++---------- gnu/bootloader/u-boot.scm | 536 +++---- gnu/build/image.scm | 18 +- gnu/build/install.scm | 16 +- gnu/installer/parted.scm | 12 +- gnu/machine/ssh.scm | 66 +- gnu/packages/bootloaders.scm | 180 +-- gnu/packages/raspberry-pi.scm | 18 - gnu/services/virtualization.scm | 11 +- gnu/system.scm | 42 +- gnu/system/boot.scm | 3 +- gnu/system/examples/asus-c201.tmpl | 6 +- gnu/system/examples/bare-bones.tmpl | 7 +- gnu/system/examples/bare-hurd.tmpl | 4 +- gnu/system/examples/beaglebone-black.tmpl | 4 +- gnu/system/examples/desktop.tmpl | 4 +- gnu/system/examples/docker-image.tmpl | 6 +- gnu/system/examples/lightweight-desktop.tmpl | 4 +- gnu/system/examples/plasma.tmpl | 4 +- .../examples/raspberry-pi-64-nfs-root.tmpl | 23 +- gnu/system/examples/raspberry-pi-64.tmpl | 18 +- gnu/system/examples/vm-image.tmpl | 5 +- gnu/system/hurd.scm | 4 +- gnu/system/image.scm | 237 +-- gnu/system/images/hurd.scm | 4 +- gnu/system/images/novena.scm | 3 +- .../images/orangepi-r1-plus-lts-rk3328.scm | 3 +- gnu/system/images/pine64.scm | 3 +- gnu/system/images/pinebook-pro.scm | 3 +- gnu/system/images/rock64.scm | 3 +- gnu/system/images/unmatched.scm | 3 +- gnu/system/images/visionfive2.scm | 3 +- gnu/system/images/wsl2.scm | 14 +- gnu/system/install.scm | 101 +- gnu/system/vm.scm | 11 - gnu/tests.scm | 4 +- gnu/tests/ganeti.scm | 4 +- gnu/tests/image.scm | 4 +- gnu/tests/install.scm | 80 +- gnu/tests/nfs.scm | 4 +- gnu/tests/telephony.scm | 4 +- gnu/tests/vnc.scm | 4 +- guix/scripts/system.scm | 93 +- guix/scripts/system/reconfigure.scm | 158 +- tests/boot-parameters.scm | 2 +- 49 files changed, 1680 insertions(+), 2310 deletions(-) base-commit: 7ece5b8cf9f7b09fc67e40efd7a7f551bbbde5d7 -- 2.45.2