PINE64
PinePhone Build Environment - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120)
+--- Forum: General Discussion on PinePhone (https://forum.pine64.org/forumdisplay.php?fid=127)
+--- Thread: PinePhone Build Environment (/showthread.php?tid=8869)



PinePhone Build Environment - grondinm - 01-21-2020

I am interested in setting up a build environment for pinephone. I plan on using Manjaro/Arch. I'm thinking it would be nice to be able to build packages either from AUR or just source on a faster CPU.

I'm not sure the best way to set this up. I was thinking qemu but i have had no luck getting qemu-system-aarch64 to boot anything. Obviously i'm doing something wrong. What's a good guide on running say Arch arm using qemu?

I've tried just issuing this command

sudo qemu-system-aarch64 -machine virt -machine type=virt -m 2048 -cpu cortex-a57 Manjaro-ARM-plasma-mobile-pinephone-alpha2.img

is there another machine/type/cpu i should specify. All i get is a black screen with a qemu prompt. Maybe i need to specify other devices? Maybe i need to extract the image somehow and specify the kernel separately?

The other thing i thought of was using a chroot but that would not work since the host and target do not share the same architecture correct?

any help/kick in the right direction would be appreciated.


RE: PinePhone Build Environment - MartijnBraam - 01-21-2020

You can't emulate a PinePhone completely with qemu, so the released PinePhone images won't run. If you want to build aarch64 packages in qemu for Arch/Manjaro you should probably run a standard Alarm image in qemu.


RE: PinePhone Build Environment - grondinm - 01-25-2020

So here is what I came up with.

https://blog.marcg.pizza/pinephone-arm-build-environment-setup


RE: PinePhone Build Environment - MartijnBraam - 01-28-2020

If you want to have an aarch64 build environment that's a generic phone and not the pinephone specifically you can use the qemu stuff in postmarketOS.

Code:
pmbootstrap init # Select the "qemu" manufacturer and then the "aarch64" device, further options are the UI's you want
pmbootstrap install --add vim,nano,emacs # Generate a rootfs and install packages you want
pmbootstrap qemu # Start a qemu VM with the generated rootfs



RE: PinePhone Build Environment - sagaracharya - 09-30-2020

Any updates on this front? Can one develop an app for PinePhone without owning one?


RE: PinePhone Build Environment - wibble - 09-30-2020

It depends on what you're trying to do - most of the software running on the PinePhone is generic linux software that was never aimed at the PinePhone. If you're doing something generic than you should be able to develop much as you would any other linux app so long as you take care about how it'll fit on the screen. The VM stuff and the environment set up by pmbootstrap should help. If you're doing something that interacts with the hardware then you'll need an actual PinePhone for testing since so far as I know there isn't a VM that emulates all the hardware interfaces. For hardware that's abstracted (modem behind ModemManager or oFono for example) you may be able to get away with not having the hardware.