Howto: Upgrade an existing MNT Reform system on encrypted NVMe for RK3588

This guide assumes you just upgraded your MNT Reform’s Processor Module to the RCORE RK3588, and your previous OS and data reside on an encrypted NVMe SSD which you’d like to continue using.

Flash the latest RK3588 system image to an SD card

First, get the link to the system image .gz file:

In a terminal, use bmaptool to copy the image to your SD card directly from the web:

sudo bmaptool copy https://source.mnt.re/reform/reform-system-image/-/jobs/6202/artifacts/raw/reform-system-rk3588.img.gz /dev/sdX

(If you don’t have bmaptool installed, you can do so using: apt install bmaptool on a Debian-based system).

In the command above, replace the link after “copy” with the one you copied from the browser. this will make sure you have the most up-to-date build job number (version). Also, replace /dev/sdX with the device name of your SD card (you can figure that out using lsblk).

Boot from SD card

Insert the freshly imaged SD card into your MNT Reform and turn it on. After a while, you should see text output on the screen and a progress bar during the resizing of the disk. Then, it will start the setup wizard.

Create a temporary account with the setup wizard (complete it).

Mount and upgrade your old system

Once logged in, unmount /boot and mount the NVMe on /mnt and chroot into your old system:

sudo umount /boot
sudo cryptsetup open /dev/nvme0n1 crypt
sudo mount /dev/mapper/crypt /mnt
sudo chroot /mnt
# from this point, you're in your old system
mount -t proc proc /proc
mount -t sysfs sysfs /sysfs
mount -t devtmpfs devtmpfs /dev

We now need to make sure that the /boot mountpoint in /etc/fstab in your old system points to the boot partition on the SD card, which might have a different device name on the RK3588 than on your previous system:

nano /etc/fstab

Comment out any existing line containing /boot and create the following new line (the order of lines doesn’t matter):

/dev/mmcblk1p1 /boot auto errors=remount-ro 0 1

Then save and exit by pressing Ctrl+O followed by Ctrl+X.

Now you can mount /boot in the chroot:

mount /boot

You’ll now want to upgrade the kernel package in your old system, which will also regenerate the initramfs on the sd card. for that, you need to make sure that DNS works in your chroot. an easy fix:

echo "nameserver 8.8.8.8" > /etc/resolv.conf

Then install the latest kernel and firmware for the RK3588’s Mali GPU:

apt update
apt install linux-image-mnt-reform-arm64 firmware-misc-nonfree
update-initramfs -u

Once the process is done, exit the chroot and reboot:

exit
systemctl reboot

If the process was successful, after a while the system should come back up and ask you to enter the NVMe SSD decryption password.

For now, you’ll have to leave the SD card inserted to boot, because the bootloader and /boot partition reside on the SD card while your main system is on the NVMe SSD. This makes recovery from any issues easier. In the next version of this guide, we’ll show you how to move the bootloader and boot partition to the eMMC flash of your Processor Module.

8 Likes

Should (I think) be:

sudo cryptsetup luksOpen /dev/nvme0n1 reform_crypt
sudo mount /dev/mapper/reformvg-root /mnt

Also…

Should be

mount -t sysfs sysfs /sys

Adding the nameserver doesn’t work because on a standard install /etc/resolv.conf is actually a symlink (in our chroot it is broken) to ../run/resolvconf/resolv.conf so for our chroot you want to do

mkdir /run/resolvconf
echo "nameserver 8.8.8.8"  > /run/resolvconf/resolv.conf

Currently having some issues with the linux image install and initramfs not being able to run on the platform, will update here once I’ve got it fixed.

1 Like

Turns out my issue was a missing device tree causing flash-kernel to fail on the kernel install. This manifested as Unsupported platform 'MNT Pocket Reform with RCORE RK3588 Module'. and the resolution (for me at least) was apt reinstall flash-kernel to fix what I assume was a missing device tree in the database. Not entirely sure how it managed to be missing!

3 Likes

During the setup wizard, make sure that you specify the same hostname as the system you are upgrading.