hanni76 Posted August 14, 2017 Share Posted August 14, 2017 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 comment Share on other sites More sharing options...
zador.blood.stained Posted August 15, 2017 Share Posted August 15, 2017 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 comment Share on other sites More sharing options...
hanni76 Posted August 15, 2017 Author Share Posted August 15, 2017 thx! Link to comment Share on other sites More sharing options...
hanni76 Posted August 17, 2017 Author Share Posted August 17, 2017 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 comment Share on other sites More sharing options...
zador.blood.stained Posted August 17, 2017 Share Posted August 17, 2017 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 comment Share on other sites More sharing options...
hanni76 Posted August 17, 2017 Author Share Posted August 17, 2017 I want to build QT5 in chroot and then install it to /usr/local. 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 ? Link to comment Share on other sites More sharing options...
zador.blood.stained Posted August 17, 2017 Share Posted August 17, 2017 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 comment Share on other sites More sharing options...
hanni76 Posted August 17, 2017 Author Share Posted August 17, 2017 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 comment Share on other sites More sharing options...
zador.blood.stained Posted August 18, 2017 Share Posted August 18, 2017 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 comment Share on other sites More sharing options...
hanni76 Posted August 18, 2017 Author Share Posted August 18, 2017 Seems yes I can... Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts