# Identify the system image for your Reform

You can find out the name of the system image for your platform by running the
following command:

    sh -c '. /usr/share/reform-tools/machines/"$(cat /proc/device-tree/model).conf"; echo "$SYSIMAGE.img.gz"'

To find out the correct system image manually, consider this table:

 | Machine                               | System image filename              |
 |---------------------------------------|------------------------------------|
 | MNT Pocket Reform with BPI-CM4 Module | pocket-reform-system-a311d.img.gz  |
 | MNT Pocket Reform with i.MX8MP Module | pocket-reform-system-imx8mp.img.gz |
 | MNT Reform 2 with BPI-CM4 Module      | reform-system-a311d.img.gz         |
 | MNT Reform 2 with i.MX8MP Module      | reform-system-imx8mp.img.gz        |
 | MNT Reform 2 (HDMI)                   | reform-system-imx8mq.img.gz        |
 | MNT Reform 2 with LS1028A Module      | reform-system-ls1028a.img.gz       |
 | MNT Reform 2 with RCORE RK3588 Module | reform-system-rk3588.img.gz        |

# Flashing the system image using bmaptool

If the utility called `bmaptool` is available on your system (found in package
`bmaptool` in Debian), then you can run this command to flash the image to your
SD-Card:

    sudo bmaptool copy URL /dev/mmcblkX

Replace `URL` by the https link to the image and `/dev/mmcblkX` by the device
name of your SD-Card. The `bmaptool` utility will prevent you from flashing to
a device which has mounted partitions on it as a safety measure.

# Flashing the system image using dd

Follow these steps:

 1. download the appropriate `*.img.gz` disk image from the pipeline artifacts
 2. decompress the image using `gunzip disk.img.gz` replacing `disk.img.gz` with the name of your system image
 3. identify the device name of your SD-Card, for example by running `lsblk` before and after inserting one
 4. copy the image to the SD-Card using this command and replacing `disk.img` with the image name and `/dev/sdx` with the device name:

    sudo dd if=disk.img of=/dev/sdx bs=8M status=progress
