From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id cEN5N4UA/2Y+xAAAqHPOHw:P1 (envelope-from ) for ; Thu, 03 Oct 2024 20:37:26 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id cEN5N4UA/2Y+xAAAqHPOHw (envelope-from ) for ; Thu, 03 Oct 2024 22:37:26 +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=dWY9Hnc6; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=XfcoUSxE; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1727987845; 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-type:content-type: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=Bo6OHCS3lFY5CYtOUSrzKkdVBBR+NJCM07Pxx4qPOIE=; b=Ba/mcyVfdjk+vWRLEkso9MGU8HVquoiLQw0gklBeel2mNXNeEUOgPZ+rbajTpU6bF0WmWC Dv9QlsMesV66BVOf5IkN0Rp2YB8//tv7gAlrnEid3z9ssbeV8UtzCIJmF4pi4BdA4gYuwF H00BZ1NZcDdhNbOENlMd9HS+xrr+Vhnu819zFVNgiI3K4m5KELtkyAfhxtXYyfKSCDKz6J J9KSy/hq0Db3XqEUnk1bH8l6/5wTrXITWCHJx/cupzbRdzpCk/cvU0QCiLFfyHqJSIo+qp EVpMTbK6NqwaRjHXyd5KdTieWrVOpETQqGQPS0bSmkYDMugAFaLfjEFKeSu6Hw== 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=dWY9Hnc6; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=XfcoUSxE; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1727987845; a=rsa-sha256; cv=none; b=NuAPT1SI20o7Rj1jp+/FmJr4YDdM+rC9sc7VMukI/LIArIZgYyt4sgFNBmT2yU4oeUD83f o9IEWbXBYkv1uhmP8ThepgUPnnTLpgzKAEo4a1FmgMp8J2oBTavEOvdMeovBqc60FC7anY Zc5Gh9+MbrjR19sDuQZzrl513ywmQaiInZoEEYSr2Fp3CpBxS7lKsW01KgbVzuMbuFAaXw JGQI8+IeMUgAK+mMBZPvDE6L+bS0XwyENRsKIvbi/VPPJGhh54c9Kmp/RJvhAqRAE99Ga0 wk5ZqnyFHmVlssDOJGcW7Va3Sf3/Rk4K9YCA8nwaozFkrkEN8YlGfY/IoTnn5w== 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 786EA78F49 for ; Thu, 03 Oct 2024 22:37:25 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1swSZM-0002NN-AR; Thu, 03 Oct 2024 16:37:04 -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 1swSZI-0002N6-HI for guix-patches@gnu.org; Thu, 03 Oct 2024 16:37:00 -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 1swSZI-0003Vh-3Q for guix-patches@gnu.org; Thu, 03 Oct 2024 16:37:00 -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:From:Date:To:In-Reply-To:References:Subject; bh=Bo6OHCS3lFY5CYtOUSrzKkdVBBR+NJCM07Pxx4qPOIE=; b=dWY9Hnc6/ijtAbQiXaOkwKh8tr0ilL59MeKUbUUa/g4BGfvklHT1EfLyId1oUbgfwlBUQScsH0ACsDfCmbOVFp4HLH8nI/JoveU6q/DZklrzm4iV4MBhp+hQMokhizIdrkKxx5wgjRbIk5Yeq5vGFYvBG656Eyvqy7Uww8y/SKv+rlTvrwrSSKiGZ4AgJIVsTsgVXhV4nMkkQkdnIQU8OxKD4zo9S7nBig9XsGOTyGvHm1C55CYwFxV7eHoJ3hLkmpBEVWR0HDHVL9nfWymwxFayiIBm+vyQFHvV8sNPtPjzvm0EAnylwInsYkKtHwAjPYttGedUfoxK3pOaxTtPvQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1swSZK-00024s-05 for guix-patches@gnu.org; Thu, 03 Oct 2024 16:37:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73202] [PATCH] Preparation for bootloader rewrite. References: <20240912165818.21580-1-herman@rimm.ee> In-Reply-To: <20240912165818.21580-1-herman@rimm.ee> Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 03 Oct 2024 20:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73202 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73202@debbugs.gnu.org Cc: Lilah Tascheter Received: via spool by 73202-submit@debbugs.gnu.org id=B73202.17279877967947 (code B ref 73202); Thu, 03 Oct 2024 20:37:01 +0000 Received: (at 73202) by debbugs.gnu.org; 3 Oct 2024 20:36:36 +0000 Received: from localhost ([127.0.0.1]:33935 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swSYt-000247-IM for submit@debbugs.gnu.org; Thu, 03 Oct 2024 16:36:35 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:39705 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swSYr-00023o-9Y for 73202@debbugs.gnu.org; Thu, 03 Oct 2024 16:36:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1727987591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=Bo6OHCS3lFY5CYtOUSrzKkdVBBR+NJCM07Pxx4qPOIE=; b=XfcoUSxEDkQ0Dp8/1DeArTTjh3SSyjgj/YY+J/sJC9KDhMwbhLlhhWcOPV4ZF3Pd1q+Zwu QB4Ma8v/ZU4NC0xfQCBMc24rQAO9tpUIPOMUrSqvg+W4PhRFS2MgbDqdD5qw5QrEbzyPZz qraYJnSRwNO3ZhbVKhYmPKlg6DDudHEoWSKsiz58nQ/3NMy8maK6o2oBdUcV+SpisKOi/W SXlzrAZk7YCBFCqkQzhqBDo7USBFEdbWvc2nQNrB+f6TU9acZoXbKMxcUZvQG7mWphwcHy qu2Z/Lvr9SYs5ymPW8d+BV+JZ3cFFC4p3KzyY1ryAx525SFN+uDAHO+aLfSTKw== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id c39b7ece (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Thu, 3 Oct 2024 20:33:11 +0000 (UTC) Date: Thu, 3 Oct 2024 22:32:30 +0200 Message-ID: <4fnudiucjxequd3m4ayy7drqsgjokybfvsu6l2tbssurhlr5wd@odqr53qw5qqz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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-Scanner: mx11.migadu.com X-Migadu-Spam-Score: 0.43 X-Spam-Score: 0.43 X-Migadu-Queue-Id: 786EA78F49 X-TUID: IdBgEfdof0FG Hi Lilah, I wrote a series of annotated Guile code snippets, regarding an alternative implementation of bootloader-target, and example user configuration (with tftp/NFS). See below, and please let me know what you think. Cheers, Herman ;; In (gnu bootloader grub): (define (grub-efi-default-targets esp) (tree->target ; like arborify (bootloader-target (type 'esp) (path esp) (targets ; counterpart of offset (list (bootloader-target (type 'vendir) (path "EFI/Guix")) (bootloader-target (type 'install) (path "grub"))))))) ;; This is the same as (grub-efi-default-targets "boot"). It could be ;; exported standalone, instead of using bootloader default-targets. (define %grub-efi-default-targets '((esp . "/boot") (install . "/boot/EFI/Guix") (vendir . "/boot/grub"))) ;; A simple consequence of this change is that this: (with-targets %grub-efi-default-targets (('install => (path :path)) ...)) ;; becomes: (let ((install-path (assoc-ref %grub-efi-default-targets 'install))) ...) ;; But e.g. device is provided separately (or derived from path): (with-targets %grub-efi-default-targets (('esp => (device :device)) ...)) ;; becomes: (let* ((path (assoc-ref %grub-efi-default-targets 'esp)) ;; A single root-device is provided in addition to targets. (device (root-device->block-device root-device path))) ...) ;; This procedure is in (gnu bootloader). Something like: (define (root-device->block-device device path) (match device ((? block-device?) device) ; string with /dev/ prefix ((? uuid?) (find-partition-for-uuid device)) ((? string?) (find-partition-for-label device)) ;; This might be necessary, but should not be relied on. (_ (mount-source (find-mount path))))) ;; Example user configuration: (define %grub-efi-bootloader (bootloader-configuration (bootloader grub-efi-bootloader) ;; This is for bootloader configuration (not installation), e.g. ;; GRUB search or install-efi disk argument. (root-device "UUID, label, or block device.") ;; This is complementary to root-device. It will configure some ;; files to be fetched remotely instead of installed. (tftp "Varies for UEFI/GRUB/U-Boot."))) (operating-system (bootloader (list %grub-efi-bootloader)) ;; This is shared between bootloaders. Ideally, it does not affect ;; which files are installed or their contents, but only the location. (bootloader-targets (grub-efi-default-targets "boot")))