From patchwork Mon Mar 28 18:43:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arun Isaac X-Patchwork-Id: 38163 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 1423E27BBEA; Mon, 28 Mar 2022 19:44:56 +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=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 CE0BD27BBE9 for ; Mon, 28 Mar 2022 19:44:55 +0100 (BST) Received: from localhost ([::1]:53828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nYuMI-0000vb-OZ for patchwork@mira.cbaines.net; Mon, 28 Mar 2022 14:44:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYuLS-0000uC-Ak for guix-patches@gnu.org; Mon, 28 Mar 2022 14:44:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37067) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nYuLR-0006Qt-Kj for guix-patches@gnu.org; Mon, 28 Mar 2022 14:44:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nYuLR-0001WE-J0 for guix-patches@gnu.org; Mon, 28 Mar 2022 14:44:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54615] [PATCH 1/2] gnu: spike: Substitute path to dtc instead of wrapping executables. References: <20220328184117.25158-1-arunisaac@systemreboot.net> In-Reply-To: <20220328184117.25158-1-arunisaac@systemreboot.net> Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 28 Mar 2022 18:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54615 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54615@debbugs.gnu.org Cc: Arun Isaac , Efraim Flashner Received: via spool by 54615-submit@debbugs.gnu.org id=B54615.16484930065782 (code B ref 54615); Mon, 28 Mar 2022 18:44:01 +0000 Received: (at 54615) by debbugs.gnu.org; 28 Mar 2022 18:43:26 +0000 Received: from localhost ([127.0.0.1]:59195 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYuKr-0001VA-VY for submit@debbugs.gnu.org; Mon, 28 Mar 2022 14:43:26 -0400 Received: from mugam.systemreboot.net ([139.59.75.54]:51780) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYuKq-0001Uv-8K for 54615@debbugs.gnu.org; Mon, 28 Mar 2022 14:43:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Hikk2s2WOCJriNhOiBAW9g6iWECrb84FDWks6/SENCc=; b=C+nRRd+grwwdb2iRyztzErbEgs FieT0IoeKqOv7HUOGdaM/+S6EOWkDyP/iOKGhPP1VrWv9IzOcuUl4hF5Umw08iv1nYYK+/pc+a0l9 Lf7EuHAlkEgagSjTPx+X/XTbALVAIj76r15mlDAIzAdovbduWI7Osm1OIIbeKxb0ynEwYwOLXZH1c tzQVKUW4kULSRVrk5HBxSwCYKDEEbCKDGQdJbyOYI3DYPiVkZmLx5HYAwK48QgyIZGDJFo1sCAu8i 8CXJmpT9/SwlknhKKwqlicwCYlcGoWbq71IEmTMlo4iCLI+CVkcDD3ElI4bBsg4kV6TZPb0oPJB38 GvVi9KIg==; Received: from [192.168.2.1] (port=7222 helo=localhost.localdomain) by systemreboot.net with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1nYuKn-000OKi-3A; Tue, 29 Mar 2022 00:13:21 +0530 From: Arun Isaac Date: Tue, 29 Mar 2022 00:13:18 +0530 Message-Id: <20220328184319.25281-1-arunisaac@systemreboot.net> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/virtualization.scm (spike)[arguments]: Delete the wrap-binary phase. Add a configure-dtc-path phase that substitutes the absolute path to dtc. --- gnu/packages/virtualization.scm | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index bd297977df..9c86670ce7 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -26,6 +26,7 @@ ;;; Copyright © 2021 Raghav Gururajan ;;; Copyright © 2022 Oleg Pykhalov ;;; Copyright © 2022 Ekaitz Zarraga +;;; Copyright © 2022 Arun Isaac ;;; ;;; This file is part of GNU Guix. ;;; @@ -1037,15 +1038,12 @@ (define-public spike (list #:phases #~(modify-phases %standard-phases - (add-after 'install 'wrap-binary - (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (for-each - (lambda (file) - (wrap-program file - `("PATH" ":" prefix - (,(dirname (search-input-file inputs "/bin/dtc")))))) - (find-files (string-append out "/bin"))))))))) + (add-before 'configure 'configure-dtc-path + (lambda* (#:key inputs #:allow-other-keys) + ;; Reference dtc by its absolute store path. + (substitute* "riscv/dts.cc" + (("DTC") + (string-append "\"" (assoc-ref inputs "dtc") "/bin/dtc\"")))))))) (inputs (list bash-minimal dtc)) (native-inputs From patchwork Mon Mar 28 18:43:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Isaac X-Patchwork-Id: 38164 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 2675127BBEA; Mon, 28 Mar 2022 19:44:57 +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=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 DC20527BBE9 for ; Mon, 28 Mar 2022 19:44:56 +0100 (BST) Received: from localhost ([::1]:53844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nYuMK-0000wu-1w for patchwork@mira.cbaines.net; Mon, 28 Mar 2022 14:44:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45096) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYuLS-0000uI-Bc for guix-patches@gnu.org; Mon, 28 Mar 2022 14:44:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37068) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nYuLS-0006Qv-0y for guix-patches@gnu.org; Mon, 28 Mar 2022 14:44:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nYuLR-0001WM-VX for guix-patches@gnu.org; Mon, 28 Mar 2022 14:44:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54615] [PATCH 2/2] gnu: Add riscv-pk. Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 28 Mar 2022 18:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54615 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54615@debbugs.gnu.org Cc: Arun Isaac , Efraim Flashner Received: via spool by 54615-submit@debbugs.gnu.org id=B54615.16484930065788 (code B ref 54615); Mon, 28 Mar 2022 18:44:01 +0000 Received: (at 54615) by debbugs.gnu.org; 28 Mar 2022 18:43:26 +0000 Received: from localhost ([127.0.0.1]:59197 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYuKs-0001VC-77 for submit@debbugs.gnu.org; Mon, 28 Mar 2022 14:43:26 -0400 Received: from mugam.systemreboot.net ([139.59.75.54]:51782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYuKq-0001Uw-92 for 54615@debbugs.gnu.org; Mon, 28 Mar 2022 14:43:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=yyISSW7Eb1qsGVJmZcZMEKHDl5IYFskRS4ErdVCMQiE=; b=IPhTzFgYEALzF0aNw0CUdrhXUk /CPKsLOmtAbwflOmsCQOaqVLikQCg9i9fPb/rmmpmEIIcl7LTdszpwb/9z2lpCky6afD6EsVXgWvd 8DbrRrP/qh/U7ovOXSpZ4go1G2Gs4T4U9fbixkKh0/aNUkk5Wdad5ZL1PH79tCy6eLD+SLvzO/4lL xsi9Dwz1uOJIpZTdmuCxuOnBe/Lt1te7uOrrJqMKIh4r289YY8JI7oJ41pOs8ztkS7zUT020XKXk4 JwJXsS2BSGMDTqKKj3OXBorQdW5ypZzCeP05mlfZTWV/39/ziy98xqxovl536I98fFvxgCMd3VDDM i3lpMItQ==; Received: from [192.168.2.1] (port=7222 helo=localhost.localdomain) by systemreboot.net with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1nYuKn-000OKi-8f; Tue, 29 Mar 2022 00:13:21 +0530 From: Arun Isaac Date: Tue, 29 Mar 2022 00:13:19 +0530 Message-Id: <20220328184319.25281-2-arunisaac@systemreboot.net> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220328184319.25281-1-arunisaac@systemreboot.net> References: <20220328184319.25281-1-arunisaac@systemreboot.net> MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/virtualization.scm (riscv-pk): New variable. --- gnu/packages/virtualization.scm | 48 +++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index 9c86670ce7..1f83addb1b 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -2365,3 +2365,51 @@ (define-public python-transient "@code{transient} is a wrapper for QEMU allowing the creation of virtual machines with shared folder, ssh, and disk creation support.") (license license:expat))) + +(define-public riscv-pk + (package + (name "riscv-pk") + (version "1.0.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/riscv-software-src/riscv-pk") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1cc0rz4q3a1zw8756b8yysw8lb5g4xbjajh5lvqbjix41hbdx6xz")))) + (build-system gnu-build-system) + (arguments + `(#:make-flags (list (string-append "INSTALLDIR=" + (assoc-ref %outputs "out"))) + ;; Add flags to keep symbols fromhost and tohost. These symbols are + ;; required for the correct functioning of pk. + #:strip-flags (list "--strip-unneeded" + "--keep-symbol=fromhost" + "--keep-symbol=tohost" + "--enable-deterministic-archives") + #:phases + (modify-phases %standard-phases + (add-before 'configure 'pre-configure + (lambda _ + ;; Building directly in the source tree is not supported. So, + ;; create a build directory and make configure accessible from + ;; there. + (mkdir-p "build") + (chdir "build") + (symlink "../configure" "configure"))) + (delete 'strip)))) + (home-page "https://github.com/riscv-software-src/riscv-pk") + (synopsis "RISC-V Proxy Kernel") + (description "The RISC-V Proxy Kernel, @command{pk}, is a lightweight +application execution environment that can host statically-linked RISC-V ELF +binaries. It is designed to support tethered RISC-V implementations with +limited I/O capability and thus handles I/O-related system calls by proxying +them to a host computer. + +This package also contains the Berkeley Boot Loader, @command{bbl}, which is a +supervisor execution environment for tethered RISC-V systems. It is designed +to host the RISC-V Linux port.") + (license license:bsd-3)))