Skip to contentSkip to conversation

systemd: Upgrade 259.5 -> 259.10

PATCH Superseded Jaipaul Cheernam 2 participants 14 messages Oct 27 – Nov 14

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 systemd: Upgrade 259.5 -> 259.10

* Stable v259 release uplift
* CompareLog: https://github.com/systemd/systemd/compare/v259.5...v259.10
* Drop below patches which are part of upstream 0001-Revert-resolve-refuse-traffic-from-the-local-host-only.patch, 0004-tpm2-util-fix-PCR-bank-guessing-without-EFI.patch

---
 ...259.5.bb => systemd-boot-native_259.10.bb} |  0
 ...d-boot_259.5.bb => systemd-boot_259.10.bb} |  0
 ....bb => systemd-systemctl-native_259.10.bb} |  0
 meta/recipes-core/systemd/systemd.inc         |  2 +-
 ...use-traffic-from-the-local-host-only.patch | 61 ------------------
 ...il-fix-PCR-bank-guessing-without-EFI.patch | 62 -------------------
 .../{systemd_259.5.bb => systemd_259.10.bb}   |  2 -
 7 files changed, 1 insertion(+), 126 deletions(-)
 rename meta/recipes-core/systemd/{systemd-boot-native_259.5.bb => systemd-boot-native_259.10.bb} (100%)
 rename meta/recipes-core/systemd/{systemd-boot_259.5.bb => systemd-boot_259.10.bb} (100%)
 rename meta/recipes-core/systemd/{systemd-systemctl-native_259.5.bb => systemd-systemctl-native_259.10.bb} (100%)
 delete mode 100644 meta/recipes-core/systemd/systemd/0001-Revert-resolve-refuse-traffic-from-the-local-host-only.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0004-tpm2-util-fix-PCR-bank-guessing-without-EFI.patch
 rename meta/recipes-core/systemd/{systemd_259.5.bb => systemd_259.10.bb} (99%)
meta/recipes-core/systemd/systemd-boot-native_259.10.bb renamed from meta/recipes-core/systemd/systemd-boot-native_259.5.bb +0 -0
similarity index 100%
rename from meta/recipes-core/systemd/systemd-boot-native_259.5.bb
rename to meta/recipes-core/systemd/systemd-boot-native_259.10.bb
meta/recipes-core/systemd/systemd-boot_259.10.bb renamed from meta/recipes-core/systemd/systemd-boot_259.5.bb +0 -0
similarity index 100%
rename from meta/recipes-core/systemd/systemd-boot_259.5.bb
rename to meta/recipes-core/systemd/systemd-boot_259.10.bb
meta/recipes-core/systemd/systemd-systemctl-native_259.10.bb renamed from meta/recipes-core/systemd/systemd-systemctl-native_259.5.bb +0 -0
similarity index 100%
rename from meta/recipes-core/systemd/systemd-systemctl-native_259.5.bb
rename to meta/recipes-core/systemd/systemd-systemctl-native_259.10.bb
meta/recipes-core/systemd/systemd.inc +1 -1
index bbcacf9deb..ae3a034ef3 100644
@@ -15,7 +15,7 @@ LICENSE:libsystemd = "LGPL-2.1-or-later"
 LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=c09786363500a9acc29b147e6e72d2c6 \
                     file://LICENSE.LGPL2.1;md5=be0aaf4a380f73f7e00b420a007368f2"
 
-SRCREV = "b3d8fc43e9cb531d958c17ef2cd93b374bc14e8a"
+SRCREV = "cc6062f23cb595c172d9a007ed99d925852bfd60"
 SRCBRANCH = "v259-stable"
 SRC_URI = "git://github.com/systemd/systemd.git;protocol=https;branch=${SRCBRANCH};tag=v${PV}"
 
meta/recipes-core/systemd/systemd/0001-Revert-resolve-refuse-traffic-from-the-local-host-only.patch deleted +0 -61

61 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0004-tpm2-util-fix-PCR-bank-guessing-without-EFI.patch deleted +0 -62

62 lines not on this page · raw message

meta/recipes-core/systemd/systemd_259.10.bb renamed from meta/recipes-core/systemd/systemd_259.5.bb +0 -2
similarity index 99%
rename from meta/recipes-core/systemd/systemd_259.5.bb
rename to meta/recipes-core/systemd/systemd_259.10.bb
index e924884bf9..f7c16a045d 100644
@@ -34,8 +34,6 @@ SRC_URI += " \
            file://0003-Do-not-create-var-log-README.patch \
            file://0001-meson-use-libfido2_cflags-dependency.patch \
            file://0018-shared-fdset-add-detailed-debug-logging-to-fdset_new.patch \
-           file://0004-tpm2-util-fix-PCR-bank-guessing-without-EFI.patch \
-           file://0001-Revert-resolve-refuse-traffic-from-the-local-host-only.patch \
            "
 
 PAM_PLUGINS = " \
#1 lore raw

Hi Yoann,

My local test shows regression failures and I will get back . So please hold on this.

Regards,
Jaipaul

#2 lore raw

v2 cover systemd: Upgrade 259.5 -> 259.10

In reply to Jaipaul Cheernam

This series upgrades systemd on the v259 stable branch from 259.5 to 259.10, and backports the upstream oe-core change that generates hwdb.bin natively at rootfs time instead of via qemu-user.

Without the native-hwdb change, the 259.10 uplift breaks image
do_rootfs: the update_udev_hwdb postinstall intercept runs the target 'udevadm hwdb' under qemu-user, and on systemd 259.9+ its statx() use fails there with:

Failed to write database /usr/lib/udev/hwdb.bin: Bad address

Confirmed by A/B build: 259.5 builds the rootfs fine, 259.10 fails deterministically at the update_udev_hwdb intercept.

To keep the series bisectable and regression-free, the nine upstream oe-core commits that introduce and depend on the native systemd-hwdb are applied first, and the version uplift is the final commit. This ordering means every commit builds and boots on its own: at no point is the tree on 259.10 without the native-hwdb fix already in place.

The nine fix commits are cherry-picked from oe-core. Seven apply cleanly; two (patches 7 and 8) carry small, documented adaptations to our local systemd-tools-native recipe, recorded as Note: lines in the commit messages:

- MESON_TARGET keeps the "<name>:executable" qualifier. Our meson (1.10.2) reports a bare "systemctl"/"systemd-hwdb" as an ambiguous target name because systemd also ships a bash-completion custom target named "systemctl". This can be reverted once meson is upgraded (oe-core master uses bare names with meson 1.12.x).
- The local "-Dpam=disabled" option and the systemd-sysv-install do_install:append are preserved.

Backport note for 259.10:
- The upstream "hwdb: strip the root from filenames" source fix is already part of systemd v259.8+ (upstream a9397de9d2). The corresponding 0001-hwdb-strip-the-root-...patch is therefore carried only while the tree still builds 259.5 (patch 8) and dropped again in the version uplift (patch 10), where it is redundant.

The version uplift (patch 10) also drops two patches now included upstream in 259.10:
- 0001-Revert-resolve-refuse-traffic-from-the-local-host-only.patch
- 0004-tpm2-util-fix-PCR-bank-guessing-without-EFI.patch

Testing (qemux86-64, INIT_MANAGER = "systemd"):
- Every commit builds and 'bitbake core-image-minimal' do_rootfs succeeds; the intercept log shows "Updating HWDB with native systemd-hwdb..." instead of the previous qemu-user failure.
- oeqa systemd runtime suite (testimage) at every commit:
10 passed, 2 skipped (minidebuginfo coredump and the read-only-rootfs disable/enable variant), 0 failures, 0 errors.

Jaipaul Cheernam (1):
systemd: Upgrade 259.5 -> 259.10

Ross Burton (9):
keymaps: remove obsolete systemd masking
initscripts: remove obsolete systemd masking
modutils-initscripts: remove obsolete systemd masking
systemd: move systemd-systemctl-native PACKAGE_WRITE_DEPS to
systemd.bb
classes/systemd: remove obsolete DEPENDS
systemd-systemctl-native: rename to systemd-tools-native
systemd-tools-native: reduce dependencies, add comments
systemd-tools-native: add systemd-hwdb
systemd: no need to use qemu for hwdb update

 meta/classes-recipe/systemd.bbclass           |  2 -
 meta/conf/distro/include/maintainers.inc      |  2 +-
 meta/recipes-bsp/keymaps/keymaps_1.0.bb       | 17 -----
 .../initscripts/initscripts_1.0.bb            | 26 --------
 ...259.5.bb => systemd-boot-native_259.10.bb} |  0
 ...d-boot_259.5.bb => systemd-boot_259.10.bb} |  0
 .../systemd/systemd-systemctl-native_259.5.bb | 29 ---------
 .../systemd/systemd-tools-native_259.10.bb    | 45 ++++++++++++++
 meta/recipes-core/systemd/systemd.inc         |  2 +-
 ...use-traffic-from-the-local-host-only.patch | 61 ------------------
 ...il-fix-PCR-bank-guessing-without-EFI.patch | 62 -------------------
 .../{systemd_259.5.bb => systemd_259.10.bb}   | 12 ++--
 .../modutils-initscripts.bb                   | 10 ---
 scripts/postinst-intercepts/update_udev_hwdb  | 18 +++---
 14 files changed, 62 insertions(+), 224 deletions(-)
 rename meta/recipes-core/systemd/{systemd-boot-native_259.5.bb => systemd-boot-native_259.10.bb} (100%)
 rename meta/recipes-core/systemd/{systemd-boot_259.5.bb => systemd-boot_259.10.bb} (100%)
 delete mode 100644 meta/recipes-core/systemd/systemd-systemctl-native_259.5.bb
 create mode 100644 meta/recipes-core/systemd/systemd-tools-native_259.10.bb
 delete mode 100644 meta/recipes-core/systemd/systemd/0001-Revert-resolve-refuse-traffic-from-the-local-host-only.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0004-tpm2-util-fix-PCR-bank-guessing-without-EFI.patch
 rename meta/recipes-core/systemd/{systemd_259.5.bb => systemd_259.10.bb} (99%)
#3 lore raw

PATCH v2 1/10 keymaps: remove obsolete systemd masking

From: Ross Burton <[email protected]>

systemd no longer has sysvinit compatibility[1], so it won't try and run the init script in this recipe that is also implemented by systemd.

Remove the explicit systemd unit masking, effectively reverting [2].

[1] oe-core d9ec9e20eeb ("systemd: Stop supporting sysvinit compatibility")
[2] oe-core 8cfba07e24 ("keymaps: mask keymap when necessary")

(cherry picked from commit 5107c33bc6d81cac5fedf865d84a3742c6437d2e)
---
 meta/recipes-bsp/keymaps/keymaps_1.0.bb | 17 -----------------
 1 file changed, 17 deletions(-)
meta/recipes-bsp/keymaps/keymaps_1.0.bb +0 -17
index b7e6ef6cb1..546ebba5dc 100644
@@ -11,13 +11,6 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
 
 INHIBIT_DEFAULT_DEPS = "1"
 
-# As the recipe doesn't inherit systemd.bbclass, we need to set this variable
-# manually to avoid unnecessary postinst/preinst generated.
-python __anonymous() {
-    if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
-        d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
-}
-
 inherit update-rc.d
 
 SRC_URI = "file://keymap.sh"
@@ -36,14 +29,4 @@ do_install () {
     fi
 }
 
-PACKAGE_WRITE_DEPS:append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','systemd-systemctl-native','',d)}"
-pkg_postinst:${PN} () {
-	if ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then
-		if [ -n "$D" ]; then
-			OPTS="--root=$D"
-		fi
-		systemctl $OPTS mask keymap.service
-	fi
-}
-
 ALLOW_EMPTY:${PN} = "1"
#4 lore raw

PATCH v2 2/10 initscripts: remove obsolete systemd masking

In reply to Jaipaul Cheernam

From: Ross Burton <[email protected]>

systemd no longer has sysvinit compatibility[1], so it won't try and run the init script in this recipe that is also implemented by systemd.

Remove the explicit systemd unit masking, effectively reverting [2].

[1] oe-core d9ec9e20eeb ("systemd: Stop supporting sysvinit compatibility")
[2] oe-core 844f897710 ("initscripts: mask initscripts from systemd")

(cherry picked from commit 2ace925cc4a23ff33a9bced602212fda06e4c5a9)
---
 .../initscripts/initscripts_1.0.bb            | 26 -------------------
 1 file changed, 26 deletions(-)
meta/recipes-core/initscripts/initscripts_1.0.bb +0 -26
index 23411b6a71..ae386a6281 100644
@@ -41,7 +41,6 @@ S = "${UNPACKDIR}"
 KERNEL_VERSION = ""
 
 DEPENDS:append = " update-rc.d-native"
-PACKAGE_WRITE_DEPS:append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
 
 PACKAGES =+ "${PN}-functions ${PN}-sushell"
 RDEPENDS:${PN} = "initd-functions \
@@ -154,32 +153,7 @@ do_install () {
 	update-rc.d -r ${D} dmesg.sh start 38 S .
 }
 
-MASKED_SCRIPTS = " \
-  banner \
-  bootmisc \
-  checkfs \
-  checkroot \
-  devpts \
-  dmesg \
-  hostname \
-  mountall \
-  mountnfs \
-  populate-volatile \
-  read-only-rootfs-hook \
-  rmnologin \
-  sysfs \
-  urandom"
-
 pkg_postinst:${PN} () {
-	if type systemctl >/dev/null 2>/dev/null; then
-		if [ -n "$D" ]; then
-			OPTS="--root=$D"
-		fi
-		for SERVICE in ${MASKED_SCRIPTS}; do
-			systemctl $OPTS mask $SERVICE.service
-		done
-	fi
-
     # Delete any old volatile cache script, as directories may have moved
     if [ -z "$D" ]; then
         rm -f "/etc/volatile.cache"
#5 lore raw

PATCH v2 3/10 modutils-initscripts: remove obsolete systemd masking

In reply to Jaipaul Cheernam

From: Ross Burton <[email protected]>

systemd no longer has sysvinit compatibility[1], so it won't try and run the init script in this recipe that is also implemented by systemd.

Remove the explicit systemd unit masking, effectively reverting [2].

[1] oe-core d9ec9e20eeb ("systemd: Stop supporting sysvinit compatibility")
[2] oe-core 8fc304a59b ("modutils-initscripts: mask modutils in case of systemd")

(cherry picked from commit d8e6b86d89ffe9b16d1a9aff423940446ece0f5b)
---
 .../modutils-initscripts/modutils-initscripts.bb       | 10 ----------
 1 file changed, 10 deletions(-)
meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb +0 -10
index fb7b09393a..89ef8bd600 100644
@@ -18,13 +18,3 @@ do_install () {
 	install -d ${D}${sysconfdir}/init.d/
 	install -m 0755 ${S}/modutils.sh ${D}${sysconfdir}/init.d/
 }
-
-PACKAGE_WRITE_DEPS:append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
-pkg_postinst:${PN} () {
-	if type systemctl >/dev/null 2>/dev/null; then
-		if [ -n "$D" ]; then
-			OPTS="--root=$D"
-		fi
-		systemctl $OPTS mask modutils.service
-	fi
-}
#6 lore raw

PATCH v2 4/10 systemd: move systemd-systemctl-native PACKAGE_WRITE_DEPS to systemd.bb

In reply to Jaipaul Cheernam

From: Ross Burton <[email protected]>

PACKAGE_WRITE_DEPS[1] is used to define package dependencies that are needed at rootfs time, for example when a postinst can use a native tool.

We allow distros to build recipes that support both systemd and sysv at the same time, and the post-install script generated by systemd.bbclass will use systemctl (via systemd-systemctl-native) at rootfs time to install the units and thus generate the required symlinks.

Presently the dependency on systemctl-native is added to recipes via systemd.bbclass but this results in all recipes that inherit that class having the dependencies. This is actually suboptimal: at rootfs time the key requirement is to install the units if and only if systemd is being used.

We can move the PACKAGE_WRITE_DEPS dependency on systemd-systemctl-native from each recipe (via the class) to systemd itself so units are installed if systemd is present, and not otherwise.

This means recipes don't depend on systemd-systemctl-native (which has non-trivial build dependencies itself), and the units are not installed in non-systemd deployments.

[1] https://docs.yoctoproject.org/ref-manual/variables.html#term-PACKAGE_WRITE_DEPS

(cherry picked from commit a96f87266d63fb5ae2aca6628c35572f83c68983)
---
 meta/classes-recipe/systemd.bbclass        | 1 -
 meta/recipes-core/systemd/systemd_259.5.bb | 4 ++++
 2 files changed, 4 insertions(+), 1 deletion(-)
meta/classes-recipe/systemd.bbclass +0 -1
index 26eaaf1922..5d8e6086b2 100644
@@ -22,7 +22,6 @@ python __anonymous() {
     # redundant init files.
     if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
         d.appendVar("DEPENDS", " systemd-systemctl-native")
-        d.appendVar("PACKAGE_WRITE_DEPS", " systemd-systemctl-native")
         d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
 }
 
meta/recipes-core/systemd/systemd_259.5.bb +4 -0
index e924884bf9..848e12e8b0 100644
@@ -22,6 +22,10 @@ REQUIRED_DISTRO_FEATURES += "systemd"
 # this and hence we can no longer support it
 CONFLICT_DISTRO_FEATURES += "sysvinit"
 
+# Ensure that the native tools are available when we're building a rootfs with systemd in,
+# so that systemctl can be used in postinst scripts
+PACKAGE_WRITE_DEPS += "systemd-systemctl-native"
+
 SRC_URI += " \
            file://touchscreen.rules \
            file://00-create-volatile.conf \
#7 lore raw

PATCH v2 5/10 classes/systemd: remove obsolete DEPENDS

In reply to Jaipaul Cheernam

From: Ross Burton <[email protected]>

Recipes that use systemd don't need systemctl at build time, so this dependency can be removed.

It was added in [1] but no rationale was given or is obvious.

[1] oe-core e9444649f4 ("systemd: Restore mask and preset targets, fix instance creation")

(cherry picked from commit 4e91abb261257abfc23acbb87f3d08ae5dbfbb5a)
---
 meta/classes-recipe/systemd.bbclass | 1 -
 1 file changed, 1 deletion(-)
meta/classes-recipe/systemd.bbclass +0 -1
index 5d8e6086b2..df464baddd 100644
@@ -21,7 +21,6 @@ python __anonymous() {
     # Inhibit update-rcd from doing any work so that systemd images don't have
     # redundant init files.
     if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
-        d.appendVar("DEPENDS", " systemd-systemctl-native")
         d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
 }
 
#8 lore raw

PATCH v2 6/10 systemd-systemctl-native: rename to systemd-tools-native

In reply to Jaipaul Cheernam

From: Ross Burton <[email protected]>

We plan on building more than just systemctl in this recipe, so rename it to -tools-.

(cherry picked from commit ff985de4df46945a92ae4ca59e54c930b7640c9a)
---
 meta/conf/distro/include/maintainers.inc                        | 2 +-
 ...-systemctl-native_259.5.bb => systemd-tools-native_259.5.bb} | 2 +-
 meta/recipes-core/systemd/systemd_259.5.bb                      | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
 rename meta/recipes-core/systemd/{systemd-systemctl-native_259.5.bb => systemd-tools-native_259.5.bb} (96%)
meta/conf/distro/include/maintainers.inc +1 -1
index 7499f7ab95..b1101172e1 100644
@@ -832,7 +832,7 @@ RECIPE_MAINTAINER:pn-systemd-bootconf = "Chen Qi <[email protected]>"
 RECIPE_MAINTAINER:pn-systemd-conf = "Chen Qi <[email protected]>"
 RECIPE_MAINTAINER:pn-systemd-machine-units = "Chen Qi <[email protected]>"
 RECIPE_MAINTAINER:pn-systemd-serialgetty = "Chen Qi <[email protected]>"
-RECIPE_MAINTAINER:pn-systemd-systemctl-native = "Chen Qi <[email protected]>"
+RECIPE_MAINTAINER:pn-systemd-tools-native = "Chen Qi <[email protected]>"
 RECIPE_MAINTAINER:pn-systemtap = "Victor Kamensky <[email protected]>"
 RECIPE_MAINTAINER:pn-systemtap-native = "Victor Kamensky <[email protected]>"
 RECIPE_MAINTAINER:pn-sysvinit = "Ross Burton <[email protected]>"
meta/recipes-core/systemd/systemd-tools-native_259.5.bb renamed from meta/recipes-core/systemd/systemd-systemctl-native_259.5.bb +1 -1
similarity index 96%
rename from meta/recipes-core/systemd/systemd-systemctl-native_259.5.bb
rename to meta/recipes-core/systemd/systemd-tools-native_259.5.bb
index 3c0dcd35a3..5b29babdc7 100644
@@ -1,6 +1,6 @@
 FILESEXTRAPATHS:prepend := "${THISDIR}/systemd:"
 
-SUMMARY = "Systemctl executable from systemd"
+SUMMARY = "native tools from systemd"
 
 require systemd.inc
 
meta/recipes-core/systemd/systemd_259.5.bb +1 -1
index 848e12e8b0..69f4ee4fee 100644
@@ -24,7 +24,7 @@ CONFLICT_DISTRO_FEATURES += "sysvinit"
 
 # Ensure that the native tools are available when we're building a rootfs with systemd in,
 # so that systemctl can be used in postinst scripts
-PACKAGE_WRITE_DEPS += "systemd-systemctl-native"
+PACKAGE_WRITE_DEPS += "systemd-tools-native"
 
 SRC_URI += " \
            file://touchscreen.rules \
#9 lore raw

Re: [OE-core] [wrynose][PATCH v2 06/10] systemd-systemctl-native: rename to systemd-tools-native

Quoted 10 lines · Jaipaul Cheernam via openembedded-core

From: Ross Burton <[email protected]>

We plan on building more than just systemctl in this recipe, so rename it to -tools-.

(cherry picked from commit ff985de4df46945a92ae4ca59e54c930b7640c9a)
Quoted 6 lines
---
 meta/conf/distro/include/maintainers.inc                        | 2 +-
 ...-systemctl-native_259.5.bb => systemd-tools-native_259.5.bb} | 2 +-
 meta/recipes-core/systemd/systemd_259.5.bb                      | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
 rename meta/recipes-core/systemd/{systemd-systemctl-native_259.5.bb => systemd-tools-native_259.5.bb} (96%)

Hi Jaipaul,

This one is definitely not stable. A user might have a bbappends on systemd-systemctl-native and this would break their code.

How about we backport the needed(*) master systemd-tools-native updates to the wrynose systemd-systemctl-native?

*: e.g. I don't think "reduce dependencies, add comments" is needed or
acceptable for stable.

Regards,

Signature · 2 lines
Yoann Congal
Smile ECS
#10 lore raw

PATCH v2 7/10 systemd-tools-native: reduce dependencies, add comments

In reply to Jaipaul Cheernam

From: Ross Burton <[email protected]>

Pass "--auto-features disabled" to disable all optional dependencies by default, and remove build dependencies that are not needed.

Reorganise the recipe to make logical sense and so that the SUMMARY isn't overwritten by systemd.inc, and add comments.

(cherry picked from commit 717badf77f4a1f72d885f285a7326a485f9938fe)

Note: kept our MESON_TARGET ":executable", -Dpam=disabled and the systemd-sysv-install do_install

---
 .../systemd/systemd-tools-native_259.5.bb      | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
meta/recipes-core/systemd/systemd-tools-native_259.5.bb +13 -5
index 5b29babdc7..89b5220e3e 100644
@@ -1,16 +1,21 @@
 FILESEXTRAPATHS:prepend := "${THISDIR}/systemd:"
 
-SUMMARY = "native tools from systemd"
-
 require systemd.inc
 
-DEPENDS = "gperf-native libcap-native util-linux-native python3-jinja2-native"
+SUMMARY = "native tools from systemd"
+
+# We don't actually need jinja to generate code, but it's checked for at configure time
+DEPENDS = "gperf-native python3-jinja2-native"
 
 inherit pkgconfig meson native
 
-MESON_TARGET = "systemctl:executable"
-MESON_INSTALL_TAGS = "systemctl"
+# Disable everything that is auto-detected by default
+EXTRA_OEMESON += "--auto-features disabled"
+
+# Link systemctl statically
 EXTRA_OEMESON += "-Dlink-systemctl-shared=false"
+
+# Ensure unused build paths are not in the binary
 EXTRA_OEMESON += "-Dsysvinit-path= -Dsysvrcnd-path="
 EXTRA_OEMESON += "-Dpam=disabled"
 
@@ -19,6 +24,9 @@ EXTRA_OEMESON += "-Dpam=disabled"
 # More details are here https://github.com/systemd/systemd/issues/35897#issuecomment-2665405887
 EXTRA_OEMESON += "--sysconfdir ${sysconfdir_native}"
 
+MESON_TARGET = "systemctl:executable"
+MESON_INSTALL_TAGS = "systemctl"
+
 do_install:append() {
 	# Install systemd-sysv-install in /usr/bin rather than /usr/lib/systemd
 	# (where it is normally installed) so systemctl can find it in $PATH.
#11 lore raw

PATCH v2 8/10 systemd-tools-native: add systemd-hwdb

In reply to Jaipaul Cheernam

From: Ross Burton <[email protected]>

Also build systemd-hwdb so that we can generate hwdb.bin at rootfs time with native code instead of using qemu-user. I've verified that the hwdb.bin format is word-size and endian agnosic, so we don't need to use qemu.

Add a patch so that source file names in the hwdb.bin have the rootfs prefix stripped, so that build paths don't appear in the final image.

This does mean we have to hardcode prefix=/usr sysconfdir=/etc as the target paths, but systemd effectively mandates these so hopefully this is not a problem in the real world.

Partially based on work by Daniel Turull.

(cherry picked from commit 2a7c2ddd739db59bc14d781aa919bdd4724b365e)

Note: kept ":executable" and our systemd-sysv-install do_install; keeping the strip-the-root patch since we're still on 259.5, dropped in the 259.10 uplift where it's already upstream

---
 .../systemd/systemd-tools-native_259.5.bb     | 24 +++++++----
 ...oot-from-filenames-when-generating-h.patch | 40 +++++++++++++++++++
 2 files changed, 57 insertions(+), 7 deletions(-)
 create mode 100644 meta/recipes-core/systemd/systemd/0001-hwdb-strip-the-root-from-filenames-when-generating-h.patch
meta/recipes-core/systemd/systemd-tools-native_259.5.bb +17 -7
index 89b5220e3e..d8d0eae009 100644
@@ -4,6 +4,8 @@ require systemd.inc
 
 SUMMARY = "native tools from systemd"
 
+SRC_URI += "file://0001-hwdb-strip-the-root-from-filenames-when-generating-h.patch"
+
 # We don't actually need jinja to generate code, but it's checked for at configure time
 DEPENDS = "gperf-native python3-jinja2-native"
 
@@ -12,19 +14,23 @@ inherit pkgconfig meson native
 # Disable everything that is auto-detected by default
 EXTRA_OEMESON += "--auto-features disabled"
 
-# Link systemctl statically
-EXTRA_OEMESON += "-Dlink-systemctl-shared=false"
+# Link the binaries statically as we don't install libsystemd-shared.so
+EXTRA_OEMESON += "-Dlink-systemctl-shared=false -Dlink-udev-shared=false"
 
 # Ensure unused build paths are not in the binary
 EXTRA_OEMESON += "-Dsysvinit-path= -Dsysvrcnd-path="
 EXTRA_OEMESON += "-Dpam=disabled"
 
-# Systemctl is supposed to operate on target, but the target sysroot is not
-# determined at run-time, but rather set during configure
-# More details are here https://github.com/systemd/systemd/issues/35897#issuecomment-2665405887
-EXTRA_OEMESON += "--sysconfdir ${sysconfdir_native}"
+# Target-absolute paths that satisfy both tools from one meson configure:
+#  - systemd-hwdb needs prefix=/usr so the compiled-in UDEVLIBEXECDIR
+#    (/usr/lib/udev) matches the target rootfs layout, letting
+#    "update --root $D --usr" find hwdb.d sources and write hwdb.bin there.
+#  - systemctl needs sysconfdir=/etc; it operates on the target rootfs but the
+#    sysroot is fixed at configure time rather than run time.
+#    See https://github.com/systemd/systemd/issues/35897#issuecomment-2665405887
+EXTRA_OEMESON += "--prefix /usr --sysconfdir /etc"
 
-MESON_TARGET = "systemctl:executable"
+MESON_TARGET = "systemctl:executable systemd-hwdb:executable"
 MESON_INSTALL_TAGS = "systemctl"
 
 do_install:append() {
@@ -34,4 +40,8 @@ do_install:append() {
 	# with version 259 of systemd and then this, and everything that was
 	# added along with it, should be reverted.
 	install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${bindir}/systemd-sysv-install
+
+	# Can't install this with a tag "hwdb" also tries to install the hwdb
+	# itself, and there's no separate tag for systemd-hwdb.
+	install ${B}/systemd-hwdb ${D}${bindir}/systemd-hwdb
 }
meta/recipes-core/systemd/systemd/0001-hwdb-strip-the-root-from-filenames-when-generating-h.patch new file +40 -0
new file mode 100644
index 0000000000..f11199c553
@@ -0,0 +1,40 @@
+From 0031715c560e8138cc320f017a0a2c7160b1f7fe Mon Sep 17 00:00:00 2001
+From: Ross Burton <[email protected]>
+Date: Fri, 17 Jul 2026 17:25:31 +0100
+Subject: [PATCH] hwdb: strip the root from filenames when generating hwdb.bin
+
+The modern hwdb.bin format contains the filenames of the input data that
+makes up the database.  This is useful but in offline builds where
+--root is used, the filenames are the full build paths including the
+specified root.  This introduces build paths and thus information
+leakage and non-reproducible data.
+
+Solve this by stripping the root prefix off the original path when
+passing to import_file.
+
+Upstream-Status: Backport [https://github.com/systemd/systemd/pull/43062]
+Signed-off-by: Ross Burton <[email protected]>
+---
+ src/shared/hwdb-util.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/shared/hwdb-util.c b/src/shared/hwdb-util.c
+index b42681a289..5386b4e9f4 100644
+--- a/src/shared/hwdb-util.c
++++ b/src/shared/hwdb-util.c
+@@ -632,9 +632,11 @@ int hwdb_update(const char *root, const char *hwdb_bin_dir, bool strict, bool co
+ 
+         FOREACH_ARRAY(i, files, n_files) {
+                 ConfFile *c = *i;
++                char *path_in_root;
+ 
+                 log_debug("Reading file \"%s\" -> \"%s\"", c->original_path, c->resolved_path);
+-                RET_GATHER(ret, import_file(trie, c->fd, c->original_path, file_priority++, compat));
++                path_in_root = path_startswith_full(c->original_path, empty_to_root(root), PATH_STARTSWITH_RETURN_LEADING_SLASH);
++                RET_GATHER(ret, import_file(trie, c->fd, path_in_root, file_priority++, compat));
+         }
+ 
+         strbuf_complete(trie->strings);
+-- 
+2.43.0
+
#12 lore raw

PATCH v2 9/10 systemd: no need to use qemu for hwdb update

In reply to Jaipaul Cheernam

From: Ross Burton <[email protected]>

Now that systemd-tools-native gives us a native systemd-hwdb, and the database format is known to be hardware-agnostic, we can simply run systemd-hwdb directly instead of running it inside qemu-user if we're using systemd instead of eudev.

(cherry picked from commit 7807da168dc097081623b1609fb818e32ac54ae8)
---
 meta/recipes-core/systemd/systemd_259.5.bb   |  6 ++----
 scripts/postinst-intercepts/update_udev_hwdb | 18 +++++++++---------
 2 files changed, 11 insertions(+), 13 deletions(-)
meta/recipes-core/systemd/systemd_259.5.bb +2 -4
index 69f4ee4fee..32fc04352f 100644
@@ -915,12 +915,10 @@ pkg_prerm:${PN}:libc-glibc () {
 	fi
 }
 
-PACKAGE_WRITE_DEPS += "qemuwrapper-cross"
-
 pkg_postinst:udev-hwdb () {
 	if test -n "$D"; then
-		$INTERCEPT_DIR/postinst_intercept update_udev_hwdb ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX} \
-			rootlibexecdir="${nonarch_libdir}" PREFERRED_PROVIDER_udev="${PREFERRED_PROVIDER_udev}" base_bindir="${base_bindir}"
+		$INTERCEPT_DIR/postinst_intercept update_udev_hwdb ${PKG} mlprefix=${MLPREFIX} \
+			PREFERRED_PROVIDER_udev="${PREFERRED_PROVIDER_udev}"
 	else
 		systemd-hwdb update
 	fi
scripts/postinst-intercepts/update_udev_hwdb +9 -9
index 8b3f5de791..5b84adfe87 100644
@@ -7,19 +7,19 @@ set -e
 
 case "${PREFERRED_PROVIDER_udev}" in
 	systemd)
-		UDEV_EXTRA_ARGS="--usr"
-		UDEVLIBDIR="${rootlibexecdir}"
-		UDEVADM="${base_bindir}/udevadm"
+		echo Updating HWDB with native systemd-hwdb...
+		systemd-hwdb update --root $D --usr
 		;;
 
 	*)
-		UDEV_EXTRA_ARGS=""
+		echo Updating HWDB with udevadm...
+
 		UDEVLIBDIR="${sysconfdir}"
 		UDEVADM="${bindir}/udevadm"
+
+		rm -f $D${UDEVLIBDIR}/udev/hwdb.bin
+		PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D${UDEVADM} hwdb --update --root $D ||
+			PSEUDO_UNLOAD=1 qemuwrapper -L $D $D${UDEVADM} hwdb --update --root $D
+		chown root:root $D${UDEVLIBDIR}/udev/hwdb.bin
 		;;
 esac
-
-rm -f $D${UDEVLIBDIR}/udev/hwdb.bin
-PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D${UDEVADM} hwdb --update --root $D ${UDEV_EXTRA_ARGS} ||
-	PSEUDO_UNLOAD=1 qemuwrapper -L $D $D${UDEVADM} hwdb --update --root $D ${UDEV_EXTRA_ARGS}
-chown root:root $D${UDEVLIBDIR}/udev/hwdb.bin
#13 lore raw

PATCH v2 10/10 systemd: Upgrade 259.5 -> 259.10

In reply to Jaipaul Cheernam

* Stable v259 release uplift
* CompareLog: https://github.com/systemd/systemd/compare/v259.5...v259.10
* Drop below patches which are part of upstream 0001-Revert-resolve-refuse-traffic-from-the-local-host-only.patch 0004-tpm2-util-fix-PCR-bank-guessing-without-EFI.patch
* Also drop 0001-hwdb-strip-the-root-from-filenames-when-generating-h.patch:
it was added for systemd-tools-native on 259.5, but the upstream fix (a9397de9d2) is already part of v259.8+, so it is redundant on 259.10.

---
 ...259.5.bb => systemd-boot-native_259.10.bb} |  0
 ...d-boot_259.5.bb => systemd-boot_259.10.bb} |  0
 ...59.5.bb => systemd-tools-native_259.10.bb} |  2 -
 meta/recipes-core/systemd/systemd.inc         |  2 +-
 ...use-traffic-from-the-local-host-only.patch | 61 ------------------
 ...oot-from-filenames-when-generating-h.patch | 40 ------------
 ...il-fix-PCR-bank-guessing-without-EFI.patch | 62 -------------------
 .../{systemd_259.5.bb => systemd_259.10.bb}   |  2 -
 8 files changed, 1 insertion(+), 168 deletions(-)
 rename meta/recipes-core/systemd/{systemd-boot-native_259.5.bb => systemd-boot-native_259.10.bb} (100%)
 rename meta/recipes-core/systemd/{systemd-boot_259.5.bb => systemd-boot_259.10.bb} (100%)
 rename meta/recipes-core/systemd/{systemd-tools-native_259.5.bb => systemd-tools-native_259.10.bb} (95%)
 delete mode 100644 meta/recipes-core/systemd/systemd/0001-Revert-resolve-refuse-traffic-from-the-local-host-only.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0001-hwdb-strip-the-root-from-filenames-when-generating-h.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0004-tpm2-util-fix-PCR-bank-guessing-without-EFI.patch
 rename meta/recipes-core/systemd/{systemd_259.5.bb => systemd_259.10.bb} (99%)
meta/recipes-core/systemd/systemd-boot-native_259.10.bb renamed from meta/recipes-core/systemd/systemd-boot-native_259.5.bb +0 -0
similarity index 100%
rename from meta/recipes-core/systemd/systemd-boot-native_259.5.bb
rename to meta/recipes-core/systemd/systemd-boot-native_259.10.bb
meta/recipes-core/systemd/systemd-boot_259.10.bb renamed from meta/recipes-core/systemd/systemd-boot_259.5.bb +0 -0
similarity index 100%
rename from meta/recipes-core/systemd/systemd-boot_259.5.bb
rename to meta/recipes-core/systemd/systemd-boot_259.10.bb
meta/recipes-core/systemd/systemd-tools-native_259.10.bb renamed from meta/recipes-core/systemd/systemd-tools-native_259.5.bb +0 -2
similarity index 95%
rename from meta/recipes-core/systemd/systemd-tools-native_259.5.bb
rename to meta/recipes-core/systemd/systemd-tools-native_259.10.bb
index d8d0eae009..81d37c5b75 100644
@@ -4,8 +4,6 @@ require systemd.inc
 
 SUMMARY = "native tools from systemd"
 
-SRC_URI += "file://0001-hwdb-strip-the-root-from-filenames-when-generating-h.patch"
-
 # We don't actually need jinja to generate code, but it's checked for at configure time
 DEPENDS = "gperf-native python3-jinja2-native"
 
meta/recipes-core/systemd/systemd.inc +1 -1
index bbcacf9deb..ae3a034ef3 100644
@@ -15,7 +15,7 @@ LICENSE:libsystemd = "LGPL-2.1-or-later"
 LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=c09786363500a9acc29b147e6e72d2c6 \
                     file://LICENSE.LGPL2.1;md5=be0aaf4a380f73f7e00b420a007368f2"
 
-SRCREV = "b3d8fc43e9cb531d958c17ef2cd93b374bc14e8a"
+SRCREV = "cc6062f23cb595c172d9a007ed99d925852bfd60"
 SRCBRANCH = "v259-stable"
 SRC_URI = "git://github.com/systemd/systemd.git;protocol=https;branch=${SRCBRANCH};tag=v${PV}"
 
meta/recipes-core/systemd/systemd/0001-Revert-resolve-refuse-traffic-from-the-local-host-only.patch deleted +0 -61

61 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0001-hwdb-strip-the-root-from-filenames-when-generating-h.patch deleted +0 -40
deleted file mode 100644
index f11199c553..0000000000
@@ -1,40 +0,0 @@
-From 0031715c560e8138cc320f017a0a2c7160b1f7fe Mon Sep 17 00:00:00 2001
-From: Ross Burton <[email protected]>
-Date: Fri, 17 Jul 2026 17:25:31 +0100
-Subject: [PATCH] hwdb: strip the root from filenames when generating hwdb.bin
-
-The modern hwdb.bin format contains the filenames of the input data that
-makes up the database.  This is useful but in offline builds where
---root is used, the filenames are the full build paths including the
-specified root.  This introduces build paths and thus information
-leakage and non-reproducible data.
-
-Solve this by stripping the root prefix off the original path when
-passing to import_file.
-
-Upstream-Status: Backport [https://github.com/systemd/systemd/pull/43062]
-Signed-off-by: Ross Burton <[email protected]>
----
- src/shared/hwdb-util.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/src/shared/hwdb-util.c b/src/shared/hwdb-util.c
-index b42681a289..5386b4e9f4 100644
---- a/src/shared/hwdb-util.c
-+++ b/src/shared/hwdb-util.c
-@@ -632,9 +632,11 @@ int hwdb_update(const char *root, const char *hwdb_bin_dir, bool strict, bool co
- 
-         FOREACH_ARRAY(i, files, n_files) {
-                 ConfFile *c = *i;
-+                char *path_in_root;
- 
-                 log_debug("Reading file \"%s\" -> \"%s\"", c->original_path, c->resolved_path);
--                RET_GATHER(ret, import_file(trie, c->fd, c->original_path, file_priority++, compat));
-+                path_in_root = path_startswith_full(c->original_path, empty_to_root(root), PATH_STARTSWITH_RETURN_LEADING_SLASH);
-+                RET_GATHER(ret, import_file(trie, c->fd, path_in_root, file_priority++, compat));
-         }
- 
-         strbuf_complete(trie->strings);
--- 
-2.43.0
-
meta/recipes-core/systemd/systemd/0004-tpm2-util-fix-PCR-bank-guessing-without-EFI.patch deleted +0 -62

62 lines not on this page · raw message

meta/recipes-core/systemd/systemd_259.10.bb renamed from meta/recipes-core/systemd/systemd_259.5.bb +0 -2
similarity index 99%
rename from meta/recipes-core/systemd/systemd_259.5.bb
rename to meta/recipes-core/systemd/systemd_259.10.bb
index 32fc04352f..95032bf13f 100644
@@ -38,8 +38,6 @@ SRC_URI += " \
            file://0003-Do-not-create-var-log-README.patch \
            file://0001-meson-use-libfido2_cflags-dependency.patch \
            file://0018-shared-fdset-add-detailed-debug-logging-to-fdset_new.patch \
-           file://0004-tpm2-util-fix-PCR-bank-guessing-without-EFI.patch \
-           file://0001-Revert-resolve-refuse-traffic-from-the-local-host-only.patch \
            "
 
 PAM_PLUGINS = " \