Building Embedded Linux Systems Free
Total Page:16
File Type:pdf, Size:1020Kb
FREE BUILDING EMBEDDED LINUX SYSTEMS PDF Karim Yaghmour,Jon Masters,Gilad Ben-Yossef,Philippe Gerum | 464 pages | 02 Sep 2008 | O'Reilly Media, Inc, USA | 9780596529680 | English | Sebastopol, United States Building Embedded Linux Systems by Karim Yaghmour Jump to navigation. Linux is being deployed into a much wider array of devices than Linus Torvalds anticipated when he was working on it in his dorm room. The variety of supported chip architectures is astounding and has led to Linux in devices large and small; from huge IBM mainframes to tiny devices no bigger than their connection ports and everything in between. It is used in large enterprise data centers, internet infrastructure devices, Building Embedded Linux Systems personal development systems. It also powers consumer electronics, mobile phones, and many Internet of Things devices. When building Linux software for desktop and enterprise-class devices, developers Building Embedded Linux Systems use a desktop distribution such as Ubuntu on their build machines to have an environment as close as possible to the one where the software will be deployed. Tools such as VirtualBox and Docker allow even better alignment between development, testing, and productions environments. Wikipedia defines an embedded system as: "A computer system with a dedicated function within a larger mechanical or electrical system, often with real-time computing constraints. I find it simple enough to say that an embedded system is a computer that most people don't think of as a computer. Its primary role is to serve as an appliance of Building Embedded Linux Systems sort, and it is not considered a general-purpose computing platform. They may use different chip architectures, software stacks, and even operating systems. Development workflows are very different for embedded developers vs. Typically, the build output will consist of an Building Embedded Linux Systems software image for the target device, including the kernel, device drivers, libraries, and application software and sometimes the bootloader. In this article, I will present a survey of four commonly available options for building embedded Linux systems. I won't teach you Building Embedded Linux Systems to use any of them; there are plenty of in-depth online learning resources once you have narrowed your choices. No option is right for all use cases, and I hope to present enough details to direct your decision. Full disclosure: most of my work in embedded Linux has focused on the Yocto project, and my knowledge and bias to this system will Building Embedded Linux Systems be evident. Yocto uses Openembedded as its build system. Technically the two are separate projects; in practice, however, users do not need to understand the distinction, and the project names are frequently used interchangeably. The Yocto project is widely used in the industry and has backing from many influential companies. Additionally, it has a large and vibrant developer community and ecosystem contributing to it. There are many options for getting support with Building Embedded Linux Systems. There are books and other training materials if you wish to do-it-yourself. Many engineers with experience in Yocto are available if you Building Embedded Linux Systems to hire expertise. And many commercial organizations provide turnkey Yocto-based products or services-based implementation and customization for your design. The Yocto project is easily expanded through layerswhich can be published independently to add additional functionality, to target platforms not available in the project releases, or to store customizations unique to your system. Layers can be added to your configuration to add unique features that are not specifically included in the stock releases; for example, the " meta- browser " layer contains recipes for web browsers, which can be easily Building Embedded Linux Systems for your system. Because they are independently maintained, layers can be on a different release schedule tuned to the layers' development velocity than the standard Yocto releases. Yocto has arguably the widest device support of any of the options discussed in this article. Due to support from many semiconductor and board manufacturers, it's likely Yocto will support any target platform you choose. Finally, Yocto is extremely flexible and customizable. Customizations for your specific application can be stored in a layer for encapsulation and isolation. Customizations unique to a feature layer are generally stored as part of the layer itself, which allows the same settings to be applied simultaneously to multiple system configurations. Yocto also provides a well-defined layer priority and override capability. This allows you to define the order in which layers are applied and searched for metadata. It also enables you to override settings in layers with higher priority; for instance, many customizations to existing recipes will be added in your private layers, with the order precisely controlled by the priorities. The biggest disadvantage with the Yocto project is the learning curve. It takes significant time and effort to learn the system and truly understand it. Depending on your needs, this may be too large of an investment in technologies and competence that are not central to your Building Embedded Linux Systems. In such cases, working with one of the commercial vendors may be a good option. Development build times and resources are fairly high for Yocto project builds. The number of packages that need to be built, including the toolchain, kernel, and all target runtime components, is significant. Development workstations for Yocto developers tend to be large systems. Using a compact notebook is not recommended. This can be mitigated by using cloud-based build servers available from many providers. Additionally, Yocto has a built-in caching mechanism that allows it to reuse previously built components when it determines that the parameters for building a particular package have not changed. Using the Yocto project for your next embedded Linux design is a strong choice. Of the options presented here, it is the most broadly applicable regardless of your target use case. The broad industry support, active community, and wide platform support make this a good choice for must designers. The Buildroot project is Building Embedded Linux Systems as "a simple, efficient, and easy-to-use tool to generate embedded Linux systems through cross-compilation. In general, Buildroot will disable all optional compile-time settings for all packages with a few notable exceptionsresulting in the smallest possible system. It will be up to the system designer to enable the settings that are appropriate for a given device. Buildroot builds all components from source but does not support on-target package management. As such, it is sometimes called a firmware generator since the images are largely fixed at build time. Applications can update the target filesystem, but there is no mechanism to install new packages into a running system. Buildroot's focus on simplicity means that, in general, it is easier to learn than Yocto. The core build system is written in Make and is short enough to allow a developer to understand the entire system while being expandable enough to meet the needs of embedded Linux developers. The Buildroot core generally only handles common use cases, but it is expandable via scripting. The Buildroot system uses normal Makefiles and the Kconfig language for its configuration. Kconfig was developed by the Linux kernel community and is widely used in open source projects, making it familiar to many developers. Due to the design goal of disabling all optional build-time settings, Buildroot will generally produce the smallest possible images using the out-of-the-box configuration. The build times Building Embedded Linux Systems build host resources will likewise be smaller, in general, than those of the Yocto project. The focus on simplicity and minimal enabled build options imply that you may need to do significant customization to configure a Buildroot build for your application. Additionally, all configuration options are stored in a single file, which means if you have multiple hardware platforms, you will need to make each of your customization changes for each platform. Any change to the system configuration file requires a full rebuild of all packages. This is somewhat mitigated by the minimal image sizes and build times compared with Yocto, but it can result in long builds while you are tweaking your configuration. Intermediate package state caching is not enabled by default and is not as thorough as the Yocto implementation. This means that, while the first build may be shorter than an equivalent Yocto build, subsequent builds may require rebuilding of many components. Using Buildroot for your next embedded Linux design is a good choice for most applications. If your design requires multiple hardware types or other differences, you may want to reconsider due to the complexity of synchronizing multiple configurations, however, for a system consisting of a single setup, Buildroot will likely work well for you. The OpenWRT project was started to develop custom firmware for consumer routers. Many of the low-cost routers available at your local retailer are capable of running a Linux system, but maybe not out of Building Embedded Linux Systems box. The OpenWRT project produces updated firmware images for many devices that have been abandoned by their manufacturers and gives these devices a new lease on life. The OpenWRT project's primary deliverables are binary images for a large number of commercial devices. There are network-accessible package repositories that allow device end users to add new software Building Embedded Linux Systems their systems. The OpenWRT build system is a general-purpose build system, which allows developers to create custom versions to meet their own requirements and add new packages, but its primary focus is target binaries. If you are looking for replacement firmware for a commercial device, OpenWRT should be on Building Embedded Linux Systems list of options.