From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id qHIuJQXpSGZZsQAAe85BDQ:P1 (envelope-from ) for ; Sat, 18 May 2024 19:44:37 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id qHIuJQXpSGZZsQAAe85BDQ (envelope-from ) for ; Sat, 18 May 2024 19:44:37 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=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"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1716054277; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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; bh=hwyk6vZeXwcq8dWXQt2+304gDzv5pU/9pGbfSFX/zwY=; b=LIrzcz2Lg15YAhb+8sOkvpbvKVaZs8Jt1KQHdk5v+mC7TZ7p3xg27Ps7EwX4AnC160Dk/h 7zaQf8YuInJvNYp/Nf40ca8taYYP9/FYTE7JTkZzZ1T7UG/WY9iUoVLDl84vW0NioxJn1m P/w3R0y5cbqO0bTs1ymI5zLyMVFe37aHDDVRKyz3mVMJHZUwiSP9DWalnMJkWrUepjnwAu 6n9JgXPyjdDxGhy6xrCGthlLr7AWerinkFCfYSBfxOKexIYNetMgryDXpB7WTWCV+43Qth WOAJLVbgtMqPnLhl39Q1pmW7Bodh3xfl6G9/Y4ejh09FQAmKHJDL34AEJi7MqQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1716054277; a=rsa-sha256; cv=none; b=TJUE82FXeHx4bPgJheOJAChDIToaX5Od88FM+Sv90HFmojK8NbGFsexfDqDcw0T69RR+8s rDPLa+btb31R313xvAjbGhHknkQbqhdSEsKuKYQVQt7vgHMs3JCTZS0CE2iDf6FXDYB5fJ Qa+ZEKZtL9brlwp3/7m0WPOszT6PfDXUZXLt+lKPZKwqtsVt8JtEG5vKbrlQjfU5v3/giR 6jBsZQrjqIUWrAi/EVfexcsQh905z66e8Pn854PW6fmyGuViA0/XKhiQ1e5vl0Pjond/UP d5b2TOdKazQqj3MKiVw5WIYagkJbs3MuncB33I3tU83cUrGyMZAW3t9M36YSXQ== 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 3D09660CD1 for ; Sat, 18 May 2024 19:44:37 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s8O6I-0003R7-Fa; Sat, 18 May 2024 13:44:07 -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 1s8O6B-0003Pk-Gq for guix-patches@gnu.org; Sat, 18 May 2024 13:43:59 -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 1s8O6B-0004v9-6K for guix-patches@gnu.org; Sat, 18 May 2024 13:43:59 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s8O6E-0002ug-NL for guix-patches@gnu.org; Sat, 18 May 2024 13:44:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70892] [PATCH v2 7/7] system: images: Add visionfive2 module. Resent-From: Zheng Junjie Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 18 May 2024 17:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70892 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70892@debbugs.gnu.org Received: via spool by 70892-submit@debbugs.gnu.org id=B70892.171605422011132 (code B ref 70892); Sat, 18 May 2024 17:44:02 +0000 Received: (at 70892) by debbugs.gnu.org; 18 May 2024 17:43:40 +0000 Received: from localhost ([127.0.0.1]:34688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s8O5p-0002tP-6T for submit@debbugs.gnu.org; Sat, 18 May 2024 13:43:40 -0400 Received: from smtp81.cstnet.cn ([159.226.251.81]:49288 helo=cstnet.cn) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s8O5d-0002sR-LJ for 70892@debbugs.gnu.org; Sat, 18 May 2024 13:43:30 -0400 Received: from m.tailaa68d.ts.net (unknown [183.247.5.112]) by APP-03 (Coremail) with SMTP id rQCowABXXpKt6Ehmk1vQCw--.11822S9; Sun, 19 May 2024 01:43:13 +0800 (CST) From: Zheng Junjie Date: Sun, 19 May 2024 01:43:04 +0800 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=y Content-Transfer-Encoding: 8bit X-CM-TRANSID: rQCowABXXpKt6Ehmk1vQCw--.11822S9 X-Coremail-Antispam: 1UD129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUOF7k0a2IF6F4UM7kC6x804xWl14x267AK xVW5JVWrJwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wAFIxvE14AKwVWUJVWUGw A2048vs2IY020E87I2jVAFwI0_JF0E3s1l82xGYIkIc2x26xkF7I0E14v26r1I6r4UM28l Y4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_JFI_Gr 1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1l84ACjcxK6I8E87Iv67AKxVWUJVW8 JwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UM2AIxVAIcxkEcVAq07x20xvEncxIr2 1le4C262xC7I0v67AEwI8IwI1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE 14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2 IYc2Ij64vIr41lw4CEx2IqxVAFz4v204v26I0v724l42xK82IYc2Ij64vIr41l4I8I3I0E 4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUJV WUGwC2zVAF1VAY17CE14v26r1j6r15MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_ JFI_Gr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rV WUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r1j6r4U YxBIdaVFxhVjvjDU0xZFpf9x07jYzuAUUUUU= X-Originating-IP: [183.247.5.112] X-CM-SenderInfo: x2kh0wxmxqyx3h6l2u1dvotugofq/ 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 X-Migadu-Spam-Score: -5.36 X-Spam-Score: -5.36 X-Migadu-Queue-Id: 3D09660CD1 X-Migadu-Scanner: mx13.migadu.com X-TUID: XemLnXaN9bKR * gnu/system/images/visionfive2.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. Change-Id: I8831f1148bcddb0d604e1174034fca85cd2887a1 --- gnu/local.mk | 1 + gnu/system/images/visionfive2.scm | 126 ++++++++++++++++++++++++++++++ 2 files changed, 127 insertions(+) create mode 100644 gnu/system/images/visionfive2.scm diff --git a/gnu/local.mk b/gnu/local.mk index 89839f799e..ee1dc2b41c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -778,6 +778,7 @@ GNU_SYSTEM_MODULES = \ %D%/system/images/pinebook-pro.scm \ %D%/system/images/rock64.scm \ %D%/system/images/unmatched.scm \ + %D%/system/images/visionfive2.scm \ %D%/system/images/wsl2.scm \ \ %D%/machine.scm \ diff --git a/gnu/system/images/visionfive2.scm b/gnu/system/images/visionfive2.scm new file mode 100644 index 0000000000..cc2667c7e3 --- /dev/null +++ b/gnu/system/images/visionfive2.scm @@ -0,0 +1,126 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2024 Zheng Junjie <873216071@qq.com> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu system images visionfive2) + #:use-module (gnu bootloader) + #:use-module (gnu bootloader u-boot) + #:use-module (gnu services dbus) + #:use-module (gnu services dns) + #:use-module (gnu services avahi) + #:use-module (gnu services shepherd) + #:use-module (gnu services ssh) + #:use-module (gnu services networking) + #:use-module (gnu image) + #:use-module (gnu packages linux) + #:use-module (guix packages) + + #:use-module (gnu packages ssh) + #:use-module (gnu packages guile-xyz) + #:use-module (gnu packages admin) + #:use-module (gnu services) + #:use-module (gnu services base) + #:use-module (gnu services networking) + #:use-module (gnu system) + #:use-module (gnu system file-systems) + #:use-module (gnu system image) + #:use-module (guix platforms riscv) + #:use-module (srfi srfi-26) + #:export (visionfive2-barebones-os + visionfive2-image-type + visionfive2-barebones-raw-image)) + +;;; Commentary: +;;; +;;; If trying to boot from MMC2, and see +;;; "No FDT memory address configured. Please configure", +;;; please boot from spl and do the following. +;;; +;;; uboot> setenv fdtfile starfive/jh7110-starfive-visionfive-2-v1.3b.dtb +;;; uboot> savenv +;;; +;;; and then try again boot from MMC2. +;;; +;;; ./pre-inst-env guix system image gnu/system/images/visionfive2.scm \ +;;; --target=riscv64-linux-gnu --no-grafts +;;; +;;; Code: + +(define visionfive2-barebones-os + (operating-system + (host-name "visionfive2") + (timezone "Etc/UTC") + (locale "en_US.utf8") + (bootloader (bootloader-configuration + (bootloader u-boot-starfive-visionfive2-bootloader) + (targets '("/dev/mmcblk0")))) + (file-systems (cons (file-system + (device (file-system-label "my-root")) + (mount-point "/") + (type "ext4")) + %base-file-systems)) + (kernel-arguments (list "earlycon" "clk_ignore_unused")) + (firmware '()) + (packages (append (list cloud-utils neofetch) %base-packages)) + (services + (append (list (service openssh-service-type + (openssh-configuration + (openssh openssh-sans-x) + (permit-root-login #t) + (allow-empty-passwords? #t))) + (service agetty-service-type + (agetty-configuration + (extra-options '("-L")) + (baud-rate "115200") + (term "vt100") + (tty "ttyS0"))) + (service dhcp-client-service-type)) + %base-services)))) + +(define visionfive2-disk-image + (image-without-os + (format 'disk-image) + (partition-table-type 'gpt) + (partitions (list + (partition + (size (* 1 (expt 2 20))) + (label "spl") + (offset (* 34 512)) + (file-system "unformatted") + (uuid (uuid "2E54B353-1271-4842-806F-E436D6AF6985"))) + (partition + (size (* 4 (expt 2 20))) + (label "uboot") + (offset (* 2082 512)) + (file-system "unformatted") + (uuid (uuid "BC13C2FF-59E6-4262-A352-B275FD6F7172"))) + root-partition)))) + +(define visionfive2-image-type + (image-type + (name 'visionfive2-raw) + (constructor (cut image-with-os visionfive2-disk-image <>)))) + +(define visionfive2-barebones-raw-image + (image + (inherit + (os+platform->image visionfive2-barebones-os riscv64-linux + #:type visionfive2-image-type)) + (name 'visionfive2-barebones-raw-image))) + +;; Return the default image. +visionfive2-barebones-raw-image -- 2.41.0