;; Based on gnu/system/examples/beaglebone-black.scm in Guix source code ;; ;; This file is not 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 (system) #:use-module (gnu) #:use-module (gnu bootloader u-boot) #:use-module (gnu services networking) #:use-module (gnu services ssh) #:use-module (guix packages) #:export (rockpro64-operating-system)) (define-public linux-libre-6.3.5-pristine-source (let ((version "6.3.5") (hash (base32 "0pl2zypsmrnna69850jadccffxwg9xdfkldg0sv8m44b7n64gkgm"))) ((@@ (gnu packages linux)make-linux-libre-source) version ((@@ (gnu packages linux)%upstream-linux-source) version hash) (@@ (gnu packages linux)deblob-scripts-6.3)))) (define-public linux-libre-6.3.5-source ((@@ (gnu packages linux)source-with-patches) linux-libre-6.3.5-pristine-source (list (@@ (gnu packages linux)%boot-logo-patch) (@@ (gnu packages linux)%linux-libre-arm-export-__sync_icache_dcache-patch)))) (define* (rockpro64-kernel-config arch #:key variant) (local-file "kernel.config")) (define-public linux-libre-rockpro64 ((@@ (gnu packages linux) make-linux-libre*) "6.3.5" "gnu" linux-libre-6.3.5-source '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "powerpc64le-linux" "riscv64-linux") #:configuration-file rockpro64-kernel-config #:extra-version "rockpro64")) (define rockpro64-operating-system (operating-system (host-name "rockpro64") (timezone "Europe/Paris") (bootloader (bootloader-configuration (bootloader u-boot-rockpro64-rk3399-bootloader) (targets '("/dev/mmcblk2")))) (kernel linux-libre-rockpro64) (initrd-modules (append (list "dw_mmc-rockchip" ;; For uSD boot ;; CONFIG_MMC_DW_ROCKCHIP "dwc3" ;; For USB boot ;; CONFIG_USB_DWC3 "dwc3_of_simple" ;; For USB boot ;; CONFIG_USB_DWC3_OF_SIMPLE "ehci_platform" ;; For USB boot ;; CONFIG_USB_EHCI_HCD_PLATFORM "fixed" ;; For USB boot ;; CONFIG_REGULATOR_FIXED_VOLTAGE "i2c_rk3x" ;; For uSD boot ;; CONFIG_I2C_RK3X "ohci_platform" ;; For USB boot ;; CONFIG_USB_OHCI_HCD_PLATFORM "phy_rockchip_emmc" ;; For eMMC boot ;; CONFIG_PHY_ROCKCHIP_EMMC "phy_rockchip_inno_usb2" ;; For USB boot ;; CONFIG_PHY_ROCKCHIP_INNO_USB2 "phy_rockchip_usb" ;; For USB boot ;; CONFIG_PHY_ROCKCHIP_USB "pl330" ;; For uSD boot ;; CONFIG_USB_SERIAL_PL2303 "rk808" ;; For uSD boot ;; CONFIG_MFD_RK808 "rk808_regulator" ;; For uSD boot ;; CONFIG_REGULATOR_RK808 "sd_mod" ;; For USB boot ;; CONFIG_BLK_DEV_SD "sdhci_of_arasan" ;; For eMMC boot ;; CONFIG_MMC_SDHCI_OF_ARASAN "uas" ;; For USB boot ;; CONFIG_USB_UAS "usb_storage" ;; For USB boot ;; CONFIG_USB_STORAGE "xhci_plat_hcd") ;; For USB boot ;; CONFIG_USB_XHCI_PLATFORM %base-initrd-modules)) ;; rootdelay=5 is needed for booting USB boot (kernel-arguments (append '("loglevel=8" "rootdelay=5"))) (file-systems (append (list (file-system (mount-point "/") (device "/dev/mmcblk2p2") (type "ext4"))) %base-file-systems)) (services (append (list (service agetty-service-type (agetty-configuration (extra-options '("-L")) ;no carrier detect (baud-rate "1500000") (term "vt100") (tty "ttyS2"))) (service static-networking-service-type (list (static-networking (addresses (list (network-address (device "eth0") (value "192.168.10.35/24")))) (routes (list (network-route (destination "default") (gateway "192.168.10.1")))) (name-servers '("192.168.10.1"))))) (service openssh-service-type (openssh-configuration (port-number 222) (permit-root-login #t) (password-authentication? #f) (challenge-response-authentication? #f) (authorized-keys `(("root" ,(local-file "id_ed25519.pub"))))))) (modify-services %base-services (guix-service-type config => (guix-configuration (authorized-keys (append (list (local-file "signing-key.pub")) %default-authorized-guix-keys))))))))) rockpro64-operating-system