unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Zheng Junjie <zhengjunjie@iscas.ac.cn>
To: 70892@debbugs.gnu.org
Subject: [bug#70892] [PATCH 6/6] system: images: Add visionfive2 module.
Date: Sun, 12 May 2024 19:09:29 +0800	[thread overview]
Message-ID: <ba042e0da84979ba7611c68044384184ad359cc6.1715508730.git.zhengjunjie@iscas.ac.cn> (raw)
In-Reply-To: <cover.1715508730.git.zhengjunjie@iscas.ac.cn>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 5426 bytes --]

* 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 | 121 ++++++++++++++++++++++++++++++
 2 files changed, 122 insertions(+)
 create mode 100644 gnu/system/images/visionfive2.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 439fe587b0..ac3aa9fcc8 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..31d1948ab9
--- /dev/null
+++ b/gnu/system/images/visionfive2.scm
@@ -0,0 +1,121 @@
+;;; 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 <http://www.gnu.org/licenses/>.
+
+(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:
+;;;
+;;;  for now, must boot from spl, mmc boot fail.
+;;;  so must set fdtfile.
+;;;  uboot> setenv fdtfile starfive/jh7110-starfive-visionfive-2-v1.3b.dtb
+;;;  uboot> savenv
+;;;
+;;; ./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
+     (append (list "console=ttyS0,115200"
+                   "rootwait"
+                   "earlycon"
+                   "clk_ignore_unused")
+             %default-kernel-arguments))
+    (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 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





  parent reply	other threads:[~2024-05-12 11:11 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-12 11:00 [bug#70892] [PATCH 0/6] Add visionfive2 support Zheng Junjie
2024-05-12 11:09 ` [bug#70892] [PATCH 1/6] gnu: linux-libre-6.8: add riscv config Zheng Junjie
2024-05-12 11:09 ` [bug#70892] [PATCH 2/6] image: raise error when use both grub-efi* bootloader and not gpt image Zheng Junjie
2024-05-12 11:09 ` [bug#70892] [PATCH 3/6] gnu: shepherd-0.10: When target riscv64, use guile-fibers-1.1 Zheng Junjie
2024-05-12 11:09 ` [bug#70892] [PATCH 4/6] gnu: Add u-boot-starfive-visionfive2 Zheng Junjie
2024-05-15 17:59   ` Vagrant Cascadian
2024-05-18 17:58     ` Zheng Junjie
2024-05-12 11:09 ` [bug#70892] [PATCH 5/6] bootloader: Add u-boot-starfive-visionfive2-bootloader Zheng Junjie
2024-05-12 11:09 ` Zheng Junjie [this message]
2024-05-15 18:02 ` [bug#70892] [PATCH 0/6] Add visionfive2 support Vagrant Cascadian
2024-05-18 17:42 ` [bug#70892] [PATCH v2 0/7] " Zheng Junjie
2024-05-18 17:42   ` [bug#70892] [PATCH v2 1/7] gnu: linux-libre-6.8: add riscv config Zheng Junjie
2024-05-19 10:42     ` 宋文武 via Guix-patches via
2024-05-18 17:42   ` [bug#70892] [PATCH v2 2/7] image: raise error when use both grub-efi* bootloader and not gpt image Zheng Junjie
2024-05-18 17:43   ` [bug#70892] [PATCH v2 3/7] gnu: shepherd-0.10: When target riscv64, use guile-fibers-1.1 Zheng Junjie
2024-05-18 17:43   ` [bug#70892] [PATCH v2 4/7] gnu: Add opensbi-for-visionfive2 Zheng Junjie
2024-05-19 10:38     ` 宋文武 via Guix-patches via
2024-05-18 17:43   ` [bug#70892] [PATCH v2 5/7] gnu: Add u-boot-starfive-visionfive2 Zheng Junjie
2024-05-18 17:43   ` [bug#70892] [PATCH v2 6/7] bootloader: Add u-boot-starfive-visionfive2-bootloader Zheng Junjie
2024-05-18 17:43   ` [bug#70892] [PATCH v2 7/7] system: images: Add visionfive2 module Zheng Junjie
2024-05-19  9:33     ` 宋文武 via Guix-patches via
2024-05-19 14:15 ` [bug#70892] [PATCH v3 0/7] Add visionfive2 support Zheng Junjie
2024-05-19 14:15   ` [bug#70892] [PATCH v3 1/7] gnu: linux-libre-6.8: Add riscv config Zheng Junjie
2024-05-19 14:15   ` [bug#70892] [PATCH v3 2/7] image: Raise error when use both grub-efi* bootloader and not gpt image Zheng Junjie
2024-05-19 14:15   ` [bug#70892] [PATCH v3 3/7] gnu: shepherd-0.10: When target riscv64, use guile-fibers-1.1 Zheng Junjie
2024-05-19 14:15   ` [bug#70892] [PATCH v3 4/7] gnu: Add opensbi-for-visionfive2 Zheng Junjie
2024-05-19 14:15   ` [bug#70892] [PATCH v3 5/7] gnu: Add u-boot-starfive-visionfive2 Zheng Junjie
2024-05-19 14:15   ` [bug#70892] [PATCH v3 6/7] bootloader: Add u-boot-starfive-visionfive2-bootloader Zheng Junjie
2024-05-19 14:15   ` [bug#70892] [PATCH v3 7/7] system: images: Add visionfive2 module Zheng Junjie
2024-05-22  3:22   ` bug#70892: [PATCH v3 0/7] Add visionfive2 support Z572

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ba042e0da84979ba7611c68044384184ad359cc6.1715508730.git.zhengjunjie@iscas.ac.cn \
    --to=zhengjunjie@iscas.ac.cn \
    --cc=70892@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).