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 ms8.migadu.com with LMTPS id 8B3rC6YmtmWeNAEAqHPOHw:P1 (envelope-from ) for ; Sun, 28 Jan 2024 11:04:22 +0100 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 8B3rC6YmtmWeNAEAqHPOHw (envelope-from ) for ; Sun, 28 Jan 2024 11:04:22 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lunabee.space header.s=purelymail2 header.b=U673TrUC; dkim=fail ("headers rsa verify failed") header.d=purelymail.com header.s=purelymail2 header.b=uEknK+JL; 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=1706436261; 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: 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=Xhr1DS8eiv5rLaHs27s34oT+kmhdq/U5oJcZ/j1WwWw=; b=NQGNOG/n9o/VoYvXg/w1SRbOPo0MLPA1abLBy4NA7Qw14RQmzlOuBA7m7ZjuKkI1lN0zmy GWTMYaOHgVLA6RlVcWdLNo4y5BVnIdNi3ki15lcceqzpWlIQc/hv40x2Ouc9uUYBKTnxR2 943HqWfGg1fh48Ggn+x7vqTUnvrxOjjU2J9nxewSvu6um685hLeofXQpaF+F98TPYFM2M7 n1UMihEQg6HWrB7liEIwDmWAbu9i9Kkm8im/X26entavQvTpD5Xj/mU3S/qRU1Li3Lb8zf io2jL+qPANH+F/m0pmn1yThQYtoxfcDb687hHaDUyZ0zl/zqyPoppMqByf/jAA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lunabee.space header.s=purelymail2 header.b=U673TrUC; dkim=fail ("headers rsa verify failed") header.d=purelymail.com header.s=purelymail2 header.b=uEknK+JL; 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=1706436261; a=rsa-sha256; cv=none; b=n6xPdq7RMq0v0zTn4prGxxTVrgXVA5nCvhos4udpbr7sI7lUvrM4qnrWWhtkgWq+9HBb3N fPVQxbhmVhMrFpG6j8JhBlDhixWkECK4p+cf54Y4VYGNG0PXNx4XVAFjuPLfesph0Q7TaU psJLAR1wEFQLe4eMN0KvxZx3qVAiBmyZH3vl5CqsUDM5BbNY/rXCL0bGDVMwmhWd5eVb0b y84Cnlnx4uUBFQJ0UKmUDe0MEdkoJBVz94gTdPwvPi5No5XIWAOM9ZnH6q1NihTw+QHRXY Y1L6uHFDqRmhl19VShg4hG3VR6a3M/cbAo7GZQHK9xuTFk/LgkiAUU360qNIMA== 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 A165B6B1EB for ; Sun, 28 Jan 2024 11:04:21 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rU219-0007q3-Fh; Sun, 28 Jan 2024 05:03:59 -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 1rU215-0007oe-Qg for guix-patches@gnu.org; Sun, 28 Jan 2024 05:03:56 -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 1rU215-0006mh-JA for guix-patches@gnu.org; Sun, 28 Jan 2024 05:03:55 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rU21C-00040O-1s; Sun, 28 Jan 2024 05:04:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68524] [PATCH v2 1/2] gnu: bootloaders: Add uki packages. Resent-From: Lilah Tascheter Original-Sender: "Debbugs-submit" Resent-CC: efraim@flashner.co.il, vagrant@debian.org, guix-patches@gnu.org Resent-Date: Sun, 28 Jan 2024 10:04: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: 68524@debbugs.gnu.org Cc: vagrant@debian.org, Lilah Tascheter , herman@rimm.ee, efraim@flashner.co.il, Efraim Flashner , Vagrant Cascadian X-Debbugs-Original-Xcc: Efraim Flashner , Vagrant Cascadian Received: via spool by 68524-submit@debbugs.gnu.org id=B68524.170643621215311 (code B ref 68524); Sun, 28 Jan 2024 10:04:02 +0000 Received: (at 68524) by debbugs.gnu.org; 28 Jan 2024 10:03:32 +0000 Received: from localhost ([127.0.0.1]:56626 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rU20h-0003yq-T1 for submit@debbugs.gnu.org; Sun, 28 Jan 2024 05:03:32 -0500 Received: from sendmail.purelymail.com ([34.202.193.197]:50706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rU20f-0003yO-SO for 68524@debbugs.gnu.org; Sun, 28 Jan 2024 05:03:30 -0500 DKIM-Signature: a=rsa-sha256; b=U673TrUCTFscakmyI8GUi6M1eWjyPIKffhlWHqWEPenliP1FXr9T2CW+sMzObgwBDLqpK3uNLJdYq1c/kYUfiVQLpSCjVnXWP1rBWjZ0zfnXaqQzRROLnswvswa49ul6ZPge6DRuzTUoFsocB/bxA2wcR420DBzxbr5smgXfHtyOIaGfDhspohS0l5dNQhgGnGM1kVdpQUig1LzXVgW59EhD2dyBPBsBG0ym2CbDzZ1a7yyBZTsern81bk6KCXs8pVy6CUItybvoqgHyvJ9gtiXL8CNzlu0Sk0VOnGxljBMEc1UHl1eJvbZDbpAGZ1zkruV5s1HEPXylfxMycK4POw==; s=purelymail2; d=lunabee.space; v=1; bh=/0e0X1bfriDa7mztPzwNLhVYDcs7uvRT3P83zy8NFF8=; h=Received:From:To:Subject; DKIM-Signature: a=rsa-sha256; b=uEknK+JL2gwPRkc4ZR3wQ/sP0MDEvbtXr6fvI0fXG4Yi34pjtsFNeiSYRazOSYcNzMJWr2d+QoWZdT9cjY5emniOmVZ2khRQqLaoiGoz/lvuqjPRjhK+jtluwDN3hfuRi+iPBs56jQPxUveNZCtUpY9FSHwJ5ux9oBveK+nxz9xdDXrIXTAQquMZEZLdN6XbtJJ9oWukVyCiDZXnUXG5CQ0iZ/hKr5ZIryPw6d6LjBi5uXhlpe5WNGjq3wUMRL2oXwbHpIzYHBzNx+kRLCBhYGkYjaaoG0dm6iWyw3rsO97FfuCrlo/1svH0N9lKpXM7BJ9ECa4KmqxTfv4jkYMKag==; s=purelymail2; d=purelymail.com; v=1; bh=/0e0X1bfriDa7mztPzwNLhVYDcs7uvRT3P83zy8NFF8=; h=Feedback-ID:Received:From:To:Subject; Feedback-ID: 8937:2070:null:purelymail X-Pm-Original-To: 68524@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -1308848491; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sun, 28 Jan 2024 10:03:12 +0000 (UTC) Date: Sun, 28 Jan 2024 03:51:40 -0600 Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by Purelymail 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: , From: Lilah Tascheter via Guix-patches Reply-To: Lilah Tascheter 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: -5.65 X-Migadu-Queue-Id: A165B6B1EB X-Spam-Score: -5.65 X-Migadu-Scanner: mx11.migadu.com X-TUID: 3bvb/yp74abS * gnu/packages/bootloaders.scm (systemd-stub-name): New procedure. (systemd-version,systemd-source,systemd-stub,ukify): New variables. Change-Id: I67776ec35d165afebc2eb4b11bea0459259e4bd8 --- gnu/packages/bootloaders.scm | 95 ++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 986f0ac035..b0d4979f44 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -19,6 +19,7 @@ ;;; Copyright =C2=A9 2021 Stefan ;;; Copyright =C2=A9 2022, 2023 Maxim Cournoyer ;;; Copyright =C2=A9 2023 Herman Rimm +;;; Copyright =C2=A9 2024 Lilah Tascheter ;;; ;;; This file is part of GNU Guix. ;;; @@ -46,11 +47,13 @@ (define-module (gnu packages bootloaders) #:use-module (gnu packages compression) #:use-module (gnu packages cross-base) #:use-module (gnu packages disk) + #:use-module (gnu packages efi) #:use-module (gnu packages firmware) #:use-module (gnu packages flex) #:use-module (gnu packages fontutils) #:use-module (gnu packages gcc) #:use-module (gnu packages gettext) + #:use-module (gnu packages gperf) #:use-module (gnu packages linux) #:use-module (gnu packages man) #:use-module (gnu packages mtools) @@ -71,11 +74,13 @@ (define-module (gnu packages bootloaders) #:use-module (gnu packages valgrind) #:use-module (gnu packages virtualization) #:use-module (gnu packages xorg) + #:use-module (gnu packages python-crypto) #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz) #:use-module (guix build-system gnu) #:use-module (guix build-system meson) #:use-module (guix build-system pyproject) + #:use-module (guix build-system python) #:use-module (guix build-system trivial) #:use-module (guix download) #:use-module (guix gexp) @@ -632,6 +637,96 @@ (define-public syslinux ;; Also contains: license:expat license:isc license:zlib))))) =20 +(define systemd-version "255") +(define systemd-source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/systemd/systemd") + (commit (string-append "v" systemd-version)))) + (file-name (git-file-name "systemd" systemd-version)) + (sha256 + (base32 + "1qdyw9g3jgvsbc1aryr11gpc3075w5pg00mqv4pyf3hwixxkwaq6")))) + +(define-public (systemd-stub-name) + (let ((arch (cond ((target-x86-32?) "ia32") + ((target-x86-64?) "x64") + ((target-arm32?) "arm") + ((target-aarch64?) "aa64") + ((target-riscv64?) "riscv64")))) + (string-append "linux" arch ".efi.stub"))) + +(define-public systemd-stub + (package + (name "systemd-stub") + (version systemd-version) + (source systemd-source) + (build-system meson-build-system) + (arguments + (list + #:configure-flags + `(list "-Defi=3Dtrue" "-Dsbat-distro=3Dguix" + "-Dsbat-distro-generation=3D1" ; package revision! + "-Dsbat-distro-summary=3DGuix System" + "-Dsbat-distro-url=3Dhttps://guix.gnu.org" + ,(string-append "-Dsbat-distro-pkgname=3D" name) + ,(string-append "-Dsbat-distro-version=3D" version)) + #:phases + #~(let ((stub #$(string-append "src/boot/efi/" (systemd-stub-name)= ))) + (modify-phases %standard-phases + (replace 'build + (lambda* (#:key parallel-build? #:allow-other-keys) + (invoke "ninja" stub + "-j" (if parallel-build? + (number->string (parallel-job-count)) "1")))) + (replace 'install + (lambda _ + (install-file stub (string-append #$output "/libexec")))= ) + (delete 'check))))) + (inputs (list libcap python-pyelftools `(,util-linux "lib"))) + (native-inputs (list gperf pkg-config python-3 python-jinja2)) + (home-page "https://systemd.io") + (synopsis "Unified kernel image UEFI stub") + (description "Simple UEFi boot stub that loads a conjoined kernel imag= e and +supporting data to their proper locations, before chainloading to the kern= el. +Supports measured and/or verified boot environments.") + (license license:lgpl2.1+))) + +(define-public ukify + (package + (name "ukify") + (version systemd-version) + (source systemd-source) + (build-system python-build-system) + (arguments + (list #:phases + #~(modify-phases %standard-phases + (replace 'build + (lambda _ + (substitute* "src/ukify/ukify.py" ; added in python 3.= 11 + (("datetime\\.UTC") "datetime.timezone.utc")))) + (delete 'check) + (replace 'install + (lambda* (#:key inputs #:allow-other-keys) + (let* ((bin (string-append #$output "/bin")) + (file (string-append bin "/ukify")) + (binutils (assoc-ref inputs "binutils")) + (sbsign (assoc-ref inputs "sbsigntools"))) + (mkdir-p bin) + (copy-file "src/ukify/ukify.py" file) + (wrap-program file + `("PATH" ":" prefix + (,(string-append binutils "/bin") + ,(string-append sbsign "/bin")))))))))) + (inputs (list binutils python-cryptography python-pefile sbsigntools)) + (home-page "https://systemd.io") + (synopsis "Unified kernel image UEFI tool") + (description "@command{ukify} joins together a UKI stub, linux kernel,= initrd, +kernel arguments, and optional secure boot signatures into a single, UEFI-= bootable +image.") + (license license:lgpl2.1+))) + (define-public dtc (package (name "dtc") --=20 2.41.0