;; -*- mode: scheme; -*- (use-modules (gnu) (gnu bootloader) (gnu bootloader u-boot) (gnu image) (gnu packages linux) (gnu services) (gnu services base) (gnu services networking) (gnu system) (gnu system file-systems) (gnu system image) (guix platforms riscv) (srfi srfi-26)) (use-package-modules linux firmware tls bootloaders) (define os (operating-system (host-name "riscv") (timezone "Asia/Shanghai") (locale "en_US.utf8") (initrd-modules '()) (firmware '()) (bootloader (bootloader-configuration (bootloader (bootloader (inherit u-boot-bootloader) (package u-boot-lichee-rv-dock) (disk-image-installer #~(lambda (bootloader root-index image) (let ((u-boot (string-append bootloader "/libexec/u-boot-sunxi-with-spl.bin"))) (write-file-on-device u-boot (stat:size (stat u-boot)) image (* 256 512))))))) (targets (list "/dev/mmcblk0")))) (kernel linux-libre-riscv64-generic) (kernel-arguments (list "earlycon=sbi" "console=ttyS0,115200n8" "rootwait")) (file-systems (cons* (file-system (device (file-system-label "my-root")) (mount-point "/") (type "ext4")) %base-file-systems)))) (define licheepi-rv-dock-image-type (image-type (name 'licheepi-rv-dock) (constructor (lambda (os) (image (inherit (raw-with-offset-disk-image (expt 2 22))) (partition-table-type 'gpt) (operating-system os) (platform riscv64-linux)))))) (define licheepi-rv-dock-raw-image (image (inherit (os+platform->image os riscv64-linux #:type licheepi-rv-dock-image-type)) (name 'licheepi-rv-dock-raw-image))) licheepi-rv-dock-raw-image