Build custom source code in customize-image.sh


Recommended Posts

Hello guys,

is it possible to build custom source code in customize-image.sh ?

Seems like /tmp/overlay is read-only, can I use another location to git clone my source code, make and install in target file system ?

My idea is to build & deploy sources using native gcc compiler.

 

Thanks

Link to post
Share on other sites
Armbian is a community driven open source project. Do you like to contribute your code?

19 hours ago, ssuloev said:

Seems like /tmp/overlay is read-only, can I use another location to git clone my source code, make and install in target file system ?

You can use any directory, i.e. you can create a new directory under /tmp and remove it afterwards.

/tmp/overlay is currently mounted as read-only, but I may revert it to rw later if it won't cause any problems.

Link to post
Share on other sites

Hello again,

I tried like you said but it didn't work.

My custom directory that I created in userpatches is not visible in /tmp during build, there are only customize-image and overlay folder visible.

I can use customize-image-host.sh to mount my own dir without readonly bu there is no way to unmount it without changing compilation.sh. Not sure if is critical to unmount it.

Any suggestions ?

Thanks

Link to post
Share on other sites
1 hour ago, ssuloev said:

My custom directory that I created in userpatches is not visible in /tmp during build, there are only customize-image and overlay folder visible.

I meant that contents of userpatches/overlay will be visible in /tmp/overay inside, there are no other (easy) ways to transfer files between the host and chroot environment. You can create a temp directory from customize-image.sh to use for cross-compilation or building if you need to.

 

1 hour ago, ssuloev said:

Any suggestions ?

What do you want to do exactly? Transfer files from chroot to host?

Link to post
Share on other sites
14 minutes ago, ssuloev said:

Ok, so I can create a folder like /tmp/build, git clone there, build and install, right ?  All this can be done from customize-image.sh ?

Yes, assuming there is enough RAM to do this (since temporary rootfs lives in tmpfs by default), if you encounter "out of space" errors you may need to use FORCE_USE_RAMDISK=no parameter.

Link to post
Share on other sites

I tried to compile QT5 from customize-image.sh using target gcc but it is way too slow than normal cross-compile using linaro toolchain... 

And so I am going to stick with linaro cross-compile.

Can you give me an advice about the following scenario.

I want to cross-compile QT5 from customize-image-host.sh script, i.e. git clone and make (with linaro toolchain) in userpatches directory, then copy binaries to userpatches/overlay and install to target fs from customize-image.sh script.

So far so good but I in order to build QT5 I need a device SYSROOT (/usr/lib, /usr/include, etc) which is not prepared yet when customize-image-host.sh is executed. 

SYSROOT is prepared with customize-image.sh and it does not contain all required libs & headers when customize-image-host.sh is executed.

 

 

 

Link to post
Share on other sites
17 hours ago, ssuloev said:

So far so good but I in order to build QT5 I need a device SYSROOT (/usr/lib, /usr/include, etc) which is not prepared yet when customize-image-host.sh is executed. 

customize-image-host.sh is called almost right before the customize-image.sh. If you are using customize-image-host.sh you may as well do everything in it, use $SDCARD variable to get a path to the rootfs and use chroot $SDCARD to execute anything in chroot

Link to post
Share on other sites
Guest
This topic is now closed to further replies.