Jump to content

Porting to a new device/Flashing

From postmarketOS Wiki

Before you can run any flash command, you must put your device in the flashing/bootloader mode. It is usually done holding Volume Down & Power simultaneously when the device is switched off but it may vary depending on the device. For more information see the specific page for your device in the LineageOS Wiki.

If you want to install to the system partition, run the following (not for the SD card installation!):

$ pmbootstrap flasher flash_rootfs

In case your system partition is too small for the generated image (e.g. because you chose Plasma Mobile as UI), it is possible to flash to another partition as well. Just be sure to erase any previous installations of postmarketOS in other partitions, because the init script will start with the first one that it encounters. (To delete a previous version either use dd or simply install the known working OS, e.g. Android, on it). Using multiple partitions with LVM is planned (#60).

$ pmbootstrap flasher flash_rootfs --partition userdata

If you have a device that works with fastboot, you can boot the kernel now without flashing it:

$ pmbootstrap flasher boot

Some devices may not support this, or ignore the provided kernel. In that case, you will need to flash the kernel to the device boot partition:

$ pmbootstrap flasher flash_kernel

Alternatives to regular flashing

If the flashing method does not work, it is also possible to export all generated image files to a specific directory (with symlinks), so you can flash it manually with your host Linux system (or even on Windows with proprietary flashers such as Odin, if this is the only way it works for you):

$ pmbootstrap export
$ pmbootstrap export --odin

For Android based devices, you can do a recovery zip installation.

When all else fails, you might have success with installing via netcat or booting via NFS.

See also