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.
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:
You choose to use XZ to zip the image.
You disable to cache the build, disable the squashfs filesystem.
It reuse the current raspbian image and launch a bash in the chrooted environment. From here you can build manually what you want.
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.
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
Code:
ENABLE_CCACHE=0 ENABLE_SQUASHFS=0 ./buildmoode.sh runinchroot.sh
Code:
DEV_MODE=1 ./buildmoode.sh