From 5c96ae3ecdb4e654161e5dd9a747ae3abe22c543 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Thu, 3 Jul 2025 10:27:26 +0200 Subject: [PATCH] base-files: fix sysctl config installation on systemd-based systems Systemd-based systems do not use the global /etc/sysctl.conf file. Instead, they read configuration from individual files under /etc/sysctl.d. This change installs our sysctl settings as /etc/sysctl.d/console.conf when systemd is enabled. For systems that do not use systemd, the configuration file is still installed at /etc/sysctl.conf. The CONFFILES entry is also updated. Signed-off-by: Javier Viguera --- .../recipes-core/base-files/base-files/sysctl.conf | 1 - .../base-files/base-files_3.0.14.bbappend | 11 ++++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/meta-digi-dey/recipes-core/base-files/base-files/sysctl.conf b/meta-digi-dey/recipes-core/base-files/base-files/sysctl.conf index f2466a457..6f98ffd98 100644 --- a/meta-digi-dey/recipes-core/base-files/base-files/sysctl.conf +++ b/meta-digi-dey/recipes-core/base-files/base-files/sysctl.conf @@ -1,3 +1,2 @@ # Console log-level kernel.printk = 4 4 1 7 - diff --git a/meta-digi-dey/recipes-core/base-files/base-files_3.0.14.bbappend b/meta-digi-dey/recipes-core/base-files/base-files_3.0.14.bbappend index 6c165d9e9..a8c58b6c5 100644 --- a/meta-digi-dey/recipes-core/base-files/base-files_3.0.14.bbappend +++ b/meta-digi-dey/recipes-core/base-files/base-files_3.0.14.bbappend @@ -1,4 +1,4 @@ -# Copyright (C) 2013-2024, Digi International Inc. +# Copyright (C) 2013-2025, Digi International Inc. FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" @@ -7,7 +7,12 @@ SRC_URI:append:dey = " \ " do_install:append:dey() { - install -m 0644 ${WORKDIR}/sysctl.conf ${D}${sysconfdir}/ + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then + install -d ${D}${sysconfdir}/sysctl.d + install -m 0644 ${WORKDIR}/sysctl.conf ${D}${sysconfdir}/sysctl.d/console.conf + else + install -m 0644 ${WORKDIR}/sysctl.conf ${D}${sysconfdir}/ + fi } pkg_postinst_ontarget:${PN}() { @@ -56,4 +61,4 @@ pkg_postinst_ontarget:${PN}() { inherit ${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", "remove-pkg-postinst-ontarget", "", d)} -CONFFILES:${PN}:dey += "${sysconfdir}/sysctl.conf" +CONFFILES:${PN}:dey += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', '${sysconfdir}/sysctl.conf', d)}"