[systemd-devel] Using systemd.offline-updates from an ostree based system
Lennart Poettering
mzerqung at 0pointer.de
Mon Apr 29 09:16:34 UTC 2019
On Fr, 26.04.19 15:34, Richard Hughes (hughsient at gmail.com) wrote:
> On Fri, 26 Apr 2019 at 14:47, Dan Nicholson <nicholson at endlessm.com> wrote:
> > I think /etc is the only guaranteed to be writable location that's
> > generic to all ostree systems. If possible, I'd get systemd to honor
> > /etc/system-update.
>
> Lennart, is the attached going to be acceptable to you (of course as a
> PR with docs...), or do you want me to build a generator and ship
> something in fwupd? Another completely acceptable answer might be:
> just run the firmware update After=final.target as a one-shot
> service...
The patch looks okish.
> @@ -20,7 +20,8 @@ static const char *arg_dest = NULL;
> static int generate_symlink(void) {
> const char *p = NULL;
>
> - if (laccess("/system-update", F_OK) < 0) {
> + if (laccess("/system-update", F_OK) < 0 &&
> + laccess("/etc/system-update", F_OK) < 0) {
> if (errno == ENOENT)
> return 0;
Please rewrite this as `FOREACH_STRING(fn, "/system-update/,
"/etc/system-update") …` and then exit fatally with an error if
laccess() fails with any error != ENOENT. In the above failures to
laccess() /system-update are handled differently from those handling
/etc/system-update...
> @@ -77,6 +77,7 @@ units = [
> ['system-update.target', ''],
> ['system-update-pre.target', ''],
> ['system-update-cleanup.service', ''],
> + ['system-update-sysroot-cleanup.service',''],
Why a new service? We already have system-update-cleanup.service for
this purpose, no?
Please submit as PR via github!
Lennart
--
Lennart Poettering, Berlin
More information about the systemd-devel
mailing list