Skip to main content

Create A Custom Linux Init in Python

UD2.218A | Day 2 | 16:00 - 16:30 | Speakers: Hugo Herter

Create A Custom Linux Init in Python
A picture of a devroom at FOSDEM 2024
Open in browser

Notes

Abstract

On Linux, init is the first process started by the kernel during system boot. This talk will show how to write your own init in Python and why you might want to do so.

The Linux init process bootstraps user space and starts system processes. This is typically managed by Systemd, OpenRC, or the older System V. While these provide many useful features for modern desktops and servers, virtual machines and embedded devices can benefit from a more minimalist approach and precise control over userspace.

This talk will explore the steps required to create a new init in Python and the common patterns to achieve this:

  • Setting up a minimal filesystem.
  • Managing child processes and signals.
  • Handling system tasks like rebooting.
  • Interfacing with the host system.

We will demonstrate this process using Firecracker microVMs, the open-source virtualization tool that powers AWS Lambda and can start virtual machines in a few hundred milliseconds.

By the end of this talk, attendees will have a clear understanding of how to build and customize their own init processes, enabling them to create tailored environments for their specific needs, particularly in resource-constrained or specialized applications.

Speakers

Hugo Herter

Notice: The placeholder video image is licensed under CC BY-SA 4.0. The original image can be found hereChanges made to the image are: Cropped the image to a new ratio, part of the image was cut off.