Run pmbootstrap on non-x86_64 arches

From postmarketOS Wiki

While most people are running pmbootstrap on x86_64, it is also possible to run it on other architectures supported by postmarketOS. As of writing, some of the package/image building related tools are only built for x86_64 in the official binary packages repository (blocked by build.postmarketos.org#75). This article covers related errors, and how to work around them. If your problem is not listed here, ask in the chat or issues for help and consider adding the solution to your problem.

Building a PinePhone image on stable channel

The PinePhone depends on the crust package, which is being cross compiled from the native arch to the or1k-elf architecture. When trying to build an image for the PinePhone on the stable channel, pmbootstrap will currently display the following error:

$ pmbootstrap install --sdcard=...
...
[16:00:39] NOTE: You can edit the 'arch=' line inside the APKBUILD
[16:00:39] ERROR: Can't build 'binutils-or1k-elf' for architecture aarch64

If you are fine with running edge as well, simply switch to the edge channel in pmbootstrap init and try again. Only if you want to build for the stable channel, use the following workaround.

Enter the pmaports dir, then change arch="x86_64" to arch="all" in the following files:

temp/binutils-cross-embedded/APKBUILD
temp/gcc-cross-embedded-stage1/APKBUILD                       
temp/gcc-cross-embedded/APKBUILD
temp/newlib-stage1/APKBUILD

Make sure that you have answered Build outdated packages during 'pmbootstrap install'? in pmbootstrap init with yes (y). Then try the pmbootstrap install command again, and pmbootstrap will build the missing dependencies for your host architecture (it may take some time, on the PinePhone two hours or so). Then it will proceed with building the image.