Your submission was sent successfully! Close

Thank you for signing up for our newsletter!
In these regular emails you will find the latest updates from Canonical and upcoming events where you can meet our team.Close

Thank you for contacting our team. We will be in touch shortly.Close

  1. Blog
  2. Article

Edoardo Barbieri
on 26 May 2022

Embedded Linux development on Ubuntu – Part I


Welcome to this three-part mini-series on embedded Linux development on Ubuntu.

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?

Get in touch

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.

Related posts


Canonical
22 May 2024

Advantech RSB-3810, a new Single Board Computer powered by MediaTek Genio 1200, is now certified on Ubuntu 22.04 LTS

Internet of Things Article

Discover this new hardware solution designed for IoT and edge applications Canonical has partnered with MediaTek to optimise Ubuntu for IoT innovations and announced the first Ubuntu images optimised for MediaTek’s Genio 1200 System on Chip (SoC) in 2023. The solution is designed to deliver AI innovation in diverse markets. Devices built ...


Canonical
12 September 2023

이제 인텔 SoC에서 일반적으로 사용 가능한 최적화된 실시간 우분투

IoT Article

Canonical이 TSN 및 인텔 TCC를 지원하는 인텔 코어 프로세서에서 실시간 우분투를 제공 2023년 7월 26일, 런던: Canonical은 오늘 인텔 코어 프로세서에 최적화된 실시간 우분투를 이용할 수 있음을 발표했습니다. 이 솔루션을 통해 기업은 통신회사 워크로드에서 생명을 구하는 의료 장비 및 공장용 자동화 시스템에 이르기까지 광범위한 사용 사례에 인텔 실리콘에 최적화된 리눅스의 성능을 이용할 수 있습니다. Canonical의 ...


Canonical
26 July 2023

Optimised Real-time Ubuntu is now generally available on Intel SoCs

IoT Article

Canonical delivers Real-time Ubuntu on Intel Core processors with TSN and Intel TCC support London, 26 July 2023: Canonical today announced the availability of Real-time Ubuntu optimised on Intel Core processors.  The solution enables enterprises to harness the power of optimised Linux on Intel silicon for a wide range of use cases, from ...