-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mender delta updates fail to work due to systemd-machine-id-setup service #214
Comments
Thanks @vinotion! This relates to #198 as well as OE4T/meta-mender-community#8 (comment) and OE4T/meta-tegra#527. It's also related to systemd/systemd#14131 Cross referencing to setup links to these.
The change at https://github.com/OE4T/meta-tegra/pull/527/files#diff-6952bcad754469ed729bf94101a17d36ff760011bb19601d5e3b0f50d74a546f (see https://github.com/OE4T/meta-tegra/pull/527/files#diff-6952bcad754469ed729bf94101a17d36ff760011bb19601d5e3b0f50d74a546f for instance) puts the
However, systemd still writes
This thread provides some systemd philosophy regarding read only rootfs: https://lists.freedesktop.org/archives/systemd-devel/2021-February/046149.html. The summary is they expect The part I don't understand yet is why more platforms using mender delta update don't have this problem and where we are different in this regard. My guess is that the comment at #198 (reply in thread) is related and there's something different about cboot builds which means we don't get the |
The way I've dealt with this in my projects is to use systemd's volatile root feature, setting Getting this to work right with Yocto builds involves a bit of additional work, essentially turning off the volatile-binds stuff ( There are some issues with overlayfs support in the 4.9 kernel which can cause some issues, so I also wound up importing the back-port of the 4.19 overlayfs support to 4.9 that one of the overlayfs developers maintains to address those. |
Ugh, apologies for not getting back to this! The suggested links to discussions and solutions are great. Thanks @dwalkes @madisongh 👍🏻 We ended up adding some |
As promised in this discussion; here's a suggestion for making Mender delta updates work.
At the beginning of the boot process, systemd-machine-id-setup will change the machine ID in
/etc/machine-id
. If the root filesystem is writable at this moment in time, this will effectively change the root filesystem, and thereby disabling the ability to use Mender delta updates (which assumes an unmodified root filesystem to allow for incremental updates).By making sure the kernel already mounts the root filesystem as read-only, this change of
/etc/machine-id
is prevented. This can be done as follows:Because we also want various runtime-configurable persistent system configuration changes, we have an overlay mount for
/etc
.Aside from this minor issue, there seems to be a general compatibility issue of systemd with read-only root filesystems and overlayed
/etc
mounts. Some unconfigurable aspects of systemd simply assume that the root filesystem is writable at early boot time (i.e. before the/etc
overlay is mounted). This leads to interesting problems like:/etc
at very early boot time, before any overlay is mounted (which, of course, is where the customized hostname is). This can not be configured, systemd just assumes/etc
is correct and writable at this point.systemctl enable ...
creates symlinks in the overlayed/etc
filesystem, but at the very early boot time, the read-only root filesystem version of/etc
is used.We did not find a suitable solution for working with systemd and (partly) persistent changes in
/etc
.The text was updated successfully, but these errors were encountered: