
Conference Building embedded Debian / Ubuntu systems with ELBE Köry Maincent [email protected] © Copyright 2004-2020, Bootlin. embedded Linux and kernel engineering Creative Commons BY-SA 3.0 license. Corrections, suggestions, contributions and translations are welcome! - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 1/1 Köry Maincent I Embedded Linux engineer at Bootlin I Embedded Linux, Linux kernel, Yocto, Buildroot expertise I Development, consulting and training I Strong open-source focus I Open-source contributor I Contributed Ubuntu support to ELBE I Used ELBE to build Ubuntu systems for an ARM32 i.MX6 platform and an ARM64 Rockchip RK3399 platform I Living in Toulouse, France - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 2/1 Agenda I System integration: available options I Overview of ELBE I Building simple Debian/Ubuntu images with ELBE I Customizing the images contents - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 3/1 System integration: several possibilities Pros Cons Building everything manually Full flexibility Dependency hell Learning experience Need to understand a lot of details Version compatibility Lack of reproducibility Binary distribution Easy to create and extend Hard to customize Debian, Ubuntu, Fedora, etc. Large set of existing packages Hard to optimize (boot time, size) Well-known tools for non-embedded ex- Hard to rebuild the full system from source perts Large system Robust and regular security updates Uses native compilation (slow) No well-defined mechanism to generate an image Lots of mandatory dependencies Not available for all architectures Build systems Nearly full flexibility Not as easy as a binary distribution Buildroot, Yocto, PTXdist, etc. Built from source: customization and op- Build time timization are easy Fully reproducible Uses cross-compilation Have embedded specific packages not nec- essarily in desktop distros Make more features optional - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 4/1 Debian build systems Several projects have been created to automate the process of building and customizing a Debian image: I Hand-made scripts I ELBE I Debos I Isar - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 5/1 Debian build systems Several projects have been created to automate the process of building and customizing a Debian image: I Hand-made scripts I Hardly reproducible and maintable I Everybody rolls his own I ELBE I Debos I Isar - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 5/1 Debian build systems Several projects have been created to automate the process of building and customizing a Debian image: I Hand-made scripts I ELBE I First release in 2015 I Python code to use generic Debian tools I Only supported Debian, but we (Bootlin) contributed Ubuntu support I https://elbe-rfs.org/ I The focus of this talk I Debos I Isar - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 5/1 Debian build systems Several projects have been created to automate the process of building and customizing a Debian image: I Hand-made scripts I ELBE I Debos I Image and partition customizable I Possibility to tune the rootfs I Can not build custom packages from source I Written in Go I https://github.com/go-debos/debos I Isar - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 5/1 Debian build systems Several projects have been created to automate the process of building and customizing a Debian image: I Hand-made scripts I ELBE I Debos I Isar I Uses bitbake, needs Yocto knowledge I Not tested (less active than ELBE?) I https://github.com/ilbers/isar - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 5/1 ELBE advantages I Builds a Debian distribution I Powerful package management I Huge amount of packages I Let the Debian/Ubuntu maintainers do all the work on packages I Have reliable and regular security updates I Build your own packages I Manage licences I Several architectures, several image generation options I Tune your rootfs - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 6/1 Overall ELBE process Source: https://wiki.dh-electronics.com/index.php/ELBE_Overview - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 7/1 ELBE: getting started 1. Download ELBE from its Git repository 2. Create the initvm, a Debian virtual machine that includes the ELBE daemon. $ ./elbe initvm create 3. Then, after each reboot, you need to make sure the initvm is started: $ ./elbe initvm start - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 8/1 ELBE: build a basic Debian or Ubuntu image I In ELBE, the system to generate is described by an XML file I To build a Debian system for the BeagleBone Black, including bootloader and Linux kernel: $ ./elbe initvm submit examples/armhf-ti-beaglebone-black.xml The build takes approximately 50 min on my laptop I To build a basic Ubuntu system, with no bootloader or kernel: $ ./elbe initvm submit examples/armhf-ubuntu.xml The build takes approximately 30 minutes - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 9/1 ELBE: result directory Contents of the result directory, with the --build-sdk option enabled: $ ls elbe-build-20200903-113635 bin-cdrom.iso I bin-cdrom.iso elbe-report.txt image.tgz I image.tgz licence-chroot.txt licence-chroot.xml I license-* licence-sysroot-host.txt licence-sysroot-host.xml I licence-sysroot-target.txt setup-elbe...sh licence-sysroot-target.xml I licence-target.txt source.xml licence-target.xml I log.txt src-cdrom.iso setup-elbe-sdk-arm-[...]-armhf-ubuntu-1.0.sh I source.xml sysroot.tar.xz src-cdrom.iso sysroot.tar.xz validation.txt - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 10/1 ELBE: contents of the XML file I Global node: I Project node: I Target node: - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 11/1 ELBE: contents of the XML file I Global node: <ns0:RootFileSystem ... > ... </ns0:RootFileSystem> I Project node: I Target node: - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 11/1 ELBE: contents of the XML file I Global node: I Project node: <project> <name>Image name</name> <version>1.0</version> <description> Image description </description> <buildtype>armhf</buildtype> <mirror> <primary_host>ftp.de.debian.org</primary_host> <primary_path>/debian</primary_path> <primary_proto>http</primary_proto> </mirror> <suite>buster</suite> </project> I Target node: - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 11/1 ELBE: contents of the XML file I Global node: I Project node: I Target node: <target> <hostname>myImage</hostname> <domain>tec.linutronix.de</domain> <passwd>foo</passwd> <console>ttyS0,115200</console> <images> ... </images> <fstab> ... </fstab> <package> ... </package> <finetuning> ... </finetuning> <pkg-list> ... </pkg-list> </target> - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 11/1 ELBE: day to day work I The ELBE submit command allows to build an image from scratch I Builds all parts described in the XML file in one command I Good for releases/deliveries I But rebuilds everything! I The ELBE control command allows to work in a more-fine grained way I Doesn’t build all parts described in the XML file I Good for day-to-day work, image adjustement and customization - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 12/1 ELBE: using the control command (1/2) I Create a project $ ./elbe control create_project /var/cache/elbe/0a7b1788-b2ab-4b53-9319-0a810dab30d9 $ PRJ="/var/cache/elbe/0a7b1788-b2ab-4b53-9319-0a810dab30d9" I Define the image/system to build based on its XMLfile $ ./elbe control set_xml $PRJ armhf-ti-beaglebone-black.xml I Start the build and wait until it completes $ ./elbe control build $PRJ $ ./elbe control wait_busy $PRJ - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 13/1 ELBE: using the control command (2/2) I Now you can update/tweak your XML file, and restart the build $ ./elbe control set_xml $PRJ armhf-ti-beaglebone-black.xml $ ./elbe control build $PRJ $ ./elbe control wait_busy $PRJ I And retrieve the build results $ ./elbe control get_files $PRJ $ ./elbe control get_file $PRJ sdcard.img.tar.gz - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 14/1 Image customization ELBE allows to I Do various tweaks on the resulting filesystem from the XML file I Add more files/directories to your rootfs with an overlay I Add Debian packages to the image I Build your own packages I Add your packages to the delivery XML image file - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages42 Page
-
File Size-