How to factory reset

At this point I just want to know how to get the system back to a “factory state” so I can hand it off to someone who wants to buy it.

EDIT: I tried running sudo reform-flash-rescue while running from an SD to get there, but the device still won’t boot from anything other than an SD card.

Also for some reason booting from the exact same SD card only works sometimes now. I have no idea why of course

So, now I can’t even reset the device to any working state really. This just keeps getting worse and worse somehow. I really don’t know what to do anymore. Do I have a 1700€ paperweight now?

Hi, I moved this post to a new thread because the old one is already overloaded with content and this is now about how to restore the Pocket Reform into its factory state.

Can you copypaste the output of reform-flash-rescue? You are booting an SD card with the MNT system image on it, yes? You need the very latest system-image. This should be the right link:

You said in the other thread that you have barebox on sd-card. This only works if you had emmc zeroed before. Maybe when you ran reform-flash-rescue you selected “no” when it asked whether it should flash the bootloader to emmc?

I’m sorry. This is of course my fault as well.

Trying to flash the latest official image to an SD card on my PC (running Debian 13):

(following the instructions in README.flashing)

sudo bmaptool copy "https://source.mnt.re/reform/reform-system-image/-/jobs/23695/artifacts/file/pocket-reform-system-rk3588.img.gz" /dev/sda
pigz: skipping: <stdin> unrecognized format
bmaptool: info: discovered bmap file 'https://source.mnt.re/reform/reform-system-image/-/jobs/23695/artifacts/file/pocket-reform-system-rk3588.img.gz.bmap'
bmaptool: WARNING: failed to open the URL with 10 sec timeout, is the proxy configured correctly? Keep trying ...
bmaptool: WARNING: failed to open the URL with 10 sec timeout, is the proxy configured correctly? Keep trying ...
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/bmaptool/BmapCopy.py", line 400, in _parse_bmap
    self._xml = ElementTree.parse(self._f_bmap)
                ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/xml/etree/ElementTree.py", line 1204, in parse
    tree.parse(source, parser)
    ~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/xml/etree/ElementTree.py", line 569, in parse
    self._root = parser._parse_whole(source)
                 ~~~~~~~~~~~~~~~~~~~^^^^^^^^
xml.etree.ElementTree.ParseError: mismatched tag: line 155, column 2

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/bmaptool", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/usr/lib/python3/dist-packages/bmaptool/CLI.py", line 947, in main
    args.func(args)
    ~~~~~~~~~^^^^^^
  File "/usr/lib/python3/dist-packages/bmaptool/CLI.py", line 634, in copy_command
    writer = BmapCopy.BmapBdevCopy(image_obj, dest_obj, bmap_obj, image_size)
  File "/usr/lib/python3/dist-packages/bmaptool/BmapCopy.py", line 810, in __init__
    BmapCopy.__init__(self, image, dest, bmap, image_size)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/bmaptool/BmapCopy.py", line 286, in __init__
    self._parse_bmap()
    ~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/bmaptool/BmapCopy.py", line 405, in _parse_bmap
    for num, line in enumerate(self._f_bmap):
                     ~~~~~~~~~^^^^^^^^^^^^^^
TypeError: 'NamedFile' object is not iterable

Seems like the bmap file is broken. I’ll try to flash it with dd. But it’s yet another thing that randomly breaks.

I don’t know where else to put this, but I was trying to update packages on the latest system image and it segfaulted and froze on apt list --upgradable.

I’ll just try to run reform-flash-rescue from the image as-is without updates.

here is the output of reform-flash-rescue:

esther@pocket:~$ sudo reform-flash-rescue 
[sudo] password for esther: 
Downloading sysimage-v5 needs a working internet connection and either wget or curl installed.

WARNING: This overwrites partitions on eMMC, deleting all data.
Are you sure you want to proceed? [y/N] y
Downloading https://source.mnt.re/reform/reform-system-image/-/jobs/artifacts/main/raw/pocket-reform-system-rk3588.img.gz?job=build...
bmaptool: info: discovered bmap file 'https://source.mnt.re/reform/reform-system-image/-/jobs/artifacts/main/raw/pocket-reform-system-rk3588.img.gz.bmap?job=build'
bmaptool: WARNING: failed to open the URL with 10 sec timeout, is the proxy configured correctly? Keep trying ...
bmaptool: WARNING: failed to open the URL with 10 sec timeout, is the proxy configured correctly? Keep trying ...
bmaptool: info: block map format version 2.0
bmaptool: info: 2750465 blocks of size 4096 (10.5 GiB), mapped 1741294 blocks (6.6 GiB or 63.3%)
bmaptool: info: copying image 'pocket-reform-system-rk3588.img.gz' to block device '/dev/mmcblk0' using bmap file 'pocket-reform-system-rk3588.img.gz.bmap'
bmaptool: info: 100% copied
bmaptool: info: synchronizing '/dev/mmcblk0'
bmaptool: info: copying time: 5m 1.9s, copying speed 22.5 MiB/sec
e2fsck 1.47.4 (6-Mar-2025)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information

reformsdroot: ***** FILE SYSTEM WAS MODIFIED *****
reformsdroot: 263765/655360 files (0.2% non-contiguous), 1768131/2621440 blocks
resize2fs 1.47.4 (6-Mar-2025)
Resizing the filesystem on /dev/mmcblk0p2 to 60942336 (4k) blocks.
The filesystem on /dev/mmcblk0p2 is now 60942336 (4k) blocks long.

e2fsck 1.47.4 (6-Mar-2025)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
reformsdroot: 263765/15237120 files (0.2% non-contiguous), 2689213/60942336 blocks
tune2fs 1.47.4 (6-Mar-2025)
tune2fs 1.47.4 (6-Mar-2025)
I: Using partition on eMMC for /boot: /dev/mmcblk0p1.
This script selects your preferred boot medium. It writes your choice to the file /etc/fstab

commenting original /etc/fstab contents
update-initramfs: Generating /boot/initrd.img-7.1.7-mnt-reform-arm64
I: skipping reform_set_root in favour of flash_kernel_set_root
Using DTB: rockchip/rk3588-mnt-pocket-reform.dtb
Installing /usr/lib/linux-image-7.1.7-mnt-reform-arm64/rockchip/rk3588-mnt-pocket-reform.dtb into /boot/dtbs/7.1.7-mnt-reform-arm64/rockchip/rk3588-mnt-pocket-reform.dtb
Taking backup of rk3588-mnt-pocket-reform.dtb.
Installing new rk3588-mnt-pocket-reform.dtb.
flash-kernel: installing version 7.1.7-mnt-reform-arm64
Generating boot script u-boot image... done.
Taking backup of boot.scr.
Installing new boot.scr.
Your /boot partition is on emmc (/dev/mmcblk0p1).
I: The bootloader will prefer the first partition on SD-card over the first partition on eMMC
I: Your current system has its /boot mounted from SD-card.
I: You requested to configure a new /boot on eMMC
I: Instead of just rebooting, power off the system.
I: Then remove the SD-card.
I: Lastly, power the system on again.
I: Power off your MNT Pocket Reform by running 'systemctl poweroff'.

Powering down, removing the SD card, and powering up again:

I end up in the setup assistant so it seems like this worked, except that issue with bmaptool earlier.

Just for completeness in case anyone else comes here, the correct URL for use with bmaptool is https://source.mnt.re/reform/reform-system-image/-/jobs/23695/artifacts/raw/pocket-reform-system-rk3588.img.gz

Because I dreaded that gitlab makes me perform an extra click just to get to the download URL I also added the sudo bmaptool copy invocations for each image with the correct URL to the end of the job log.

I also updated README.flashing with additional help text. Maybe this will prevent confusion in the future.