I've been daily driving my MNT Pocket Reform for a year now, but only recently managed to set-up Guix System earlier this January, after a year of failed attempts. As of a few weeks ago I've been running:
- Guix System using the (available in guix proper)
linux-libre-arm64-mnt-reformkernel. - Installed on an NVMe SSD (which is possible since the latest reform upstream u-boot that gave NVMe precedence over EMMC).
and all of that has been pretty stable so far.
I'll try to briefly describe my setup and what's necessary to install Guix System here. This is mostly based on vagrantc/mnt-reform-guix-config and is using packages Vagrant upstreamed (who should get all the credit for enabling hardware support for MNT laptops in Guix System, I didn't do anything besides writing my operating-system declaration for my current set-up).
A Minimal operating-system Declaration
It's probably a good idea to preface this post with the
operating-system declaration I currently use on my Pocket Reform as
it's quite minimal and gives a brief first overview of my setup:
(operating-system
(host-name "minty")
(timezone "Europe/Paris")
(locale "en_US.utf8")
(keyboard-layout (keyboard-layout "us" "altgr-intl"))
(bootloader (bootloader-configuration
(bootloader u-boot-bootloader)))
(file-systems (cons (file-system
(device (uuid "5bab4a71-b736-4534-b59b-824554610a06"))
(mount-point "/")
(type "ext4")) %base-file-systems))
(kernel linux-libre-arm64-mnt-reform)
(kernel-loadable-modules (list reform2-lpc-module))
(kernel-arguments %mnt-pocket-reform-kernel-args)
(initrd-modules %mnt-pocket-reform-initrd-modules)
(users (cons* (user-account
(name "theesm")
(group "users")
(supplementary-groups '("wheel" "netdev" "audio" "video")))
%base-user-accounts))
(packages (append mnt-pocket-reform-sway-desktop-packages %base-packages))
(services
(modify-services minty-services
(delete login-service-type)
(delete mingetty-service-type))))%mnt-pocket-reform-kernel-argscontains a list of kernel-args that's similiar to what the stock image is using:
(define %mnt-pocket-reform-kernel-args (list "no_console_suspend"
"cryptomgr.notests"
"loglevel=3"
"clk_ignore_unused"
"cma=256M"
"swiotlb=65535"
"console=ttyS2,1500000"
"fbcon=rotate:3"
"fbcon=font:TER16x32"
"console=tty1"))(note: the fbcon configuration has no effect, never bothered to
remove it though)
%mnt-pocket-reform-initrd-modulescontains a list of initrd modules which ressembles what Vagrants MNT Reform config is using and which is working for the Pocket Reform as well (I don't know if all modules are necessary though):
(define %mnt-pocket-reform-initrd-modules (list "rfkill" "dm_mod" "rk805_pwrkey" "hantro_vpu"
"snd_soc_wm8960" "v4l2_vp9" "rockchip_saradc" "v4l2_h2
64" "v4l2_jpeg"
"industrialio_triggered_buffer" "v4l2_mem2mem" "rockch
ip_thermal"
"kfifo_buf" "snd_soc_rockchip_i2s_tdm" "videobuf2_dma_
contig"
"videobuf2_memops" "videobuf2_v4l2" "panthor" "videode
v" "drm_gpuvm"
"videobuf2_common" "drm_exec" "snd_soc_audio_graph_card" "mc"
"drm_shmem_helper" "gpu_sched" "snd_soc_simple_card_utils"
"pci_endpoint_test" "fuse" "x_tables" "ipv6" "onboard_usb_dev"
"dwmac_rk" "stmmac_platform" "stmmac" "phy_rockchip_naneng_combphy"
"phy_rockchip_usbdp" "typec" "rtc_pcf8523"
"phy_rockchip_samsung_hdptx" "pcs_xpcs" "nvme" "nvme_core"
"rockchipdrm" "analogix_dp" "dw_hdmi_qp" "dw_mipi_dsi" "ahci"
"dm-crypt" "xts"))mnt-pocket-reform-sway-desktop-packagescontains a list of system packages I use, mostly sway and sway adjacent stuff as well as a handful of utilities.minty-servicescontains a list of services I use on the pocket reform. I included vagrantc/mnt-reform-guix-config: reform-hw-setup-service in it which is the only Pocket Reform specific service, It's not necessary to be able to use Guix System on the Pocket Reform though.
Bootloader
I think being able to properly boot via NVMe was the missing bit that enabled me to switch from the stock debian-based image to Guix System, as I never took the chance to install it to EMMC (which probably would've meant replacing the stock u-boot) and running Guix System from microSD had poor performance.
My current set-up relies on the presence of the stock u-boot on
EMMC, which would consume the /boot/extlinux/extlinux.conf generated
by the generic u-boot package that's included in the bootloader bit:
(bootloader (bootloader-configuration
(bootloader u-boot-bootloader)))of my systems configuration.scm.
I did experiment with including the non-free u-boot package in my
configuration at first, trying to come up with something that could be
used in the bootloader section of the operating-system declaration,
but that pretty much lead to nowhere, while creating the initial
microSD image. I didn't understand at that time that doing so wasn't
necessary to boot from microSD, as providing a extlinux.conf to be
found on microSD or NVMe would be good enough for the stock u-boot to
let Guix System boot.
Networking
I use USB tethered networking provided by my Oneplus 6t (WiFi and mobile data) as I haven't gotten around to permanently install a WiFi card in it yet. I mostly use mobile data while being away from home and have my phone plugged in while sitting at my desk at home, so it's pretty convenient for my scenario.
I think I'll end up putting something ath9k based in it as soon as my
Headset/Switch Board
2.0
arrives, so I would be able to continue using linux-libre and to use
pre-build substitutes for the kernel. Even though the rk3588 is
powerful enough to build its kernel from source. I currently have to build
a modified kernel from source until my pull request to add wireguard and USB
tethering support to the
MNT kernel variant is merged, which takes between 40-50m per kernel
build.
Regarding WiFi option if we want to stay libre and blob-free there are two options that would probably be fitting the M.2 NGFF slot:
- Atheros QCNFA335
- Atheros QCNFA222
reform2-lpc (DKMS)
Guix proper provides a package for the reform2-lpc DKMS module that
enables to read the battery status and is necessary to fully shutdown
the Pocket Reform from userspace. It can be passed to
kernel-loadable-modules in a operating-system declaration:
(kernel-loadable-modules (list reform2-lpc-module))Battery
On most days, I'm able to get 3-4h of battery life out of the Pocket Reform until it needs a charge, depending on display brightness and what CPU governor I set. It could be improved by putting larger batteries in it, but I fail to see the need to do that for my usage scenario. I get similar results using the stock debian-based operating system.
Installing Guix System
I booted a minimal config that's similar to my current
operating-system declaration minus the sway parts from microSD and
pretty much just guix system inited to the NVMe, rebooted, and
have been enjoying Guix System on my Pocket Reform ever since.
This is the image type I've used to build the microSD image alongside
a operating-system declaration that's similiar to the one opening
this post:
(define mnt-pocket-reform-image-type
(image-type
(name 'mnt-pocket-reform-raw)
(constructor (lambda (os)
(image
(inherit
(raw-with-offset-disk-image (* 16 (expt 2 20))))
(operating-system os)
(platform aarch64-linux))))))
(define mnt-pocket-reform-barebones-raw-image
(image
(inherit
(os+platform->image mnt-pocket-reform-sway-os aarch64-linux
#:type mnt-pocket-reform-image-type))
(name 'mnt-pocket-reform-barebones-raw-image)))
mnt-pocket-reform-barebones-raw-imageeven though running Guix as a foreign package manager on top of the
stock OS would've been good enough to install via guix system init
to NVMe as well, so building a microSD image first isn't strictly
necessary.
tldr
To be able to use Guix System on the rk3588 we need:
- a recent stock u-boot running on the MNT Pocket Reform EMMC that includes NVMe in its boot order.
- a generic
u-boot-bootloaderconfiguration in ouroperating-systemdeclaration that generates anextlinux.confthat can be consumed by said stock u-boot. - the
linux-libre-arm64-mnt-reformkernel available in guix proper. - the
reform2-lpc-modulethat's also available in guix proper.
and either a microSD image or guix as a foreign package manager to run
guix system image or init from.