summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Klausen <kristian@klausen.dk>2021-09-03 23:36:22 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-09-06 09:49:50 +0100
commitd5f2b5b7ecb591904abfc4d9e8cd515997dc8969 (patch)
tree005a742851c133cdfa5b52fe646af1452da4a673
parentf2728d3ec8c0589e02e9a3ce7cf8aca902cae0a3 (diff)
downloadpoky-d5f2b5b7ecb591904abfc4d9e8cd515997dc8969.tar.gz
systemd: Add homed PACKAGECONFIG
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 (From OE-Core rev: fff339b5bd7789db5d0c024fc84490ac17fa4fe9) Signed-off-by: Kristian Klausen <kristian@klausen.dk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xmeta/recipes-core/systemd/systemd-systemctl/systemctl5
-rw-r--r--meta/recipes-core/systemd/systemd_249.3.bb5
2 files changed, 8 insertions, 2 deletions
diff --git a/meta/recipes-core/systemd/systemd-systemctl/systemctl b/meta/recipes-core/systemd/systemd-systemctl/systemctl
index e8c3d2d1ee..6324319a45 100755
--- a/meta/recipes-core/systemd/systemd-systemctl/systemctl
+++ b/meta/recipes-core/systemd/systemd-systemctl/systemctl
@@ -191,7 +191,7 @@ class SystemdUnit():
191 except KeyError: 191 except KeyError:
192 pass 192 pass
193 193
194 def enable(self): 194 def enable(self, caller_unit=None):
195 # if we're enabling an instance, first extract the actual instance 195 # if we're enabling an instance, first extract the actual instance
196 # then figure out what the template unit is 196 # then figure out what the template unit is
197 template = re.match(r"[^@]+@(?P<instance>[^\.]*)\.", self.unit) 197 template = re.match(r"[^@]+@(?P<instance>[^\.]*)\.", self.unit)
@@ -227,7 +227,8 @@ class SystemdUnit():
227 try: 227 try:
228 for also in config.get('Install', 'Also'): 228 for also in config.get('Install', 'Also'):
229 try: 229 try:
230 SystemdUnit(self.root, also).enable() 230 if caller_unit != also:
231 SystemdUnit(self.root, also).enable(unit)
231 except SystemdUnitNotFoundError as e: 232 except SystemdUnitNotFoundError as e:
232 sys.exit("Error: Systemctl also enable issue with %s (%s)" % (service, e.unit)) 233 sys.exit("Error: Systemctl also enable issue with %s (%s)" % (service, e.unit))
233 234
diff --git a/meta/recipes-core/systemd/systemd_249.3.bb b/meta/recipes-core/systemd/systemd_249.3.bb
index c2d4343f10..e848eea361 100644
--- a/meta/recipes-core/systemd/systemd_249.3.bb
+++ b/meta/recipes-core/systemd/systemd_249.3.bb
@@ -133,6 +133,7 @@ PACKAGECONFIG[gnu-efi] = "-Dgnu-efi=true -Defi-libdir=${STAGING_LIBDIR} -Defi-in
133PACKAGECONFIG[elfutils] = "-Delfutils=true,-Delfutils=false,elfutils" 133PACKAGECONFIG[elfutils] = "-Delfutils=true,-Delfutils=false,elfutils"
134PACKAGECONFIG[firstboot] = "-Dfirstboot=true,-Dfirstboot=false" 134PACKAGECONFIG[firstboot] = "-Dfirstboot=true,-Dfirstboot=false"
135PACKAGECONFIG[repart] = "-Drepart=true,-Drepart=false" 135PACKAGECONFIG[repart] = "-Drepart=true,-Drepart=false"
136PACKAGECONFIG[homed] = "-Dhomed=true,-Dhomed=false"
136# Sign the journal for anti-tampering 137# Sign the journal for anti-tampering
137PACKAGECONFIG[gcrypt] = "-Dgcrypt=true,-Dgcrypt=false,libgcrypt" 138PACKAGECONFIG[gcrypt] = "-Dgcrypt=true,-Dgcrypt=false,libgcrypt"
138PACKAGECONFIG[gnutls] = "-Dgnutls=true,-Dgnutls=false,gnutls" 139PACKAGECONFIG[gnutls] = "-Dgnutls=true,-Dgnutls=false,gnutls"
@@ -619,6 +620,7 @@ FILES:${PN} = " ${base_bindir}/* \
619 ${datadir}/dbus-1/system.d/org.freedesktop.timesync1.conf \ 620 ${datadir}/dbus-1/system.d/org.freedesktop.timesync1.conf \
620 ${datadir}/dbus-1/system.d/org.freedesktop.portable1.conf \ 621 ${datadir}/dbus-1/system.d/org.freedesktop.portable1.conf \
621 ${datadir}/dbus-1/system.d/org.freedesktop.oom1.conf \ 622 ${datadir}/dbus-1/system.d/org.freedesktop.oom1.conf \
623 ${datadir}/dbus-1/system.d/org.freedesktop.home1.conf \
622 " 624 "
623 625
624FILES:${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd" 626FILES:${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
@@ -717,6 +719,9 @@ python __anonymous() {
717 719
718 if bb.utils.contains('PACKAGECONFIG', 'repart', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'openssl', True, False, d): 720 if bb.utils.contains('PACKAGECONFIG', 'repart', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'openssl', True, False, d):
719 bb.error("PACKAGECONFIG[repart] requires PACKAGECONFIG[openssl]") 721 bb.error("PACKAGECONFIG[repart] requires PACKAGECONFIG[openssl]")
722
723 if bb.utils.contains('PACKAGECONFIG', 'homed', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'userdb openssl cryptsetup', True, False, d):
724 bb.error("PACKAGECONFIG[homed] requires PACKAGECONFIG[userdb], PACKAGECONFIG[openssl] and PACKAGECONFIG[cryptsetup]")
720} 725}
721 726
722python do_warn_musl() { 727python do_warn_musl() {