ostree/src/boot
Colin Walters 5af403be0c Support mounting /sysroot (and /boot) read-only
We want to support extending the read-only state to cover `/sysroot`
and `/boot`, since conceptually all of the data there should only
be written via libostree.  Or at least for `/boot` should *mostly*
just be written by ostree.

This change needs to be opt-in though to avoid breaking anyone.

Add a `sysroot/readonly` key to the repository config which instructs
`ostree-remount.service` to ensure `/sysroot` is read-only.  This
requires a bit of a dance because `/sysroot` is actually the same
filesystem as `/`; so we make `/etc` a writable bind mount in this case.

We also need to handle `/var` in the "OSTree default" case of a bind
mount; the systemd generator now looks at the writability state of
`/sysroot` and uses that to determine whether it should have the
`var.mount` unit happen before or after `ostree-remount.service.`

Also add an API to instruct the libostree shared library
that the caller has created a new mount namespace.  This way
we can freely remount read-write.

This approach extends upon in a much better way previous work
we did to support remounting `/boot` read-write.

Closes: https://github.com/ostreedev/ostree/issues/1265
2019-12-11 15:33:57 +00:00
..
dracut ostree-prepare-root.service: Run earlier in initrd 2018-10-19 15:41:10 +00:00
grub2 Revert "grub2: Exit gracefully if the configuration has BLS enabled" 2019-10-24 17:49:53 +00:00
mkinitcpio Move ostree-* executables to /usr/lib/ostree 2016-08-11 14:04:59 +00:00
ostree-finalize-staged.path boot: Add ostree-finalize-staged.path 2018-10-23 13:10:49 +00:00
ostree-finalize-staged.service boot/finalize-staged: Run after systemd-journal-flush.service 2019-09-24 21:39:10 +00:00
ostree-prepare-root.service ostree-prepare-root.service: Run earlier in initrd 2018-10-19 15:41:10 +00:00
ostree-remount.service Support mounting /sysroot (and /boot) read-only 2019-12-11 15:33:57 +00:00
ostree-tmpfiles.conf boot: Add a tmpfiles.d snippet to clean up /var/tmp/ostree-ovl.XXX 2017-08-17 18:38:45 +00:00