EZhel Posted December 17, 2017 Share 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. Link to comment Share on other sites More sharing options...
Igor Posted December 17, 2017 Share 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 Link to comment Share on other sites More sharing options...
EZhel Posted December 17, 2017 Author Share Posted December 17, 2017 16 minutes ago, Igor said: You should test and create a script on the live image but implement while building an image. 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? Link to comment Share on other sites More sharing options...
Igor Posted December 17, 2017 Share Posted December 17, 2017 9 minutes ago, EZhel said: Or should I unpack an .img or emulate it somehow? 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? Link to comment Share on other sites More sharing options...
EZhel Posted December 17, 2017 Author Share Posted December 17, 2017 4 minutes ago, Igor said: What your applications needs, is it different for each board, for each distro, architecture, is it kernel dependent? 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. 6 minutes ago, Igor said: pack to .deb and install only .deb package and dependencies if needed? Can I install my custom .deb into existing .img on the Zero? Link to comment Share on other sites More sharing options...
Igor Posted December 17, 2017 Share Posted December 17, 2017 Just now, EZhel said: Can I install my custom .deb into existing .img on the Zero? Ofc, during the build as written in the documentation or you can also mount this image, install deb under chroot and unmount the image. Link to comment Share on other sites More sharing options...
EZhel Posted December 17, 2017 Author Share Posted December 17, 2017 1 minute ago, Igor said: you can also mount this image, install deb under chroot and unmount the image That's what I was looking for, many thanks. Link to comment Share on other sites More sharing options...
EZhel Posted December 18, 2017 Author Share 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. Link to comment Share on other sites More sharing options...
Igor Posted December 18, 2017 Share Posted December 18, 2017 39 minutes ago, EZhel said: What toolchain is used for Orange Pi Zero and Armbian Jessie (legacy kernel)? Whatever is packed by default with Debian Jessie/Stretch or Xenial. 41 minutes ago, EZhel said: Is there any manual on setting up the environment for cross-compilation for Orange Pi Zero? Our build script set it up: https://github.com/armbian/build 43 minutes ago, EZhel said: Also, is it possible to compile C++ app on the Zero itself? (does Armbian have g++ in default build?) Yes. build-essential is installed by default. Link to comment Share on other sites More sharing options...
Recommended Posts