Systemd? You Aint Seen Nothing Yet!
Written by Mike James   
Monday, 08 September 2014

Lennart Poettering has caused a big stir in the Linux world with his systemd approach to configuration. Now he has suggested a new way of building distros and getting your code into the users hands and its all based on Btrfs.

tuxicon

 

There are a number of problems that the scheme proposed by Poettering and the systemd core developers aim to solve. The main complaint is that Linux distributions don't get applications into the hands of end users in anything like an efficient way. Each distro uses its own package system to all users to customize the OS by installing what they want to use. This means that if you develop a new app you have to wait until the distro gets round to packaging for you. In addition packages suffer from dependency hell and this makes life tougher for the potential user. 

The Lennart solution is to make use of features of the B-tree file system. At the moment Btrfs is part of the kernel and generally considered to be an advanced file system - even though few people use it. It was originally invented at Sun/Oracle and is currently maintained by Facebook. 

The idea is to make use of name spacing in the file system to allow programmers to provide their applications as loadable sub-volumes. The idea is to have a naming scheme like:

app:<vendorid>:<runtime>:<architecture>:<version> 

for application bundles. For example:

iapp:org.libreoffice.LibreOffice:GNOME3_20:x86_64:133

Similar naming schemes for a range of other standard OS parts is also used - root: for the core OS, usr: for the user file system, home: for a specific user's home directory and so on. On a given volume there could be multiple root: and usr: sub-volumes and lots of app: sub-volumes.

The system boots from one of the root sub-volumes, then mounts a matching usr: sub-volume. When a user logs in the corresponding home: sub-volume is mounted. When an app is run the corresponding app: sub-volume is mounted to /opt/<vendorname>.

So if you want to distribute a new application all you have to do is create the appropriate Btrfs sub-volume and make it available to users. 

The same scheme can be used to boot different configurations from the same storage device. It just becomes a matter of pick-and-mix sub-volumes. If you want to keep different development environments, different operating systems even then you can and change things around in no time at all. 

If you are worried about keeping so many copies of the same code and data on a single volume then don't be because Btrfs is designed for de-duplication. Its basic implementation philosophy is copy-on-write, which only creates new physical copies if there is a difference. 

There is more!

Using Btrfs' send and receive facility you can compute the diff of two file system versions. This can be used to create a binary delta, i.e. the difference between version 1 and version 2 of your application. You can then send this to the user's machine and they have the new version installed.

To quote from the blog entry that describes this idea:

"This is how we envision installation and updating of operating systems, applications, runtimes, frameworks. At installation time, we simply deserialize an initial send-and-receive delta into our btrfs volume, and later, when a new version is released we just add in the few bits that are new, by dropping in another send-and-receive delta under a new sub-volume name. And we do it exactly the same for the OS itself, for a runtime, a framework or an app. There's no technical distinction anymore. The underlying operation for installing apps, runtime, frameworks, vendor OSes, as well as the operation for updating them is done the exact same way for all."

To find out all the other slightly more minor advantages you will need to read the entire blog post.  It is also going to be presented at October's LinuxCon Europe. 

The systemd developers have started work on the idea and hope that others will join in. Of course there is likely to be a backlash from users who like Linux just as it is. From a user's point of view, however, the good old Linux file system structure is going to be relatively unchanged. What will change is how programmers distribute their apps and the updates to apps and how we can reconfigure the system we are using. 

However, this probably isn't going to smooth the progress of this scheme. By adopting it the Linux community is basically accepting Btrfs as the standard file system and this isn't going to happen without a lot of turbulence. Some see it as bringing Linux into the 21st century and others see it as changing the basic Linux philosophy. 

Interesting times indeed.

tuxicon

Banner


Kafka 3.9 Adds Dynamic KRaft Quorums
16/12/2024

Kafka 3.9 has been released. The team says this is a major release and the final in the 3.x line. It This will also be the final major release to feature the deprecated Apache ZooKeeper mode. Kafka is [ ... ]



Eclipse IoT Developer Survey 2024
04/12/2024

The Eclipse Foundation’s IoT Working Group has released the results of its 2024 IoT Developer Survey. Industrial automation and automotive are now the leading industry sectors and connectivity is th [ ... ]


More News

 

espbook

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Monday, 08 September 2014 )