Systemd Adds HTTP Download for System Images

Lennart Pottering (Lennart Poettering) suggested incorporating a change in the system manager Systemd that would allow loading the system using the root FS image from an external host via the HTTP protocol. This change expands the capabilities of Systemd to not only download the disk image via HTTP during the initial boot stage, but also unpack the image, associate it with a block device in loopback-mode, mount the block device as /sysroot, and load the system from it.

Support for downloading disk images during system boot using the Systemd-Import-Generator has been included in SystemD 257. The rest of the functionality is currently in the working prototype stage and requires further improvement. The full loading cycle support is not yet implemented, but there are plans to enhance the functionality to the UKI (Unified Kernel Image) for UEFI HTTP Boot, which combines UEFI Boot Stub, the Linux kernel, and the systemic environment loaded in memory.

The URL calculation for loading a system image is based on the URL set for the EFI image in the UEFI http boot settings. In the future, support for the technology nvme-over-tcp is also planned, allowing NVMe drives to be accessed over the network using the TCP protocol.

By loading images from an external host, it is expected that testing modern immutable operating systems on physical hardware will be simplified. Developers can create an image using the Mkosi utility on their computer and make it accessible through the HTTP command “Mkosi -f Serve.” For testing on a different computer, simply include the EFI loading via HTTP and add the URL of the loaded image using the command:

kernel-bootcfg –add-uuri = http: //192.168.47: 8081/iMage.Efi –title = Testloop –boot-Order = 0

After this, rebooting the computer will result in the typical loading of the UKI kernel image, which will then load the developer’s disk image with the root FS. Subsequent reboots will load a fresh systemic image without affecting local disks.

/Reports, release notes, official announcements.