Jump to content

USB booting

From postmarketOS Wiki

Similar to SD card installation, pmOS can be also installed on USB drives.

Prerequisites

  • Device with OTG support, and extcon is included in initramfs.
  • the PMIC supports the power to OTG devices, and included in initramfs.
    • Otherwise, a hub with external power supply is required.
    • USB HDD also requires external power supply.
  • module usb-storage is enabled in initramfs.
  • Rootfs image, created by either:
  • USB flash drive or HDD

Pre-built images

  1. dd if=/path/to/<vendor>-<codename>.img \
       of=/dev/<usb_drive> \
       bs=4M status=progress
    
  2. Use fastboot or heimdall
    • fastboot:
      fastboot flash boot /path/to/<vendor>-<codename>-boot.img
      
    • heimdall:
      heimdall flash --BOOT /path/to/<vendor>-<codename>-boot.img
      


pmbootstrap

  1. pmbootstrap install --disk=/dev/<usb_drive>
    • When using legacy option --sdcard, postmarketOS/pmbootstrap@942ee207 is required to ignore sdcard check.
    • Alternatively you can also run pmbootstrap install and use dd:
      pmbootstrap install
      dd if=~/.local/var/pmbootstrap/chroot_native/home/pmos/rootfs/<vendor>-<codename>.img \
         of=/dev/<usb_drive> \
         bs=4M status=progress
      
  2. pmbootstrap flasher flash_kernel
  3. Insert the USB drive to OTG and boot