From patchwork Sun Aug 4 03:50:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lilah Tascheter X-Patchwork-Id: 2737 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id A970727BBE9; Sun, 4 Aug 2024 04:52:12 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id E74B527BBE2 for ; Sun, 4 Aug 2024 04:52:09 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1saSHc-0006xj-QC; Sat, 03 Aug 2024 23:51:48 -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 1saSHV-0006xB-T2 for guix-patches@gnu.org; Sat, 03 Aug 2024 23:51:42 -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 1saSHV-0003ZJ-J4 for guix-patches@gnu.org; Sat, 03 Aug 2024 23:51:41 -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:Subject; bh=UD2MY63BRaDcr5Mu9OmjvC/K4qTNR+fKK5aQg0WO410=; b=pvgm3w7yajOb/Qzl+mzvpzZYqlXDa1AD/XLCVxfDFXrO+IryMlZJJV0Kj7MG3o6NZKXq6TP1R4ewAnfl72E6yvqBTQJG1E08Tf31Vw7IXtgGvQlKwjUnju/5kSketCgxpxh8fJ2CQzHC7dFd5PrOuCSEHpJhKuia6G47VfkRb/NH9LG4LBpWcccIXhcdzSyjSlCGWLYTTmqk+RFbgoBrmaH+VGiEPaOKHGycTngw7+WjnPjk+JqDLtSjkjw7tsMoPJvY99IOw4HaTWNF2S94UnXOQBAErla8Q+KVMTUFBjqMO86fe6UBHDp3bnzwEGWLEtUWvntjmHx0Ky1qMP89YA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1saSHp-000122-SR for guix-patches@gnu.org; Sat, 03 Aug 2024 23:52:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#72457] [PATCH 00/15] Rewrite bootloader subsystem. Resent-From: Lilah Tascheter Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 04 Aug 2024 03:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 72457 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 72457@debbugs.gnu.org Cc: Lilah Tascheter X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17227434993898 (code B ref -1); Sun, 04 Aug 2024 03:52:01 +0000 Received: (at submit) by debbugs.gnu.org; 4 Aug 2024 03:51:39 +0000 Received: from localhost ([127.0.0.1]:55096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1saSHS-00010o-Fn for submit@debbugs.gnu.org; Sat, 03 Aug 2024 23:51:39 -0400 Received: from lists.gnu.org ([209.51.188.17]:33480) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1saSHP-00010d-3H for submit@debbugs.gnu.org; Sat, 03 Aug 2024 23:51:36 -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 1saSH4-0006ua-Am for guix-patches@gnu.org; Sat, 03 Aug 2024 23:51:14 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1saSH2-0003VG-BJ for guix-patches@gnu.org; Sat, 03 Aug 2024 23:51:14 -0400 Authentication-Results: purelymail.com; auth=pass DKIM-Signature: a=rsa-sha256; b=Ue0H8lk8eP/5iWevmaKNAr+VXokgRZ1LC7eBRh9wIdzsA1nJDDJZnfStCvX+N5nWo8dbXWIZWt8epCFr6UXo4Bcq2+W1aBnDKgUjuC7MqCMx0GMiAwbOCXUfYSKIJ0h7wfpEcpliklsxCU2W65DdJMP1KT7cn2bzfwPuTHp03IJJacNyawuBhlD7ChQ4lKaYPv2q/+N/lSEwI6dG0U+DEDg+5r95v4b/EdeGLm9RSIIXqLCInpNsVKroPsQk2sq2hc7HBpB5f28pXk1Rc/3LBvLyKWdM90XgAuMe83E8+Lar4+GWjDaIf5MxT6OeUSdKg7ceInFXHvaVdsSc6I4/ow==; s=purelymail2; d=lunabee.space; v=1; bh=G94WsKC3jch7Xuv/BeLPgUHnhx0Yod/yY40jBDkA6zU=; h=Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=EOFlXaG3avhz2rl65IqnBKSna1m0TkZPBiU/vSRO03kzT7SaDNDilC3dukLLjoAe1TVqEXKc1cgp7BiXnvxYN4svBnDQBUG45bM3mHiw3Igbf+ErRFwI9Plg2BowjtxXEywTx9Hj59uUOo0VCRWGOtfxlZG63fZPo797RbMAZ7Xru8OBJrA6bUO37eWKfXrSwl7AEppCD1W2oOpWj5dgeADnU43ZBPVA0oAC7QKaqavYvglBclWRZgzPoQw33BNhVxE68o6KvgslGjJWYxWjMohpR1lue8w24sAYDQUYqtMR8JsPQGia4E2EdSEjghiJ3X4oeNp0A0U3fkR76i9+MQ==; s=purelymail2; d=purelymail.com; v=1; bh=G94WsKC3jch7Xuv/BeLPgUHnhx0Yod/yY40jBDkA6zU=; h=Feedback-ID:Received:From:To:Subject:Date; Feedback-ID: 8937:2070:null:purelymail X-Pm-Original-To: guix-patches@gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 1094593814; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sun, 04 Aug 2024 03:51:09 +0000 (UTC) Date: Sat, 3 Aug 2024 22:50:52 -0500 Message-ID: MIME-Version: 1.0 X-MIME-Autoconverted: from 8bit to quoted-printable by Purelymail Received-SPF: pass client-ip=34.202.193.197; envelope-from=lilah@lunabee.space; helo=sendmail.purelymail.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , X-Patchwork-Original-From: Lilah Tascheter via Guix-patches From: Lilah Tascheter Reply-To: Lilah Tascheter Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Months in the making! Requires patchset #69343 "Simplify bootloader data structures and procedures", to be regarded less of a blocker and more of a conjoined patchset. This is a massive rewrite to the entire way Guix handles bootloaders. Guix currently ad-hocs non-GRUB support on top of a layer that was designed for GRUB and nothing else. Big features enabled by this patchset include: * Multiple separate bootloaders! This takes over the previous multi-target functionality used in RAID systems, as well as the previous abuse of the GRUB bootloader on Raspberry Pis when trying to chainload GRUB through EFI provided by U-Boot. * Multiple distinct bootloader targets! Some bootloaders need more than just a single target, such as p-boot, which requires both a data target and a configuration partition. * Proper disk image support! Now every bootloader will be able to be dynamically installed to disk images, without any special support. * Support for bootloaders without configuration-file semantics! The install process is now much more generalized and no longer assumes bootloaders have a configuration file to be installed to a static, unchangable location. * Proper rollback support! No longer just guesses at a bootloader-configuration when doing rollbacks, which prevented significant configuration from being done. * The ability to specify either no bootloader or a bootloader without any targets, for situations in which it doesn't make sense (eg qemu images and disk images, respectively). * A more robust target system allowing any bootloader to be able to transform the user-specified target into a mount path, device-relative path, device file, label, or uuid. In addition, these changes allow the uki-efi-bootloader to be added, providing secure boot support and the ability to boot Guix from EFI without another bootloader intermediary. This should make adding new types of bootloaders way easier in the future as well. Especially EFI bootloaders, since the entire EFI install process is now abstracted away, so specific bootloaders don't have to worry about setting efivars or the limited ESP space. The big thing is that this definately needs to be tested. We support lots of bootloaders for lots of hardware and I definately do not possess any of it. Please test this and send back the results for me to revise any bugs. I've made sure as many tests as I could run work, and that GRUB and uefi-uki-bootloader work both in regular systems and disk images. Lilah Tascheter (15): guix: scripts: Rewrite reinstall-bootloader to use provenance data. gnu: Add bootloader target infastructure. guix: scripts: Remove unused code. gnu: Core bootloader changes. gnu: system: Remove useless boot parameters. gnu: bootloader: Add raspberry pi bootloader. gnu: system: Fix bootloader crypto device recognition. gnu: packages: Add pesign. gnu: packages: Add ukify. gnu: packages: Add systemd-stub. gnu: bootloaders: Add uki-efi-bootloader. gnu: system: Update examples. doc: Update bootloader documentation. gnu: tests: Update tests to new targets system. teams: Add bootloading team. doc/guix.texi | 458 +++--- etc/teams.scm | 10 + gnu/bootloader.scm | 644 ++++++--- gnu/bootloader/depthcharge.scm | 153 +- gnu/bootloader/extlinux.scm | 149 +- gnu/bootloader/grub.scm | 1279 +++++++---------- gnu/bootloader/u-boot.scm | 505 +++---- gnu/bootloader/uki.scm | 96 ++ gnu/build/bootloader.scm | 157 +- gnu/build/image.scm | 40 +- gnu/build/install.scm | 16 +- gnu/image.scm | 3 + gnu/installer/parted.scm | 12 +- gnu/local.mk | 1 + gnu/machine/ssh.scm | 71 +- gnu/packages/bootloaders.scm | 277 ++-- gnu/packages/efi.scm | 47 + gnu/packages/raspberry-pi.scm | 18 - gnu/services/virtualization.scm | 11 +- gnu/system.scm | 61 +- gnu/system/boot.scm | 16 +- 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 | 6 +- 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 | 162 ++- 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 | 43 +- 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/reconfigure.scm | 86 +- gnu/tests/telephony.scm | 4 +- gnu/tests/vnc.scm | 4 +- guix/scripts/system.scm | 161 +-- guix/scripts/system/reconfigure.scm | 159 +- guix/ui.scm | 8 + tests/boot-parameters.scm | 16 +- 57 files changed, 2371 insertions(+), 2533 deletions(-) create mode 100644 gnu/bootloader/uki.scm base-commit: 7d781027c78bdea5fdb3f1c9c9ec432b9606d2b5