- Embedded Linux development on Ubuntu – Part I
- What you can expect from this series
- Traditional embedded Linux development
- Embedded Linux development with snaps
- Updates for embedded Linux development
- Final considerations
- Are you evaluating Ubuntu Linux for your embedded device?
- Further reading
- IoT as a service
- IoT app store
- Which Linux OS is Best for Embedded Development?
- Top Linux OS for embedded development
- 1: Yocto Project
- 2: Buildroot
- 3: OpenWrt
- 4: Ubuntu Core
- 5: Debian
- Factors to consider when choosing the best Linux OS
- Conclusion
Embedded Linux development on Ubuntu – Part I
Throughout this series, we will discuss the key challenges of traditional software distribution mechanisms for embedded Linux devices. We will understand why legacy development and update approaches do not suit the Internet-of-Things (IoT) world and assess how Ubuntu simplifies and secures embedded Linux development.
Although you don’t need prerequisite knowledge to follow this series, we recommend you have a basic understanding of the role played by Linux in the embedded portion of the compute spectrum. If you are new to the space and just getting started from scratch, get an intro to embedded Linux or delve into the official guide to Linux for embedded applications.
Several reasons justify why Linux is developers’ #1 choice for embedded applications, from being open-source and scalable to hardware support and tooling.
What you can expect from this series
Three elements lie at the heart of all embedded Linux devices running Ubuntu: snaps, snapcraft and Ubuntu Core. We will narrate the story of embedded Linux development with Ubuntu by gradually introducing those three concepts in Part I, Part II and Part III, respectively.
Here you are in Part I, at the beginning of the journey. We will start with the basics and offer a quick refresh of the pain point of discovering, developing and deploying new software for embedded Linux devices. Having set the stage, we will introduce a new Linux packaging format fit for IoT and embedded environments. In Part I, we will understand how Snap packaging secures embedded Linux development by confining applications and bundling them with their dependencies.
In Part II, we will explain how Snapcraft, the command and framework to build and publish snaps, simplifies embedded Linux development. And finally, we will introduce Ubuntu Core, Ubuntu for IoT and embedded environments, and study its relation to snaps and Snapcraft in Part III.
With so much to cover, let’s dive straight into Part I.
Traditional embedded Linux development
Delivering software for embedded Linux devices has traditionally been problematic.
The proliferation of a format per distribution in standard Linux packaging, whether a Slackware package, a DEB or an RPM for embedded environments or otherwise, means developers have to learn them all to reach a wider audience. Embedded Linux development is as painful as discovering new software. It often means hunting down PPAs, grabbing packages via command-line tools like rpm, apt and pktools, or building from source instructions. Furthermore, handcrafted packages often require complex code to manage installation and updates, are incompatible with each other, have unmet dependencies or may write all over the filesystem.
To solve the challenge of installed libraries having dependencies on specific software package versions, users often obtain newer or older versions of the dependent packages. This may break compatibility further, pushing the problem to another set of packages.
An equally painful story holds for updates. Because those packages are not transactional, software update strategies are mostly a manual, non-atomic package-based operation.
The target devices of your embedded Linux project will likely connect to the internet, with their attack surface increasing due to the network exposure. Intruders may thus attempt to exploit eventual bugs remotely, and the frequency of the updates will increase due to security issues.
Whereas an apt-get update works fine for servers within a secure environment, intermittent power and network outages for devices in the field mean an update will likely be interrupted. Delivering reliable software updates to low-powered, inaccessible, and often remotely administered embedded devices requires a well-thought-out solution. With traditional mechanisms, faulty updates can cause IoT devices to become unstable, and fixing them requires costly manual intervention through on-site engineer visits or device recalls.
Embedded Linux development with snaps
Snaps were born to ease the pain points of embedded Linux developers looking for a secure environment and configuration to run their applications. Also, snaps allow software publishers to control the shipped binary and the exact version available to their users
Snaps are a new application packaging format that uses container technology. Snaps work anywhere, including all major Linux distributions, and are suitable for any class of devices, from desktop to cloud and IoT. As cross-platform, containerised software packages, snaps bundle applications with their dependencies.
Snaps enable every device to be software-defined. Every embedded Linux device running snaps is app-enabled: its main function is an app, and developers can ship other apps next to that primary function.
Compared to traditional Linux software distribution and containerised packages, snaps are easy to create, build and deploy. Snap packaging was built from the ground up with security in mind, making them safer to run: embedded Linux development with snaps is secured because snaps undergo a rigorous review process before being published. By confining applications, the address book of a home appliance will not access the camera unless permitted, and the game on an embedded device will not reach into a bitcoin wallet and steal any cryptocurrencies that may be left.
Updates for embedded Linux development
Snaps automatically update over the air and using deltas, keeping the functionality of an embedded Linux device always fresh and without risk of breaking. When doing embedded Linux development, users can schedule updates for specific maintenance windows and keep them timely by only sending the delta.
With snaps comes reliability, as transactional updates make updating software worry-free. Should an update have unforeseen bugs or break the already deployed software, the system would automatically roll back to its last stable state. Failing health checks trigger the rollback of an updated snap, and admins can effortlessly audit these transactions from any machine.
Snaps solve the update problem for embedded Linux devices regardless of fleet scale. Devices running Ubuntu deliver packages through snaps – a secure, confined, dependency-free, cross-platform Linux packaging system – which enable automated and transactional updates that are only installed if successful.
Snaps provide for robust app rollouts: canary updates enable targeting a set of systems for initial testing, whereas phased updates allow throttling updates to smaller fractions of devices.
Transactional updates, airtight security, and compatibility across architectures and operating systems make snaps a perfect solution for embedded Linux development.
Final considerations
Snaps are app packages for embedded devices that are easy to install, secure, cross‐platform and dependency‐free. Snaps simplify installs for embedded Linux devices to a single standard command by bundling dependencies and assets.
With the necessary context behind snaps in mind, head over to Part II, where we will discuss how Snapcraft eases embedded Linux development.
Are you evaluating Ubuntu Linux for your embedded device?
Further reading
Why is Linux the OS of choice for embedded systems? Check out the official guide to Linux for embedded applications in whitepaper or webinar form.
Interested in a detailed comparison of Yocto and Ubuntu Core? Watch the Yocto or Ubuntu Core for your embedded Linux project? webinar.
Did you hear the news? Real-time Ubuntu 22.04 LTS Ubuntu is now available. Check out the latest webinar on real-time Linux to find out more.
Do you have a question, feedback, or news worth sharing? Join the conversation on IoT Discourse to discuss everything related to the Internet of Things and tightly connected, embedded devices.
IoT as a service
Bring an IoT device to market fast. Focus on your apps, we handle the rest. Canonical offers hardware bring up, app integration, knowledge transfer and engineering support to get your first device to market. App store and security updates guaranteed.
IoT app store
Build a platform ecosystem for connected devices to unlock new avenues for revenue generation. Get a secure, hosted and managed multi-tenant app store for your IoT devices.
Which Linux OS is Best for Embedded Development?
As the need for interconnected devices keeps rising, the domain of embedded development is expanding quickly. Linux, being an open-source operating system (OS), has become a popular choice for embedded systems due to its flexibility, scalability, and the strong community support it receives.
With that said, the availability of numerous Linux distributions demands us to carefully select the right Linux OS as it can significantly impact the performance, security, and functionality of your embedded device. In case you want to know your options, below we have discussed a few of the Linux OS best for embedded development.
Top Linux OS for embedded development
1: Yocto Project
The Yocto Project is a widely-used open-source collaboration that provides developers with the tools and templates necessary to create custom Linux-based systems for embedded devices. It is highly customizable, allowing you to create an OS tailored to your specific needs, and supports a wide range of hardware platforms and architectures. Moreover, it has a strong and active community that contributes to the project, ensuring regular updates and improvements.
2: Buildroot
Buildroot is another popular open-source project that simplifies the process of building a complete Linux-based system for embedded devices. It is lightweight and streamlined, making it ideal for resource-constrained devices. Its easy-to-use configuration system enables developers to quickly create a custom Linux OS, and it supports numerous architectures and hardware platforms.
3: OpenWrt
OpenWrt is a Linux distribution specifically designed for embedded devices, particularly routers and network-attached storage devices. It is highly modular and customizable, allowing you to build a Linux OS that meets your exact requirements. Furthermore, it has robust network capabilities and a wide range of supported protocols, with active development and community support.
4: Ubuntu Core
Designed specifically for embedded and IoT devices, Ubuntu Core is a streamlined, secure, and lightweight variant of the well-known Ubuntu Linux distribution. Built on the widely-adopted Ubuntu base, it ensures compatibility and familiarity. The focus of Ubuntu Core is on security, with features like transactional updates and strict confinement. It is optimized for IoT and embedded devices, resulting in a smaller footprint and faster performance, and offers strong community support and extensive documentation.
5: Debian
Debian is a well-established and widely-used Linux distribution that offers stability, security, and a large repository of software packages. While not specifically designed for embedded systems, Debian can be tailored for embedded development by using its minimal installation options and customizing the package selection. It has a strong community, long-term support, and a reputation for being reliable, making it a viable choice for embedded development projects.
Factors to consider when choosing the best Linux OS
When selecting a Linux distribution for your embedded development project, consider the following factors:
- Compatibility: Ensure that the Linux distribution you choose supports the specific hardware and software requirements of your embedded system. Check the documentation and hardware compatibility lists to avoid potential issues during development.
- Customizability: Look for a Linux distribution that offers a high degree of customizability, allowing you to create a tailored OS that meets your project’s unique needs. This is particularly important for embedded devices with specific performance, security, or functionality requirements.
- Community support: Choose a Linux distribution backed by a strong community, as this ensures regular updates, bug fixes, and improvements. A supportive community can also provide valuable assistance and resources for troubleshooting issues during the development process.
- Long-term support and updates: Select a Linux distribution that offers long-term support and regular updates, as this ensures your embedded system stays secure and up-to-date. Consider the release cycles and support policies of different distributions to make an informed decision.
Conclusion
The world of embedded development is vast and ever-changing, with Linux-based operating systems playing a vital role in its progression. Ubuntu, Debian, and Yocto Project are all strong contenders, offering unique advantages that cater to different user preferences and project demands. The key is to assess your project requirements, desired level of customization, and available support resources when selecting the ideal Linux distribution. Try them now and unlock the full potential of Linux in your embedded development projects.