EZhel Posted December 17, 2017 Posted December 17, 2017 Hello, I've got an Orange Pi Zero (Allwinner H2+) and an .img 4GB with OS for it and some custom software in the image. I have source code of this custom software and need to compile its modified version and build/change the .img with my changes, and load it all into the Zero. 7zip opens the .img, I can see that it has Armbian Jessie with legacy kernel. QEmu on Ubuntu coudn't mount the .img, is it possible to emulate the image, or should I modify my software on the device itself? How it could be done? I need some help with development for Zero and an existing .img. Thanks in advance.
Igor Posted December 17, 2017 Posted December 17, 2017 You should test and create a script on the live image but implement while building an image. https://docs.armbian.com/Developer-Guide_User-Configurations/ https://www.openmediavault.org/ is using this procedure for their ARM-based builds: https://github.com/armbian/build/blob/master/config/templates/customize-image.sh.template
EZhel Posted December 17, 2017 Author Posted December 17, 2017 On 12/17/2017 at 1:31 PM, Igor said: You should test and create a script on the live image but implement while building an image. Expand Thanks, how can it be done? Should I boot Zero with existing image and change script via ssh console and nano/vi? I mainly need to compile my program with environment of an existing Armbian .img, I guess it already has some custom settings that I won't get if I just compile my own image from your github repo for Jessie/Legacy kernel. Is it possible to build an executable and install it (somehow) to an existing .img? Or should I unpack an .img or emulate it somehow? That's a lot of questions, but I'm kinda lost. I have an .img which is custom, source of an app and need to update the .img with my app, changed and compiled for Zero. Is it possible?
Igor Posted December 17, 2017 Posted December 17, 2017 On 12/17/2017 at 1:52 PM, EZhel said: Or should I unpack an .img or emulate it somehow? Expand Why don't you (cross)compile somewhere, pack to .deb and install only .deb package and dependencies if needed? What your applications needs, is it different for each board, for each distro, architecture, is it kernel dependent?
EZhel Posted December 17, 2017 Author Posted December 17, 2017 On 12/17/2017 at 2:02 PM, Igor said: What your applications needs, is it different for each board, for each distro, architecture, is it kernel dependent? Expand My app is only for Zero, one board, and only one OS build, Armbian Jessie with Legacy kernel. To cross-compile it for ARM, I need an environment - versions of system libraries that are used in Armbian Jessie, how it can be done? App is written in C++. Thanks for all the help. On 12/17/2017 at 2:02 PM, Igor said: pack to .deb and install only .deb package and dependencies if needed? Expand Can I install my custom .deb into existing .img on the Zero?
Igor Posted December 17, 2017 Posted December 17, 2017 On 12/17/2017 at 2:09 PM, EZhel said: Can I install my custom .deb into existing .img on the Zero? Expand Ofc, during the build as written in the documentation or you can also mount this image, install deb under chroot and unmount the image.
EZhel Posted December 17, 2017 Author Posted December 17, 2017 On 12/17/2017 at 2:13 PM, Igor said: you can also mount this image, install deb under chroot and unmount the image Expand That's what I was looking for, many thanks.
EZhel Posted December 18, 2017 Author Posted December 18, 2017 What toolchain is used for Orange Pi Zero and Armbian Jessie (legacy kernel)? gcc-linaro-4.9.4 gcc-linaro-5.5.0 gcc-linaro-6.4.1 gcc-linaro-7.2.1 gcc-linaro-arm-linux-glueabihf-4.8 Is there any manual on setting up the environment for cross-compilation for Orange Pi Zero? Also, is it possible to compile C++ app on the Zero itself? (does Armbian have g++ in default build?) Thanks in advance.
Igor Posted December 18, 2017 Posted December 18, 2017 On 12/18/2017 at 1:13 PM, EZhel said: What toolchain is used for Orange Pi Zero and Armbian Jessie (legacy kernel)? Expand Whatever is packed by default with Debian Jessie/Stretch or Xenial. On 12/18/2017 at 1:13 PM, EZhel said: Is there any manual on setting up the environment for cross-compilation for Orange Pi Zero? Expand Our build script set it up: https://github.com/armbian/build On 12/18/2017 at 1:13 PM, EZhel said: Also, is it possible to compile C++ app on the Zero itself? (does Armbian have g++ in default build?) Expand Yes. build-essential is installed by default.
Recommended Posts