From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id YAbYDPCxhmP3NAAAbAwnHQ (envelope-from ) for ; Wed, 30 Nov 2022 02:29:20 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id YB7UDPCxhmNpSgEA9RJhRA (envelope-from ) for ; Wed, 30 Nov 2022 02:29:20 +0100 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 C407943EA9 for ; Wed, 30 Nov 2022 02:29:19 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p0BuL-00086y-1C; Tue, 29 Nov 2022 20:29:05 -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 1p0BuJ-00086d-1l for guix-patches@gnu.org; Tue, 29 Nov 2022 20:29:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p0BuI-0001E7-Pu for guix-patches@gnu.org; Tue, 29 Nov 2022 20:29:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p0BuI-0005ft-9t for guix-patches@gnu.org; Tue, 29 Nov 2022 20:29:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59709] [PATCH] gnu: Add rpi-imager. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 30 Nov 2022 01:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59709 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59709@debbugs.gnu.org Cc: Maxim Cournoyer X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166977173821804 (code B ref -1); Wed, 30 Nov 2022 01:29:02 +0000 Received: (at submit) by debbugs.gnu.org; 30 Nov 2022 01:28:58 +0000 Received: from localhost ([127.0.0.1]:57652 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0BuD-0005fc-MI for submit@debbugs.gnu.org; Tue, 29 Nov 2022 20:28:58 -0500 Received: from lists.gnu.org ([209.51.188.17]:38350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0BuB-0005fW-2a for submit@debbugs.gnu.org; Tue, 29 Nov 2022 20:28:56 -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 1p0BuA-00086H-RW for guix-patches@gnu.org; Tue, 29 Nov 2022 20:28:54 -0500 Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p0Bu8-0001Dh-QV for guix-patches@gnu.org; Tue, 29 Nov 2022 20:28:54 -0500 Received: by mail-qk1-x731.google.com with SMTP id g10so11269298qkl.6 for ; Tue, 29 Nov 2022 17:28:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=R2Vwz1oVBVl8yBfKgmUmEGfnPhA3Hrgm+I1XN3xV3xA=; b=aGQtu1pRduD9QNGjMiPnkHd1uqHQj7UIW/EvzH+UU31O2YP9L+e8krBW0XOxhS4S9o h+NllM+S5FWCE4lJ+cLJfDS0uur2vth1H9j4XR5z9o4d2S1vxoAxKzbal/R/Se34FkGV aZAGVyae9ks+en5okrH0cifKAUq4ZFiMGQGOAnHxsyPxFmmTzSclYGtP3BxGTBM3BVGm VDanIUqo4tyPGC8PzkTLou4nHOC4pTwjFYAMFEEVRYA+7EUxo0fM7abYzaKnjklHnqAb VFriSkYVRP4QecHFymspBxHtSgmE+7ooA4s5e9wRnweYt09ac7xgbWRStPZjyqTZh9+L ADvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=R2Vwz1oVBVl8yBfKgmUmEGfnPhA3Hrgm+I1XN3xV3xA=; b=roS024X+r/RX3BOgzdcVUKuOhZD0uLx6mxav5jZLqMS1Vi1BPsnEOoihLD0abjR+PF zQ9EwWKiNOSQtjJxx07wUA5Fnp6FdpWKaxd3OfaEmQCu7Ws0aJwZ1wd33b+zgeTTxYlv /TfP1J0q/M/3CRRrfwiuCpkfvLlVPt62JpVlPcwLFpz6nimYraNM3iu1M+bLiQLSOfOG 5nCUPXi+R7dXOkGJNLWHGQs0tEdhMz975LOkJt+5AEP0pZOhbbUmDIdvP2OsIhiNV5ZQ /ncDoJU0dbB22eZvwUFxnj8QOWHVLA+TSfUK1YE6rD5vfK0UP9Hx5Ig5HP7Nm1p05CRi +W1A== X-Gm-Message-State: ANoB5pmvSrsVgE0SfkupQOE/LZUFE6fnT71ahDUTNEISscVez3oXYcf5 TCTQQDSWXoAGKLDbTWLQJS2gWA5j7Wo= X-Google-Smtp-Source: AA0mqf5GcV94G0Q+xgtxyuIDU+XPvT7DZIRUc/U+l4Tlud6Qhzgqhe2HLAqTWVxIUKHdKs/Sh06G/g== X-Received: by 2002:a37:895:0:b0:6fa:8ddf:256b with SMTP id 143-20020a370895000000b006fa8ddf256bmr52501352qki.662.1669771731373; Tue, 29 Nov 2022 17:28:51 -0800 (PST) Received: from localhost.localdomain ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id r24-20020ac87958000000b003a5c6ad428asm9350853qtt.92.2022.11.29.17.28.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 17:28:51 -0800 (PST) From: Maxim Cournoyer Date: Tue, 29 Nov 2022 20:28:28 -0500 Message-Id: <20221130012828.31669-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::731; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qk1-x731.google.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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: , 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1669771759; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=R2Vwz1oVBVl8yBfKgmUmEGfnPhA3Hrgm+I1XN3xV3xA=; b=cZ7XjzvPx3nAL/RFpLNs5x11Ay6ZYRJPGIzhS5GEEz3DLLq2VCG+gCUEki2AefD4POmwUo wCsI/R/ZJ7Z8Gfh1Xze3+fiacPbRFIrvUe8Hy17R6lY0gFb2j/1V6fgNBS++BCRSa8mCvl ONO7ufWVUzyIzBBseIlSMUaqoiJjgdXivQVOgstKD/iCGLyNcfjEbub8wTqZ9TIOVy7FOA dxKdhBpGAd5MZNXfEWm3gzbW0e+nM7JiiukoTZ54GK+VCqiOnF9HIkRbraPnyLzrXExC0l gPjZSPbtcWtdbuDNm+kS7osaY+co2PPnZdVJfijClBQV7cNa5vMDbrfI0x4Bsw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1669771759; a=rsa-sha256; cv=none; b=l7zkdQr4yI4T4OmNl2EAkacH+NqOMYpjZYP1yKwxovlNx+w1BevODBhFrN2LotPwPkROis s7R/kI7+bw2otsjHsgrGN7OFTsdFzTkCyXRtgl+WYtfQxw4cIeXgkx8ga0KtjpozsSTMBc 7sVpbQx+Fa+tiRoQExh2tGzMD5SbPH1yJ5FwLOddp1t7nAA0OA1erNbbrI692wzWqwWwcQ QZV6CcB1Ws43/J4FmkPvGZ1XzRzxWHRvB3dt0CAto74W7IygJhbTex3PymbuY5IdHKT7UZ L3bDAufFlYIHuwm7M44AQl3dM5DPnDEjFQkDVNPipaHyh2OaOz1FPveJfaNgSA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=aGQtu1pR; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" X-Migadu-Spam-Score: 4.84 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=aGQtu1pR; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" X-Migadu-Queue-Id: C407943EA9 X-Spam-Score: 4.84 X-Migadu-Scanner: scn0.migadu.com X-TUID: iriL/aw5wc29 * gnu/packages/flashing-tools.scm (rpi-imager): New variable. --- gnu/packages/flashing-tools.scm | 88 +++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/gnu/packages/flashing-tools.scm b/gnu/packages/flashing-tools.scm index 08300cb860..4bbcd9c4f6 100644 --- a/gnu/packages/flashing-tools.scm +++ b/gnu/packages/flashing-tools.scm @@ -10,6 +10,7 @@ ;;; Copyright © 2021 Ricardo Wurmus ;;; Copyright © 2021 Mathieu Othacehe ;;; Copyright © 2022 Peter Polidoro +;;; Copyright © 2022 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -29,6 +30,7 @@ (define-module (gnu packages flashing-tools) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix download) + #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix packages) #:use-module (guix utils) @@ -36,21 +38,26 @@ (define-module (gnu packages flashing-tools) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (guix build-system python) + #:use-module (guix build-system qt) #:use-module (gnu packages autotools) #:use-module (gnu packages admin) + #:use-module (gnu packages backup) #:use-module (gnu packages base) #:use-module (gnu packages bison) #:use-module (gnu packages boost) #:use-module (gnu packages compression) + #:use-module (gnu packages curl) #:use-module (gnu packages elf) #:use-module (gnu packages flex) #:use-module (gnu packages ghostscript) #:use-module (gnu packages gnupg) #:use-module (gnu packages groff) + #:use-module (gnu packages guile) #:use-module (gnu packages pciutils) #:use-module (gnu packages pkg-config) #:use-module (gnu packages libusb) #:use-module (gnu packages libftdi) + #:use-module (gnu packages linux) #:use-module (gnu packages pciutils) #:use-module (gnu packages qt) #:use-module (gnu packages tls)) @@ -295,6 +302,87 @@ (define-public rkflashtool RK3036, RK3066, RK312X, RK3168, RK3188, RK3288, RK3368.") (license license:bsd-2)))) +(define-public rpi-imager + (package + (name "rpi-imager") + (version "1.7.3") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/raspberrypi/rpi-imager") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (modules '((guix build utils) + (ice-9 ftw) + (srfi srfi-26))) + (snippet '(begin + ;; Remove all but the following bundled libraries, + ;; which are not yet packaged in Guix. + (define keep '("." ".." + "drivelist" + "mountutils" + "sha256crypt")) + (with-directory-excursion "src/dependencies" + (for-each delete-file-recursively + (scandir "." (negate + (cut member <> keep))))))) + (sha256 + (base32 + "0i7r1myhinhlgispq92nzvrjvbc48l87z8xfwc038l44qj1lsq8g")))) + (build-system qt-build-system) + (arguments + (list + #:tests? #f ;no test suite + #:configure-flags #~(list "-DENABLE_TELEMETRY=OFF") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'chdir + (lambda _ + (chdir "src"))) + (add-after 'chdir 'customize-os-list.json + ;; The default operating system JSON list contains non-FSDG + ;; systems. + (lambda _ + (let* ((datadir (string-append #$output + "/share/rpi-imager")) + (os-list.json (string-append datadir "/os-list.json"))) + (mkdir-p datadir) + #$(with-extensions (list guile-json-4) + #~(begin + (use-modules (json)) + (call-with-output-file os-list.json + ;; TODO: Register FSDG and RPi compatible OS + ;; images here. + (lambda (port) + (scm->json '() port))))) + (substitute* "config.h" + (("#define OSLIST_URL.*") + (string-append "#define OSLIST_URL \"file:///" + os-list.json "\"\n")))))) + (add-after 'chdir 'patch-cmake + (lambda _ + (substitute* "CMakeLists.txt" + ;; lsblk expects to have access to /sys/dev/block, + ;; which doesn't exist in the build container; + ;; prevent the check to fail the build. + (("ret EQUAL \"1\"") + "FALSE"))))))) + (inputs + (list gnutls + curl + libarchive + qtdeclarative-5 + qtquickcontrols2-5 + qtsvg-5 + qttools-5 + util-linux)) + (home-page "https://github.com/raspberrypi/rpi-imager/") + (synopsis "Raspberry Pi Imaging Utility") + (description "A graphical utility to easily provision and flash a memory +card with an operating system image suitable for the Raspberry Pi single board +computer.") + (license license:asl2.0))) + (define-public heimdall (package (name "heimdall") base-commit: b4be83b6ac7e2139bec5d3eaafcf8af6cbe50856 -- 2.38.1