This tool is an easy tool to create an image of Ubuntu for the Quimbrain. The purpose is to automate the process of the build of the image. You can find it in the Quimesis git repository: quimbox-tools/quimbuntu
The tools used are :
The system will be composed by :
/board Board specific files /quimbrain Configuration files specific to the Quimbrain /src Scripts to build the image
Downloaded directories :
/linux-fslc Linux kernel /u-boot-imx6 Bootloader /genimage Image builder
Created directory :
/rootfs Root filesystem created
The dependencies for the tool can be download thanks to the package manager apt :
sudo apt-get install gcc-arm-linux-gnueabihf-gcc bc lzop qemu-user-static debootstrap dh-autoreconf
In a wonderful world, you can create your image with a simple command after downloading the dependencies :
If you want to build/compile a specific part of the process, you can use the different targets of the Makefile
all Build an image from scratch kernel Compile the kernel with the Quimbrain configuration uboot Compile the bootloader u-boot with the Quimbrain configuration rootfs Create the root filesystem compress Compress the root filesystem in a tar.gz genimage Generate the image from the uboot.img, SPL and the root filesystem tar.gz distclean Clean every files created during the build of the image but keep the downloaded directories clean Clean every files created during the build of the image and the downloaded directories
The target “all” execute the different targets as follow :
/!\ Please follow the same order, if the target “all” launch an error or you built a specific part and you want to recreate the image without executing the full process.
/!\ A known problem is that the system stops after the rootfs target, continue with the compress genimage target.
Use a program to write the image on the SD card or the command :
dd bs=4M if=quimbrain.img of=/dev/sdX conv=fsync
This part will explain how to configure the different bloc of the build process.
The configuration to build the bootloader is the default configuration mx6_cubox-i_config. If you want to modify the environment variable of the bootloader, you can modify the file uEnv.txt to add new entries.
To recompile by hand, you can execute :
cd u-boot-imx6 export ARCH=arm export CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- make mx6_cubox-i_config make
A successful build will create two files in the source tree directory, SPL and u-boot.img
In this part, we build the zImage (the kernel image), the modules and the firmware drivers and the device tree blob imx6dl-quimbrain.dtb
The kernel configuration is a modified version of the configuration imx_v7_cbi_hb_defconfig from Solidrun. If you want to modify the kernel, you must modify the configuration file /board/quimbrain/quimbrain_defconfig. A good way to modify the configuration is to modify the file from the kernel directory linux-fscl with the make menuconfig command and to copy the new version in the directory board/quimbrain
Configure the cross-compilation :
export ARCH=arm export CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf-
cd linux-fslc make quimbrain_defconfig: make menuconfig
Save the new configuration :
make savedefconfig cp defconfig ../board/quimbrain/quimbrain_defconfig
Compile by hand zImage and modules :
make zImage make modules mkdir -p rootfs make modules_install INSTALL_MOD_PATH=rootfs
You can modify the device tree and compile it from the kernel directory. However, don't forget to copy the files to the /board/quimbrain directory.
Save the modification from the linux-fslc directory : cp /arch/arm/boot/dts/imx6dl-quimbrain.dts /arch/arm/boot/dts/imx6qdl-quimbrain.dtsi ../board/quimbrain Compilation
/!\ Don't forget to save every file that you change in the directory /board/quimesis because every file will be overwritten by the files in this directory
The root filesystem is created thanks to the tool Deboostrap. This tool downloads a simple root filesystem. To modify this system, you must create an isolated environment with chroot.
A chroot on Unix operating systems is an operation which changes the root directory. It affects only the current process and its children. The term “chroot” itself can refer either to the chroot(2) system call or the chroot(8) wrapper program.
A program that is re-rooted to another directory cannot access files outside that directory. This provides a convenient way to sandbox an untrusted, untested or otherwise dangerous program. It is also a simple kind of “jail” mechanism.
After that, we can modify this system without problem with our system. To customize the system, the script custom_system.sh is executed in the isolated environment.
Currently, this script does :
* Add the repository Ubuntu to the sources of package manager
* Modify the root user :
login : root password : admin
* Add a new user and add it to groups:
login : quimesis password : password groups : audio,sudo
* Update the system and install the wanted packages
* Configure the firmware for the Bluetooth and the wifi
To check the system, some simple tests carried out :