| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 |
|
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 |
|
| 32 | (define-module (gnu system images visionfive2)
|
| 33 | #:use-module (gnu bootloader)
|
| 34 | #:use-module (gnu bootloader u-boot)
|
| 35 | #:use-module (gnu services dbus)
|
| 36 | #:use-module (gnu services dns)
|
| 37 | #:use-module (gnu services avahi)
|
| 38 | #:use-module (gnu services shepherd)
|
| 39 | #:use-module (gnu services ssh)
|
| 40 | #:use-module (gnu services networking)
|
| 41 | #:use-module (gnu image)
|
| 42 | #:use-module (gnu packages linux)
|
| 43 | #:use-module (guix packages)
|
| 44 |
|
| 45 | #:use-module (gnu packages ssh)
|
| 46 | #:use-module (gnu packages guile-xyz)
|
| 47 | #:use-module (gnu packages admin)
|
| 48 | #:use-module (gnu services)
|
| 49 | #:use-module (gnu services base)
|
| 50 | #:use-module (gnu services networking)
|
| 51 | #:use-module (gnu system)
|
| 52 | #:use-module (gnu system file-systems)
|
| 53 | #:use-module (gnu system image)
|
| 54 | #:use-module (gnu system linux-initrd)
|
| 55 | #:use-module (guix platforms riscv)
|
| 56 | #:use-module (srfi srfi-26)
|
| 57 | #:export (visionfive2-barebones-os
|
| 58 | visionfive2-image-type
|
| 59 | visionfive2-barebones-raw-image))
|
| 60 |
|
| 61 | (define visionfive2-barebones-os
|
| 62 | (operating-system
|
| 63 | (host-name "visionfive2")
|
| 64 | (timezone "Etc/UTC")
|
| 65 | (locale "en_US.utf8")
|
| 66 | (bootloader (bootloader-configuration
|
| 67 | (bootloader u-boot-starfive-visionfive2-bootloader)
|
| 68 | (targets '("/dev/mmcblk0"))))
|
| 69 | (file-systems (cons (file-system
|
| 70 | (device (file-system-label "Guix_image"))
|
| 71 | (mount-point "/")
|
| 72 | (type "ext4"))
|
| 73 | %base-file-systems))
|
| 74 | (kernel-arguments (list "earlycon" "clk_ignore_unused"))
|
| 75 | (initrd-modules
|
| 76 | (append (list "mmc_block"
|
| 77 | "clk-starfive-jh7110-aon"
|
| 78 | "clk-starfive-jh7110-stg"
|
| 79 | "phy-jh7110-dphy-tx"
|
| 80 | "pcie_starfive"
|
| 81 | "nvme")
|
| 82 | %base-initrd-modules))
|
| 83 | (firmware '())
|
| 84 | (packages (append (list cloud-utils neofetch) %base-packages))
|
| 85 | (services
|
| 86 | (append (list (service openssh-service-type
|
| 87 | (openssh-configuration
|
| 88 | (openssh openssh-sans-x)
|
| 89 | (permit-root-login #t)
|
| 90 | (allow-empty-passwords? #t)))
|
| 91 | (service agetty-service-type
|
| 92 | (agetty-configuration
|
| 93 | (extra-options '("-L"))
|
| 94 | (baud-rate "115200")
|
| 95 | (term "vt100")
|
| 96 | (tty "ttyS0")))
|
| 97 | (service dhcpcd-service-type))
|
| 98 | %base-services))))
|
| 99 |
|
| 100 | (define visionfive2-disk-image
|
| 101 | (image-without-os
|
| 102 | (name 'visionfive2-disk-image)
|
| 103 | (format 'disk-image)
|
| 104 | (partition-table-type 'gpt)
|
| 105 | (partitions (list
|
| 106 | (partition
|
| 107 | (size (* 1 (expt 2 20)))
|
| 108 | (label "spl")
|
| 109 | (offset (* 34 512))
|
| 110 | (file-system "unformatted")
|
| 111 | (uuid (uuid "2E54B353-1271-4842-806F-E436D6AF6985")))
|
| 112 | (partition
|
| 113 | (size (* 4 (expt 2 20)))
|
| 114 | (label "uboot")
|
| 115 | (offset (* 2082 512))
|
| 116 | (file-system "unformatted")
|
| 117 | (uuid (uuid "BC13C2FF-59E6-4262-A352-B275FD6F7172")))
|
| 118 | root-partition))))
|
| 119 |
|
| 120 | (define visionfive2-image-type
|
| 121 | (image-type
|
| 122 | (name 'visionfive2-raw)
|
| 123 | (constructor (cut image-with-os visionfive2-disk-image <>))))
|
| 124 |
|
| 125 | (define visionfive2-barebones-raw-image
|
| 126 | (image
|
| 127 | (inherit
|
| 128 | (os+platform->image visionfive2-barebones-os riscv64-linux
|
| 129 | #:type visionfive2-image-type))
|
| 130 | (name 'visionfive2-barebones-raw-image)))
|
| 131 |
|
| 132 | |
| 133 | visionfive2-barebones-raw-image
|