Lab notes

A MNT Reform laptop

I’ve got Reform serial number 37 with the original IMX8MQ module, original LPC and keyboard controller, and 1TB internal SSD. It’s a fantastic machine and Lukas has done incredible things to advance the state of the art in open personal computing.

You may see some references to “Reform 2” in places. This is the shipping model of the machine, the original “Reform” being based on the i.MX6 processor instead, similar to the Novena. Almost everywhere you see “Reform” on the web it refers to the “Reform 2” machine discussed on this page.

These hardware changes have been made to my Reform since receiving the machine:

Debian on…

josch has put considerable work in to producing both complete, bootable system images and minimal installer images based on Debian Bookworm. The complete system images should be indistinguishable from the factory shipped full system image from MNT except they’re based on Debian’s current stable release instead of testing. The installer images are closer to a “vanilla Debian installer”, but handle installing the reform-* tools, the patched kernel, package repository, u-boot etc.

The rest of these notes are focussed on the “installer image” process as I have yet to really test the complete system images and they’re less desirable for my purposes.

Currently the Debian installer images are best suited for someone with good experience using and troubleshooting Debian. They are a work in progress and likely to continue changing over time. The complete system images are a much more “ready to go out of the box” experience.

Installer images

As at 2024-06-20, there are two installer image options for the IMX8MQ - one using the standard bookworm kernel (6.1.x) and one using the bookworm-backports kernel (6.5.x).

Standard image
Works when booted from SD card.
Backported kernel image
Currently does not display any output on the internal LCD after starting the kernel.

Notably the backport kernel is functional once the system has been installed, so currently to use this kernel you’ll need to install the standard image and then upgrade to the backport kernel.

TODO I’m assuming that you don’t need or want to coexist with the existing rescue image shipped on the Reform’s eMMC volume. It might be possible to have the installer “install around” this, particularly if flash-kernel is used, but I am not 100% sure yet.

Booting

By default the Reform will attempt to boot u-boot from the external SD card socket, so booting the installer should only require writing the installer image to an SD card, inserting the card and rebooting.

It is likely that after running the installer you will want to reconfigure the Reform to allow it to boot u-boot from the SoM’s internal eMMC storage. This requires removing the bottom case of the Reform, removing the heatsink from the SoM and flipping the switch SW1 as shown in this forum post to OFF. This means you can install Debian with both your /boot partition and the u-boot boot loader on the eMMC, or potentially configure flash-kernel to manage the eMMC boot partition while keeping /boot on the SSD - pros and cons of this decision will be addressed later. It should be possible to leave SW1 set to the default ON position and boot u-boot instead from an inserted SD card but I am yet to test this setup.

Further documentation concerning the Reform’s boot process is available on the MNT Gitlab in an issue maintained by josch.

Debian installer

I ran through the “standard” install process with the following exceptions:

josch has added two additional debconf questions to the install process:

Choose the initial device tree
This selects which device tree blob will be installed. I selected Normal (single) here.
Choose on which device to flash U-Boot
This is similar to the "GRUB install devices" question when installing on an x86 host. You should only get listed viable options for the platform where you're installing. I chose eMMC here, as per boot notes above. TODO We are aiming to tidy this up to better resemble the GRUB process.

Notably I left /boot on /dev/nvme0n1p1, which is the default behaviour of the installer but is not currently a supported configuration to boot from. This is probably the largest remaining sticking point.

How to solve /boot

There are several apparent options for handling /boot on Reform:

Having NVMe support in u-boot would be the ultimate goal, as this would allow additional desirable functionality such as boot menus, as well as making the system boot a lot more like a “normal laptop”.

In the meantime it’s possible to set up flash-kernel to manage the kernel image, initrd, DTB and boot.scr on /dev/mmcblk0p1 by adding a local machine definition to /etc/flash-kernel/db such as:

Machine: MNT Reform 2
Boot-Device: /dev/disk/by-path/platform-30b40000.mmc-part1
Boot-Kernel-Path: vmlinuz
Boot-Initrd-Path: initrd.img
Boot-Script-Path: boot.scr
Boot-DTB-Path: dtb

Note here I am using /dev/disk/by-path/platform-30b40000.mmc-part1 to avoid device numbering changes from inadvertently mounting any other MMC devices if they are present in the system. This is just an added robustness measure. The Boot-*-Path options are necessary to prevent flash-kernel from trying to create e.g. /boot/vmlinuz on the eMMC device. TODO Can we find a way to let this coexist with “/boot on eMMC” as a scenario too?

TODO This might be a another way to handle the HDMI / non-HDMI device tree selection too?

Once this configuration is in place running flash-kernel as root, or installing / upgrading the kernel etc will result in the newest kernel being dropped in to /dev/mmcblk0p1 for u-boot to find:

root@esper:~# flash-kernel
Using DTB: freescale/imx8mq-mnt-reform2.dtb
Installing /usr/lib/linux-image-6.6.13+bpo-reform2-arm64/freescale/imx8mq-mnt-reform2.dtb into /boot/dtbs/6.6.13+bpo-reform2-arm64/freescale/imx8mq-mnt-reform2.dtb
Taking backup of imx8mq-mnt-reform2.dtb.
Installing new imx8mq-mnt-reform2.dtb.
flash-kernel: installing version 6.6.13+bpo-reform2-arm64
Will use /dev/mmcblk0p1 as boot device.
Taking backup of vmlinuz.
Installing new vmlinuz.
Taking backup of initrd.img.
Installing new initrd.img.
Generating boot script u-boot image... done.
Taking backup of boot.scr.
Installing new boot.scr.
Taking backup of dtb.
Installing new dtb.

TODO Think about whether this could be set up to not clobber the factory shipped rescue image on the eMMC as well.

Other things to adjust

By default KDE will suspend the system after some inactivity. This is not very reliable on the Reform and you may corrupt your filesystem. You almost certainly want to disable suspend:

# mkdir -p /etc/systemd/sleep.conf.d
# cat > /etc/systemd/sleep.conf.d/reform-disable-suspend.conf <<"EOF"
[Sleep]
AllowSuspend=no
EOF
# systemctl daemon-reload

sddm currently can’t start after installing Debian with KDE. This seems to be because sddm wants to use X, and I don’t entirely understand what makes X work / not work on the Reform. I have had it working, but it doesn’t work on this install. TODO See if there’s a way to make sddm on Plasma 5 use Wayland and whether this could be fixed for the installer somehow.

Entries in sources.list came up using http:// URLs, when I’d usually prefer https://. This is a point of contention in various communities but I think “just use TLS for every TCP connectin” makes things easier for everyone as a general rule.