[systemd-devel] OSTree mount integration

Lennart Poettering lennart at poettering.net
Mon Sep 24 13:19:53 PDT 2012

On Sun, 23.09.12 22:26, Colin Walters (walters at verbum.org) wrote:

> So I have this "boot into chroot" system that I wrote for GNOME:
> https://live.gnome.org/OSTree/
> Where the two interesting aspects here are:
> 1) I want the ability to allow people to try GNOME builds natively
>    without destroying their root partition - hence, chroots.
> 2) This allows for fully atomic upgrades.
> Now, basically right now systemd doesn't understand the fact that it's
> in a chroot, and fails to do things like remount the rootfs read-only
> when rebooting, etc.
> https://live.gnome.org/OSTree/MultipleRoots

Hmm, why do you use chroot()? I think for these kind of OS booting games
chroot() is not really the best way to do things, you actually want
proper bind mounts for that.

i.e. my suggestion would be to patch dracut (or write a dracut module)
that sets up your target OS tree with /var and friends directly, and
then transitions directly to it via moving it to / rather than first
moving into the host OS tree via a move/bind mount and then using
chroot() for the second step. (That said, whether you do this in one or
two steps is not important, what is important however is that you do not
use chroot()).

> Is there any opposition to having systemd support this setup?  It
> already detects virtualization and containers at the moment, so it seems
> like it'd make sense.
> I'm totally willing to change around the bind mount setup, but I think
> the most basic support is going to be basically just looking for the
> root filesystem on /sysroot instead of /.
> If there's no objections I'll be looking at doing some patches for the
> GNOME 3.8 cycle.

I am not totally against that, but I'd really like to keep explicit
virtualization checks at a minimum and use them as solution only if
nothing else works nicely.


Lennart Poettering - Red Hat, Inc.

More information about the systemd-devel mailing list