From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id +CgiK2cysmVacQEA62LTzQ:P1 (envelope-from ) for ; Thu, 25 Jan 2024 11:05:27 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id +CgiK2cysmVacQEA62LTzQ (envelope-from ) for ; Thu, 25 Jan 2024 11:05:27 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=HojRqf88; 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=1706177127; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=of1SbOb+zojpM1ZXdOpBywTNavJlCibjzgGaN9GuFMo=; b=n+kzfAy6wSYc1G7XDPAUn2DBFmoBQZw5NFyV3AskGpHH8uvNdaUeRbpuy5BnHYJAu56VJy Mr7WbzR395RF2EyOiQjZaGt0FsOO5Y12SK0FGU5LSD4zfU1kDCug97Rist3NEBejmRglZD 9v0bwiRtbeSzC/0DkV2sPEMM6ALMUX+rRFmwVRSlH6g2lCdQtItUQipd+XQRySPd52HfQY RElN8TCH66hW//P6C3MI6gUEMzPLTiB4jwoMEdJmdVghZ/MnGHzpk2AlHSjU71JcCvbxwt vUJHI3lQJtf2uH/Xygmayni7wXV5OidnIhoQkWPH7EogjMk8+8TWpmvqS47k6Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=HojRqf88; 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=1706177127; a=rsa-sha256; cv=none; b=u3floxC/2RO//3Gdh2RcN4s4WrvE7Oi0SP+WKP4kmQnMmnmEo2YjPaQxMzCPDF149IhhNS KWC38ciXnWVhBKuAfdQ3DCVXZIMqz5+hGzqbO8Dd1Qx9xA5vOgjxepx9YRu/UQ4+sTlV8i fzc/ioblS1QhTgNO6Y5xHbqsM2PTyQ9wiEChA8uPUW4xHR97a+YhoIodTkE9niQfjqC5Gx l1ljH9IlEpjn1NWP/tYqYkKAeFn/+jvTQtjdJIlHOj3ghgl6//NdRmGo3LqwejfuD5NRSs Eq0fQ26Wyv2fH+l29oP+aHraxvAUMd2EegInoiW5myEeyxQVXgI3K/HrMFknFA== 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 5A6727599A for ; Thu, 25 Jan 2024 11:05:27 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSwbf-0002WW-J3; Thu, 25 Jan 2024 05:05:14 -0500 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 1rSwbT-0002Un-OZ for guix-patches@gnu.org; Thu, 25 Jan 2024 05:05:03 -0500 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 1rSwbQ-0006xX-NK for guix-patches@gnu.org; Thu, 25 Jan 2024 05:04:58 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rSwbW-00006B-4n for guix-patches@gnu.org; Thu, 25 Jan 2024 05:05:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68524] [PATCH 2/2] gnu: bootloaders: Add uefi-uki-bootloader. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 25 Jan 2024 10:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68524 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Lilah Tascheter , 68524@debbugs.gnu.org Received: via spool by 68524-submit@debbugs.gnu.org id=B68524.170617706532761 (code B ref 68524); Thu, 25 Jan 2024 10:05:02 +0000 Received: (at 68524) by debbugs.gnu.org; 25 Jan 2024 10:04:25 +0000 Received: from localhost ([127.0.0.1]:47376 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSwav-0008WL-DC for submit@debbugs.gnu.org; Thu, 25 Jan 2024 05:04:25 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:38909 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSwas-0008Vy-Ef for 68524@debbugs.gnu.org; Thu, 25 Jan 2024 05:04:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1706177045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=of1SbOb+zojpM1ZXdOpBywTNavJlCibjzgGaN9GuFMo=; b=HojRqf88w7G0s+Dhi+YxbXNCDSeF6HE4MsgS+9vrhdSGAUzAXo864/EfU6HfHJAH8PagGE zgP29EbkHKlbTjAWKVYExbNy81rlmjuIOQSG6roVcDKB7RNbtZk+z0KSE2HcQjMWjiY947 RXxrlPmha2Z+SUmTAGGeVcoh7q6oLcllE53PaWzO6m1oIDoF+LcjQ9gprnQ6zWKuShncCc IrY+oftaREmqrfhNvhUxUNnRVOFgJ2PHQIxbfirrhazo3csCbe1fcgkLAXI5vZl3yr9IFs WjhKwCZrDpXE2LxjDDF1uFnabpUY8Wv/UCaFWWJr0alfmA+ug5qLNkLm00JROQ== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 15f49f34 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Thu, 25 Jan 2024 10:04:05 +0000 (UTC) Date: Thu, 25 Jan 2024 11:03:57 +0100 Message-ID: References: <8cad5fa9951dad5f663ca5d441db0ffc181e35fe.1705466646.git.lilah@lunabee.space> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8cad5fa9951dad5f663ca5d441db0ffc181e35fe.1705466646.git.lilah@lunabee.space> 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.66 X-Migadu-Queue-Id: 5A6727599A X-Spam-Score: -6.66 X-Migadu-Scanner: mx11.migadu.com X-TUID: RwyBAugx/t9B Hello, On Tue, Jan 16, 2024 at 10:48:11PM -0600, Lilah Tascheter wrote: > * doc/guix.texi (Bootloader Configuration)[bootloader,targets]: Document > uefi-uki-bootloader and uefi-uki-signed-bootloader. > * gnu/bootloader/uki.scm: New file. Remember to note your copyright and register new files in gnu/local.mk. > +(define* (uefi-uki-configuration-file #:optional cert privkey) > + (lambda* (config entries #:key (old-entires '()) #:allow-other-keys) old-entries got mistyped as old-entires. > + (define (menu-entry->uki e) > + (define stub (file-append systemd-stub "/libexec/" (systemd-stub-name))) Can you have systemd-stub be an argument of uefi-uki-configuration-file? > + (when (file-exists? schema) > + (call-with-input-file schema > + (lambda (port) > + (for-each (lambda (l) > + (unless (string-null? l) > + (system* efibootmgr "-B" "-L" l))) You can make this quiet. > + (invoke efibootmgr "-c" "-L" label "-d" disk "-l" Maybe this too? > +(define install-uefi-uki > + #~(lambda (bootloader target mount-point) Get systemd-stub from bootloader with bootloader-package. > + (invoke (string-append mount-point "/boot/install-uki.scm") > + (string-append mount-point target)))) The way GRUB does it, if mount-point/boot/efi does not exist, try install to /boot/efi in case the ESP got mounted there. Personally, I think it's okay to only try install to mount-point/boot/efi. > +(define-public uefi-uki-bootloader (make-uefi-uki-bootloader)) > +;; use ukify genkey to generate cert and privkey. DO NOT include in store. > +(define-public (uefi-uki-signed-bootloader cert privkey) > + (make-uefi-uki-bootloader cert privkey)) Can you use define instead and export the bootloaders in define-module? I expect define-public procedures in package modules which would have to use an export procedure with many arguments otherwise. The install-uki.scm config file is a nice idea. It can be used to regenerate the UKI and corresponding UEFI boot entry. Now that I think about it, can that be included as an example? Like: uefi-uki-bootloader installs install-uki.scm to /boot, you can use it to (re)create the UKI manually: sudo ./install-uki.scm /boot/efi/. If you need to chroot to an existing system on /mnt, mount efivars first: mount --bind /sys/firmware/efi/efivars /mnt/sys/firmware/efi/efivars. This is required for efibootmgr to (re)install the UEFI entry for the corresponding UKI. This bootloader has been very useful to me. I could easily chainload the UKI from an install image GRUB, whenever I messed up the UEFI boot entry for the EFI stub bootloader I'm working on. Thank you, Herman