Jump to content

Porting to a new device/Changing your installation

From postmarketOS Wiki

Install packages over SSH

Get Internet access via USB (easier) or Wifi, then use the package manager to install new packages:

$ apk add hello-world

You can also host packages you have built yourself from your PC. Just make sure to increase the package version when you build your own version of a package that already exists. Otherwise the package manager can not know that your package is the newest one and should be installed. Check the output of apk to see whether it is really installing the package or not.

Building a new system image

Whenever you rebuild a package (or pick a new one to be installed by default in pmbootstrap init), you need to make sure that the package is actually installed in the chroot from which the system image gets generated. Achieve that by running pmbootstrap install again, it should update all outdated packages. Pay attention to the output of pmbootstrap log to see if it actually has been updated. If something did not work as expected, you can always pmbootstrap zap your chroots to start over with a clean installation.

Kernel

A simple way to recompile your kernel (e.g. because you want to change your kernel config) and flash it to your device is running the following commands:

$ pmbootstrap build --force linux-wiki-example
$ pmbootstrap install
$ pmbootstrap flasher flash_kernel

The last flash_kernel step is only needed if your device has the kernel stored on an extra boot partition. Android/fastboot compatible devices have such a partition, and Maemo/MeeGo Nokia devices (N900, etc.) typically don't use it. If your device does not have a boot partition, update your system partition or SD card.

After you've gotten more familiar with postmarketOS, you could try out the postmarketos-update-kernel as well. It allows you to flash a new kernel to the device's boot partition (not to be confused with postmarketOS' own boot subpartition systemp1).