diff options
author | Colin Walters <walters@verbum.org> | 2017-05-11 14:54:12 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2017-05-16 16:13:05 +0000 |
commit | 30705889cb867c18cdb7fed8e55dc46477c069fa (patch) | |
tree | b6247fa4e4d51ad7a44bfef90381f3aad47c9d52 /Makefile-libostree.am | |
parent | d815ba2a81ad14d9d4edc31dcd282dcc2a3a8fb9 (diff) | |
download | ostree-30705889cb867c18cdb7fed8e55dc46477c069fa.tar.gz |
Switch to using a systemd generator for /var
If one wants to set up a mount for `/var` in `/etc/fstab`, it
won't be mounted since `ostree-prepare-root` set up a bind mount for
`/var` to `/sysroot/ostree/$stateroot/var`, and systemd will take
the already extant mount over what's in `/etc/fstab`.
There are a few options to fix this, but what I settled on is parsing
`/etc/fstab` in a generator (exactly like `systemd-fstab-generator` does),
except here we look for an explicit mount for `/var`, and if one *isn't* found,
synthesize the default ostree mount to the stateroot. Another nice property is
that if an admin creates a `var.mount` unit in `/etc` for example, that will
also override our mount.
Note that today ostree doesn't hard depend on systemd, so this behavior only
kicks in if we're built with systemd *and* libmount support (for parsing
`/etc/fstab`). I didn't really test that case though.
Initially I started writing this as a "pure libc" program, but at one point
decided to use `libostree.so` to find the booted deployment. That didn't work
out because `/boot` wasn't necessarily mounted and hence we couldn't find the
bootloader config. A leftover artifact from this is that the generator code
calls into libostree via the "cmd private" infrastructure. But it's an easy way
to share code, and doesn't hurt.
Closes: #859
Approved by: jlebon
Diffstat (limited to 'Makefile-libostree.am')
-rw-r--r-- | Makefile-libostree.am | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Makefile-libostree.am b/Makefile-libostree.am index 86ba0414..7f2e2a4a 100644 --- a/Makefile-libostree.am +++ b/Makefile-libostree.am @@ -115,6 +115,7 @@ libostree_1_la_SOURCES = \ src/libostree/ostree-sysroot-cleanup.c \ src/libostree/ostree-sysroot-deploy.c \ src/libostree/ostree-sysroot-upgrader.c \ + src/libostree/ostree-impl-system-generator.c \ src/libostree/ostree-bootconfig-parser.c \ src/libostree/ostree-deployment.c \ src/libostree/ostree-bootloader.h \ |