The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


A developer tool to build a Moode image
#1
Hi all,
I want to share with you the tool I'm developing to accelerate the build of a moode image in order to speedup tests when a change in the build is included.
Here you can download the tool.
https://github.com/badbat75/rpi_moode_build
This is under development even if I released a version 1.0 dedicated to build a stable r4.0.
It is divided in 2 scripts.
  • The first buildmoode.sh dedicated to create the empty image and mount everything in a chroot environment. It will also inject the second script that is the core of the build phase, derivated from the official recipe.
    I created this script in order to have full control in the developer toolchain I want to use to build the image, for this reason it is possible choose
    - the raspbian image version
    - the moode version (I don't know if it is really possible specify an different version from the tested one)
    - specify the compiler flags (-O3 in gcc and g++)
    - parallelize the build passing the -j [number of cores] to the Makefiles
    - decide to cache the building phase objects in order to speedup the following builds (ccache)
    - if you want the squashfs enabled or not
    - mount the image and use the shell to run commands as if you were in a moode environment
    - zip the image
    Before launching the build process it injects the second script in the /home/pi of the target image and insert on top a list of environment variable and runs it in the chrooted environment.
  • The second runinchroot.sh is a bash script transposition of the official recipe.
So if you need to change something in the moode build you need to change the runinchroot.sh if you want to change something in the toolchain you have to change the parameters when you launch the script.
In the github repository you can see the README.md to config your build.
From the second build you can speed up the process to 4 times, on a RPi3 I got the entire build in 5 minutes. (depends on the updates)
At the end of the build you can find the logs of the two scripts in different files, to debug what happened during the build.

For example:
Code:
ZIP_FORMAT=XZ ./buildmoode.sh runinchroot.sh
You choose to use XZ to zip the image.

Code:
ENABLE_CCACHE=0 ENABLE_SQUASHFS=0 ./buildmoode.sh runinchroot.sh
You disable to cache the build, disable the squashfs filesystem.

Code:
DEV_MODE=1 ./buildmoode.sh
It reuse the current raspbian image and launch a bash in the chrooted environment. From here you can build manually what you want.
Reply


Messages In This Thread
A developer tool to build a Moode image - by badbat75 - 04-24-2018, 08:22 PM

Forum Jump: