]> code.ossystems Code Review - openembedded-core.git/commitdiff
systemd: Add homed PACKAGECONFIG
authorKristian Klausen <kristian@klausen.dk>
Fri, 3 Sep 2021 21:36:22 +0000 (23:36 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 4 Sep 2021 14:05:39 +0000 (15:05 +0100)
If systemd is built with fdisk support[1] and the openssl and cryptsetup
PACKAGECONFIG are enabled, systemd-homed[1] is automatically enabled.
The org.freedesktop.home1.conf file was forgotten, so this commit adds
the file and make enabling homed a explicit choice.

systemd-homed.service and systemd-homed-activate.service have a Also= on
each other, so "systemctl" has been fixed to handle the circular
dependency.

userdb isn't strictly speaking needed for homed but "systemctl" can't
handle the missing unit file and upstream recommend enabling both[3].

[1] Automatically enabled if the fdisk dependency is installed which it
    is as util-linux is pulled in by systemd
[2] https://www.freedesktop.org/software/systemd/man/systemd-homed.service.html
[3] https://github.com/systemd/systemd/commit/871dc8d644eef7542a5330f84c25b1db2617317c

Signed-off-by: Kristian Klausen <kristian@klausen.dk>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/systemd/systemd-systemctl/systemctl
meta/recipes-core/systemd/systemd_249.3.bb

index e8c3d2d1ee4050b0c5519d8ef73eb377c516c21b..6324319a4535bd92db70e803d8bad7863a41a533 100755 (executable)
@@ -191,7 +191,7 @@ class SystemdUnit():
         except KeyError:
             pass
 
-    def enable(self):
+    def enable(self, caller_unit=None):
         # if we're enabling an instance, first extract the actual instance
         # then figure out what the template unit is
         template = re.match(r"[^@]+@(?P<instance>[^\.]*)\.", self.unit)
@@ -227,7 +227,8 @@ class SystemdUnit():
         try:
             for also in config.get('Install', 'Also'):
                 try:
-                    SystemdUnit(self.root, also).enable()
+                    if caller_unit != also:
+                        SystemdUnit(self.root, also).enable(unit)
                 except SystemdUnitNotFoundError as e:
                     sys.exit("Error: Systemctl also enable issue with  %s (%s)" % (service, e.unit))
 
index c2d4343f104536b6106ed559cd587885d1ff9625..e848eea3616d849ddcefa841a804e725a2ce789f 100644 (file)
@@ -133,6 +133,7 @@ PACKAGECONFIG[gnu-efi] = "-Dgnu-efi=true -Defi-libdir=${STAGING_LIBDIR} -Defi-in
 PACKAGECONFIG[elfutils] = "-Delfutils=true,-Delfutils=false,elfutils"
 PACKAGECONFIG[firstboot] = "-Dfirstboot=true,-Dfirstboot=false"
 PACKAGECONFIG[repart] = "-Drepart=true,-Drepart=false"
+PACKAGECONFIG[homed] = "-Dhomed=true,-Dhomed=false"
 # Sign the journal for anti-tampering
 PACKAGECONFIG[gcrypt] = "-Dgcrypt=true,-Dgcrypt=false,libgcrypt"
 PACKAGECONFIG[gnutls] = "-Dgnutls=true,-Dgnutls=false,gnutls"
@@ -619,6 +620,7 @@ FILES:${PN} = " ${base_bindir}/* \
                 ${datadir}/dbus-1/system.d/org.freedesktop.timesync1.conf \
                 ${datadir}/dbus-1/system.d/org.freedesktop.portable1.conf \
                 ${datadir}/dbus-1/system.d/org.freedesktop.oom1.conf \
+                ${datadir}/dbus-1/system.d/org.freedesktop.home1.conf \
                "
 
 FILES:${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
@@ -717,6 +719,9 @@ python __anonymous() {
 
     if bb.utils.contains('PACKAGECONFIG', 'repart', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'openssl', True, False, d):
         bb.error("PACKAGECONFIG[repart] requires PACKAGECONFIG[openssl]")
+
+    if bb.utils.contains('PACKAGECONFIG', 'homed', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'userdb openssl cryptsetup', True, False, d):
+        bb.error("PACKAGECONFIG[homed] requires PACKAGECONFIG[userdb], PACKAGECONFIG[openssl] and PACKAGECONFIG[cryptsetup]")
 }
 
 python do_warn_musl() {