From patchwork Sun Aug 4 03:55:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lilah Tascheter X-Patchwork-Id: 66661 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 4420C27BBEA; Sun, 4 Aug 2024 04:58:22 +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=ham 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 4D25027BBE2 for ; Sun, 4 Aug 2024 04:58:21 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1saSNM-0007jz-Mh; Sat, 03 Aug 2024 23:57:44 -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 1saSNL-0007j3-9R for guix-patches@gnu.org; Sat, 03 Aug 2024 23:57:43 -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 1saSNK-0004H3-Vk for guix-patches@gnu.org; Sat, 03 Aug 2024 23:57:43 -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:References:In-Reply-To:Date:From:To:Subject; bh=buit2QYRv4t16LN+onkxKQtwHUEdrMneSRjlV7pxzDA=; b=b0LFjiM4i1xTAR/pVfy/HF3yyBnPxs70eUTQpm1lNPATNUYfHqfuP1g0yyv3HOlwMHYU2PHppAJcO6OLvmklJHkBAWFCtYsVSx6JxoIJAxv0gLvZm2A2ijGMjSuAg0yphhz2rDrfcFAgjk8Lj9JBKOe5gX5MTHCjzpEjY9M10iMyThbzzhYM8zlu8NN9RMw+Bayxmvt/r/Y88k1gBd+GeaOFZKwjV6QTs6di7o9zYcp1Y6TiADGRq/Tg9kSWN89qTsHM2h8KEHfoOvWrLCPQrYBuD2an9u9VwM1ZOksOv0jTwpQI78Q/Nrj6Y0i9qkLTx5incoUFvQSNNfTrDELTKg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1saSNf-0001Oa-Ec; Sat, 03 Aug 2024 23:58:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#72457] [PATCH 09/15] gnu: packages: Add ukify. Resent-From: Lilah Tascheter Original-Sender: "Debbugs-submit" Resent-CC: efraim@flashner.co.il, vagrant@debian.org, guix-patches@gnu.org Resent-Date: Sun, 04 Aug 2024 03:58:03 +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: Lilah Tascheter , Efraim Flashner , Vagrant Cascadian X-Debbugs-Original-Xcc: Efraim Flashner , Vagrant Cascadian Received: via spool by 72457-submit@debbugs.gnu.org id=B72457.17227438345153 (code B ref 72457); Sun, 04 Aug 2024 03:58:03 +0000 Received: (at 72457) by debbugs.gnu.org; 4 Aug 2024 03:57:14 +0000 Received: from localhost ([127.0.0.1]:55179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1saSMr-0001Kp-E7 for submit@debbugs.gnu.org; Sat, 03 Aug 2024 23:57:14 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:60942) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1saSMo-0001JM-7T for 72457@debbugs.gnu.org; Sat, 03 Aug 2024 23:57:11 -0400 Authentication-Results: purelymail.com; auth=pass DKIM-Signature: a=rsa-sha256; b=GhxG7EY9wWx1kURFTFJgVduq9x+dZODMDHdMhw95AgWtVBQcWeHO4y/fuHFtB4LkfsLrr7MI21EymJUjtuo1eSvCjYq+t9bDqTkTbYAbmiJ5TAgERBZo5ReUgSgHIuCxhLKHF+4NlJssR0MrFYtrIScBWbWsbcOrN94yUX7YPBPFrmELpR8jhjXzjy1mjc0DMjbbKRdmlBRlEKBTGh30d/vS+3E/U062FbIK42wPl8uL1LNq9q43DwO0Mh33qkdvjPRfC2GwciZofzxdqMHrgIOGL3BKEjzhAyRQqcByfE0k5N3gcvetNw0jx9gME5rYTuhSCTQSE/xZDw80eGllDQ==; s=purelymail2; d=lunabee.space; v=1; bh=ct20D5UCkzcg79/PpAd07DbZyO28QekLcI9/1dbTTb8=; h=Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=D4IeViZE3m14mYSPLmHZyJKHIT21Nuivrw6AlWw7K16m8RmNwUeBn2GkiqW+HLnieJzIwqElGr91T9xC1Nld0i1H6oEPXxHruaYMK7s4YDbODAL61+xsadJjJnV71fpETRPqPNBOIx9ZKKPpliEGXg4DPdhgVPiTHHmjeapofc2CjBgiVqKPustuSJD02Xb1jRdsgnh1bHOCM30G0P3LqmcZ/XRqU5yw1wtzZCYPot6uYO49PcIUy5zynrCmx10fy2pZD03ahnv5rlUez9Q1dsBQs7YHnlVNJlzi9nLy/6zS89XEsgN37yhOXFHfR/l2WqdyLZfDFb670dvidjOrSw==; s=purelymail2; d=purelymail.com; v=1; bh=ct20D5UCkzcg79/PpAd07DbZyO28QekLcI9/1dbTTb8=; h=Feedback-ID:Received:From:To:Subject:Date; Feedback-ID: 8937:2070:null:purelymail X-Pm-Original-To: 72457@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 1753051598; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sun, 04 Aug 2024 03:56:25 +0000 (UTC) Date: Sat, 3 Aug 2024 22:55:29 -0500 Message-ID: <29e267f07ccb57193cfc622f2710d2fadfbcedfd.1722741997.git.lilah@lunabee.space> In-Reply-To: References: MIME-Version: 1.0 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: , 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 * gnu/packages/bootloaders.scm (systemd-version,systemd-source,ukify): New variables. Change-Id: Icde59b7266529c8002331ff0375e0a35af3a2add --- gnu/packages/bootloaders.scm | 54 ++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index e78602379d..04bb1b06f0 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -20,6 +20,7 @@ ;;; Copyright © 2022, 2023 Maxim Cournoyer ;;; Copyright © 2023 Herman Rimm ;;; Copyright © 2024 Zheng Junjie <873216071@qq.com> +;;; Copyright © 2024 Lilah Tascheter ;;; ;;; This file is part of GNU Guix. ;;; @@ -47,6 +48,7 @@ (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) @@ -73,11 +75,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) @@ -573,6 +577,56 @@ (define-public syslinux ;; Also contains: license:expat license:isc license:zlib))))) +(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)) + (snippet #~(substitute* "src/ukify/ukify.py" ; remove after python 3.11 + (("datetime\\.UTC") "datetime.timezone.utc"))) + (modules '((guix build utils))) + (sha256 + (base32 + "1qdyw9g3jgvsbc1aryr11gpc3075w5pg00mqv4pyf3hwixxkwaq6")))) + +(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* (#:key inputs #:allow-other-keys) + (define (get-tool tool) + (search-input-file inputs (string-append "bin/" tool))) + + (substitute* "src/ukify/ukify.py" ; hardcode tool paths + (("(find_tool\\(')(readelf|sbsign|pesign)'," _ ctx tool) + (string-append ctx (get-tool tool) "',")) + (("('name': ')(sbverify|pesign)'," _ ctx tool) + (string-append ctx (get-tool tool) "',"))))) + (delete 'check) + (replace 'install + (lambda* (#:key inputs #:allow-other-keys) + (let* ((bin (string-append #$output "/bin")) + (file (string-append bin "/ukify"))) + (mkdir-p bin) + (copy-file "src/ukify/ukify.py" file))))))) + (inputs + (list binutils pesign 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")