Skip to main content

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 us. A member of our team will be in touch shortly. Close

  1. Blog
  2. Article

Edoardo Barbieri
on 30 May 2022

Embedded Linux development on Ubuntu – Part III


Welcome to the concluding chapter of this journey on embedded Linux development with Ubuntu. We covered a lot of ground, so let us quickly recap what we learned so far.

In Part I we introduced Snaps, software packages designed for the world of IoT. Snap packages isolate and encapsulate an entire application, increasing the security and stability of embedded devices.

Snapcraft is the command-line tool to build snaps. It simplifies embedded development by allowing the packaging of any app for any Linux device. Snapcraft keeps your software up-to-date by automatically checking for updates four times a day. Head over to Part II to read more on Snapcraft and how it secures, eases and strengthens embedded Linux development.

In this concluding blog post, we’ll pull the different threads together and introduce Ubuntu Core, a version of the Ubuntu operating system designed and engineered for IoT systems. Built on snaps packages, Ubuntu Core automatically updates itself and its applications to create a confined and transaction-based system ideal for embedded devices. 

Porting the traditional embedded Linux development model to the modern app-centric world of interconnected devices uncovers many challenges, from applications tightly coupled to the OS having to target a specific release, decreasing developer velocity, to broken upgrades in one part of the device preventing refreshes in the rest of the system. On the other hand, the combination of Ubuntu Core, Snapcraft and snaps offers a production-grade platform for secure, open-source development, fast software deployment and global collaboration.

Let’s dive into it.

A new paradigm for embedded Linux development 

In Part I, we discussed several of the challenges inherent in the traditional software distribution mechanisms in Linux. The picture is further complicated when focusing on the embedded part of the compute spectrum

Ubuntu is the OS for most public cloud workloads as well as the emerging categories of smart gateways, self-driving cars and advanced robots.

Linux servers tend to be centralised, supported, expensive, and relatively cheap to fix. But Linux devices are distributed, field-serviced, and expensive to fix. Sending engineers out into the field to repair a compromised system is costly. If the device is relatively inexpensive, these operational expenditures quickly become unfeasible. In short, Linux on devices is different from servers, and lowering the cost of maintenance and the risk of a failure in the field must be a priority when doing embedded Linux development.

Furthermore, IoT is a fragmented but rich market: software vendors need a base that can work across different verticals and “things” to capitalise on the wave of tightly embedded, connected devices.

Ubuntu Core brings consistency to embedded Linux development by focusing on reliability across all connected platforms, regardless of the IoT sector one is operating in. Let’s find out more.

From smart homes to smart drones, robots, and industrial systems, Ubuntu Core is the new standard for embedded Linux. 

Embedded Linux development with Ubuntu Core

At Canonical, we used snaps to deliver a whole operating system: we built Ubuntu Core on the new packaging format to enable deploying secure and reliable software in production environments in the real world.

Ubuntu Core is a platform for technology suitable across the embedded compute spectrum, from drones and cars to fridges, gateways and robots. As an embedded operating system designed from first boot to be the most secure platform for connected devices, Ubuntu Core meets enterprise standards via automated updates, app stores and software management. Partners bring their software and Canonical handles the rest.

Ubuntu Core addresses the challenges of embedded Linux development via a modular architecture based on snaps, bullet-proof transactional updates, a smooth developer experience via Snapcraft, and built-in security. 

App-centric embedded Linux development

Ubuntu Core is a snap-only edition of Ubuntu, packaged and delivered using the new containerised format. The embedded OS packages applications, daemons and tools pulled from multiple upstream sources via snaps. Container primitives lock down and isolate the different functionalities, with applications running in a security sandbox by default, secured by kernel primitives like cgroups and AppArmor. Ubuntu Core containerises the Linux kernel and run-time environments, cleanly decoupling the base system and OS from the installed applications.

Each snap can have three levels of confinement from the system: strict (running in complete isolation), classic (allowing access to the system’s resources as traditional packages) and devmode (running as strictly confined with full access to system resources).

As the intelligence of a device is ultimately a function of the software it runs, Ubuntu Core  makes every device effectively app-enabled. The device’s primary function is an app, and developers can then ship other apps next to that primary function. Ubuntu Core is application-centric instead of a distribution archive-centric operating system.

The app-centric nature of Ubuntu Core allows publishers to update applications independently of the OS. Ubuntu Core is production-grade because software publishers can decide which updates are signed, certified and delivered to devices. 

Every embedded device running Ubuntu Core has guaranteed platform security and an App Store, underpinning the new wave of connected device business models

Efficient updates for embedded Linux development

As argued in Part I, in traditional embedded Linux development software publishers compare the package version on the devices to the repositories and apply a patch to the mismatch. Where conflicts arise, developers only push parts of the update. On the other hand, Ubuntu Core leverages the production-grade software distribution mechanism enabled by Snapcraft and the Snap Store by allowing atomic transactional updates. Delta diffs, downloaded over the air to conserve bandwidth, are patched with the existing snap to create a new version on disk. The system attempts to apply that update and moves forward on success or automatically rolls back in case of failure. Consumers of the embedded device can then access the latest application software avoiding the need to upgrade the entire OS. 

Software publishers can mitigate data corruption in case of update failures, as the system maintains the original data and snap before the upgrade, allowing seamless rollbacks as needed. The kernel and the rootfs are transactionally updated and roll back on failure like applications, enabling faster and more reliable updates. Ubuntu Core is reliable as every application and device has backup plans with iterative progressive testing, updates and releases. This makes the vendor code running on edge devices tamper-proof. 

During operations, an app may request permission to access the network or consume a file. Software publishers can adjust the confinement level via interfaces if applications require access to the filesystem or hardware or need to talk with each other. Because Ubuntu Core is made to simplify embedded Linux development, changing one line in the YAML file will suffice to provide the software access to a specific resource.

Interfaces enable resources from one snap to be shared with another and with the system. For a snap to use an interface, its developer needs to have first defined its corresponding plugs and slots within a snap’s snapcraft.yaml file.

The above qualities aim to address many of the challenges inherent in the traditional embedded Linux development and software distribution model. They effectively increase reliability, predictability and security.

Final considerations

Embedded Linux development is easy on Ubuntu Core, a flavour of Ubuntu optimised for security and reliable updates and fit for the IoT and embedded environments. It’s easy to deploy, tamper-resistant, and hardened against corruption. Its read-only root filesystem is built from the same packages used in the Ubuntu family of Linux distributions but differs in how its snap packages are delivered and updated. Snaps are secure, confined, dependency-free, cross-platform, containerised software packages that bundle their dependencies and ensure a clean separation between the base system and the installed applications on Ubuntu Core.

Embedded Linux development using snaps, Snapcraft and Ubuntu Core is faster, safer and more robust. First, Snapcraft eases discovering new software for your embedded devices as it can package, distribute, and update any app on the global Snap Store. Also, the transactional updates are either 100% successful or not installed at all, leaving no trace of failure other than log details. Your embedded device on Ubuntu Core remains fully operational during both application and system updates.  

Unlike more traditional package managers, a failed update never leaves the system in an unpredictable state. And finally, the system can recover or revert to previous states if necessary, even if a system fails to boot.

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
2 December 2024

Canonical announces public beta of optimized Ubuntu image for Qualcomm IoT platforms

Canonical announcements Article

Today Canonical, the publisher of Ubuntu, and Qualcomm® Technologies announce the official beta launch of the very first optimized image of  Ubuntu for Qualcomm® IoT Platforms. Through this beta program, developers will be able to download and use Ubuntu 22.04 LTS for the Qualcomm® RB3 Gen 2 Vision kit, which runs on the Qualcomm® QCS6490 ...