ubuntu
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
ubuntu [2017/09/08 15:24] – [Tests performed] thibault.jacques | ubuntu [2018/05/22 10:33] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Getting started with Quimbuntu : Ubuntu on the Quimbrain ====== | ||
+ | |||
+ | 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/ | ||
+ | |||
+ | The tools used are : | ||
+ | |||
+ | * Bootloader: [[https:// | ||
+ | * Kernel : [[https:// | ||
+ | * Root filesystem : Ubuntu 16.04 obtained by the Deboostrap [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | ===== Summarize of the tool ===== | ||
+ | The system will be composed by : | ||
+ | |||
+ | * Part 1 : SPL, it serves to set-up the boot process | ||
+ | * Part 2 : u-boot.img, bootloader image | ||
+ | * Part 3 : rootfs, root filesystem | ||
+ | * /boot | ||
+ | * uEnv.txt, text file to modify environment variables of the bootloader | ||
+ | * imx6dl-hummingboard.dtb, | ||
+ | * zImage, Linux kernel image | ||
+ | * /lib | ||
+ | * /modules, kernel modules | ||
+ | * /firmware, firmware drivers | ||
+ | * ... | ||
+ | * ... | ||
+ | |||
+ | ===== Directory Hierarchy ===== | ||
+ | |||
+ | / | ||
+ | / | ||
+ | /src Scripts to build the image | ||
+ | |||
+ | Downloaded directories : | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | Created directory : | ||
+ | / | ||
+ | |||
+ | |||
+ | ====== How to build a image ====== | ||
+ | |||
+ | ===== Prerequisites ===== | ||
+ | |||
+ | 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 | ||
+ | | ||
+ | ===== Build ===== | ||
+ | |||
+ | In a wonderful world, you can create your image with a simple command after downloading the dependencies : | ||
+ | make | ||
+ | |||
+ | ==== Makefile target ==== | ||
+ | |||
+ | If you want to build/ | ||
+ | |||
+ | all Build an image from scratch | ||
+ | kernel | ||
+ | uboot Compile the bootloader u-boot with the Quimbrain configuration | ||
+ | rootfs | ||
+ | compress | ||
+ | genimage | ||
+ | distclean | ||
+ | clean Clean every files created during the build of the image and the downloaded directories | ||
+ | |||
+ | The target " | ||
+ | - uboot | ||
+ | - kernel | ||
+ | - rootfs | ||
+ | - compress | ||
+ | - genimage | ||
+ | |||
+ | /!\ Please follow the same order, if the target " | ||
+ | |||
+ | /!\ A known problem is that the system stops after the rootfs target, continue with the compress genimage target. | ||
+ | |||
+ | ===== Installing Ubuntu on the SD card ===== | ||
+ | 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 | ||
+ | |||
+ | ====== How to custom/ | ||
+ | This part will explain how to configure the different bloc of the build process. | ||
+ | |||
+ | ===== U-boot ===== | ||
+ | |||
+ | 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=/ | ||
+ | make mx6_cubox-i_config | ||
+ | make | ||
+ | |||
+ | A successful build will create two files in the source tree directory, SPL and u-boot.img | ||
+ | |||
+ | * SPL file is the actual machine detection and initialization and must be flashed on offset 1KByte of the boot micro SD. | ||
+ | * u-boot.img is the second stage bootloader; it can be flashed at offset 42KByte from the starting of the boot micro SD; or alternatively can be put as-is on the first partition of the micro SD. | ||
+ | |||
+ | ===== Kernel ===== | ||
+ | In this part, we build the zImage (the kernel image), the modules and the firmware drivers and the device tree blob imx6dl-quimbrain.dtb | ||
+ | |||
+ | === Modification of the kernel === | ||
+ | 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 / | ||
+ | |||
+ | Configure the cross-compilation : | ||
+ | export ARCH=arm | ||
+ | export CROSS_COMPILE=/ | ||
+ | Modification : | ||
+ | cd linux-fslc | ||
+ | make quimbrain_defconfig: | ||
+ | make menuconfig | ||
+ | Save the new configuration : | ||
+ | make savedefconfig | ||
+ | cp defconfig ../ | ||
+ | Compile by hand zImage and modules : | ||
+ | make zImage | ||
+ | make modules | ||
+ | mkdir -p rootfs | ||
+ | make modules_install INSTALL_MOD_PATH=rootfs | ||
+ | | ||
+ | === Modification of the device tree === | ||
+ | You can modify the device tree and compile it from the kernel directory. However, don't forget to copy the files to the / | ||
+ | |||
+ | Save the modification from the linux-fslc directory : | ||
+ | cp / | ||
+ | Compilation | ||
+ | make imx6dl-quimbrain.dtb | ||
+ | |||
+ | /!\ Don't forget to save every file that you change in the directory / | ||
+ | |||
+ | ===== Root filesystem | ||
+ | |||
+ | 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. | ||
+ | |||
+ | 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 " | ||
+ | |||
+ | 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 " | ||
+ | |||
+ | 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 | ||
+ | | ||
+ | |||
+ | * Add a new user and add it to groups: | ||
+ | login : quimesis | ||
+ | | ||
+ | | ||
+ | |||
+ | * Update the system and install the wanted packages | ||
+ | |||
+ | * Configure the firmware for the Bluetooth and the wifi | ||
+ | |||
+ | |||
+ | ====== Tests performed | ||
+ | To check the system, some simple tests carried out : | ||
+ | * Ethernet : plug ethernet cable and test the connexion | ||
+ | * Wifi : connexion to a wifi and create access point too | ||
+ | * [[private: | ||
+ | * Bus can : communication with the two CAN bus via external board and USB-to-CAN adapter | ||
+ | * USB port : plug in the 4 ports | ||
+ | * LED : control via gpio | ||
+ | * IMU : test with the RTIMULib library | ||
+ | * Bluetooth : detection by one other device and connexion with it | ||
+ | * HDMI output : plug HDMI and use it as output sound | ||
+ | * Jack in/ou : The input was no tested but the output works fine when you send sound to it | ||
+ | * Sensor temperature/ | ||
+ | * Multi-Purpose GPIO : control with gpio and check with voltmeter | ||
+ | * Power to ext. : power on and check if the 24V are present. | ||
+ | * UART : connexion between computer and Quimbrain | ||
+ | ====== Comments ====== | ||
+ | |||
+ | * Different problems are present and they are discussed in the README | ||
+ | * To use the IMU if you use the [[https:// | ||
+ | |||
+ | ====== Interesting links ====== | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||