Skip to contentSkip to conversation

Fix some configuration options for systemd

PATCH Superseded [email protected] 2 participants 6 messages Jun 14, 2023

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover Fix some configuration options for systemd

From: Randolph Sapp <[email protected]>

Fixing up some systemd stuff. Using the auto getty generator built into systemd instead of the external oe-core getty service.

Also drop the duplicate (now invalid) useradd entries in the systemd append.

This should be all that's required to squelch the endless serial getty start/stop logs for systemd. There's probably some work required for sysvinit as well. Should just be setting SERIAL_CONSOLES_CHECK = $SERIAL_CONSOLES or something along those lines if the sysvinit getty service even cares.

Still not sure how I feel about having inactive serial console definitions in a bsp layer but if we don't define it at all then oe-core will just blindly assume we wanted a console on ttyS0. That's especially problematic for the init systems unable to generate getty scripts automatically. SERIAL_CONSOLES_CHECK at least fixes the sysvinit behavior.

This revision also drops some of the bite from the previous version. We will not drop the sysvinit distro feature conditionally because the other image targets using sysvinit do not currently signal that they need sysvinit in a way that works nicely with this config.

Randolph Sapp (4):
arago.conf: make things more readable and fix the virtuals
systemd: drop the useradd params
arago.conf: add serial-getty-generator to systemd
systemd: move packageconfig appends to distro config

 meta-arago-distro/conf/distro/arago.conf           | 14 +++++++-------
 .../recipes-core/systemd/systemd_%.bbappend        |  4 ----
 2 files changed, 7 insertions(+), 11 deletions(-)
Signature · 1 line
2.41.0
#1 lore raw

PATCH v2 1/4 arago.conf: make things more readable and fix the virtuals

From: Randolph Sapp <[email protected]>

Make things more readable and reliable by useing the built in boolean check instead of python's type casting. Drop the array indexing in favor of a more direct if else statememnt.

Also fix the virtual provider for login manager. There should only be 1 login provider and it should be shadow-base for systemd *or* busybox for sysVinit systemd.

---
 meta-arago-distro/conf/distro/arago.conf | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
meta-arago-distro/conf/distro/arago.conf +6 -6
index 59ee9926..2606ca39 100644
@@ -59,13 +59,13 @@ DISTRO_FEATURES_FILTER_NATIVESDK:append = " opencl opencv openmp"
 
 # Set global runtime providers for major components
 ARAGO_SYSVINIT ?= "0"
-VIRTUAL-RUNTIME_dev_manager = "${@["udev", "systemd"][bool(d.getVar("ARAGO_SYSVINIT"))]}"
-VIRTUAL-RUNTIME_init_manager = "${@["sysvinit", "systemd"][bool(d.getVar("ARAGO_SYSVINIT"))]}"
-VIRTUAL-RUNTIME_initscripts = "${@["initscripts", "systemd-compat-units"][bool(d.getVar("ARAGO_SYSVINIT"))]}"
-VIRTUAL-RUNTIME_initramfs = "${@["sysvinit-initramfs", "systemd-initramfs"][bool(d.getVar("ARAGO_SYSVINIT"))]}"
-VIRTUAL-RUNTIME_login_manager = "busybox shadow"
+VIRTUAL-RUNTIME_dev_manager = "${@'udev' if oe.types.boolean(d.getVar('ARAGO_SYSVINIT')) else 'systemd'}"
+VIRTUAL-RUNTIME_init_manager = "${@'sysvinit' if oe.types.boolean(d.getVar('ARAGO_SYSVINIT')) else 'systemd'}"
+VIRTUAL-RUNTIME_initscripts = "${@'initscripts' if oe.types.boolean(d.getVar('ARAGO_SYSVINIT')) else 'systemd-compat-units'}"
+VIRTUAL-RUNTIME_initramfs = "${@'sysvinit-initramfs' if oe.types.boolean(d.getVar('ARAGO_SYSVINIT')) else 'systemd-initramfs'}"
+VIRTUAL-RUNTIME_login_manager = "${@'busybox' if oe.types.boolean(d.getVar('ARAGO_SYSVINIT')) else 'shadow-base'}"
 
-DISTRO_FEATURES:append = "${@[""," systemd"][bool(d.getVar("ARAGO_SYSVINIT"))]}"
+DISTRO_FEATURES:append = " ${@'' if oe.types.boolean(d.getVar('ARAGO_SYSVINIT')) else ' systemd'}"
 
 # Distro-specific package configuration
 PACKAGECONFIG:append:pn-systemd = " coredump"
Signature · 1 line
2.41.0
Reviewed-by on v2 1/4
#2 lore raw

Re: [meta-arago][master/kirkstone][PATCHv2 1/4] arago.conf: make things more readable and fix the virtuals

Quoted 3 lines · On 6/14/23 11:38 AM, [email protected] wrote:

From: Randolph Sapp <[email protected]>

Make things more readable and reliable by useing the built in boolean

s/useing/using

Quoted 2 lines

check instead of python's type casting. Drop the array indexing in favor of a more direct if else statememnt.

s/statememnt/statement

Otherwise for the whole series LGTM,

Quoted 34 lines

Also fix the virtual provider for login manager. There should only be 1 login provider and it should be shadow-base for systemd *or* busybox for sysVinit systemd.

---
  meta-arago-distro/conf/distro/arago.conf | 12 ++++++------
  1 file changed, 6 insertions(+), 6 deletions(-)
meta-arago-distro/conf/distro/arago.conf +6 -6
index 59ee9926..2606ca39 100644
@@ -59,13 +59,13 @@ DISTRO_FEATURES_FILTER_NATIVESDK:append = " opencl opencv openmp"
 
  # Set global runtime providers for major components
  ARAGO_SYSVINIT ?= "0"
-VIRTUAL-RUNTIME_dev_manager = "${@["udev", "systemd"][bool(d.getVar("ARAGO_SYSVINIT"))]}"
-VIRTUAL-RUNTIME_init_manager = "${@["sysvinit", "systemd"][bool(d.getVar("ARAGO_SYSVINIT"))]}"
-VIRTUAL-RUNTIME_initscripts = "${@["initscripts", "systemd-compat-units"][bool(d.getVar("ARAGO_SYSVINIT"))]}"
-VIRTUAL-RUNTIME_initramfs = "${@["sysvinit-initramfs", "systemd-initramfs"][bool(d.getVar("ARAGO_SYSVINIT"))]}"
-VIRTUAL-RUNTIME_login_manager = "busybox shadow"
+VIRTUAL-RUNTIME_dev_manager = "${@'udev' if oe.types.boolean(d.getVar('ARAGO_SYSVINIT')) else 'systemd'}"
+VIRTUAL-RUNTIME_init_manager = "${@'sysvinit' if oe.types.boolean(d.getVar('ARAGO_SYSVINIT')) else 'systemd'}"
+VIRTUAL-RUNTIME_initscripts = "${@'initscripts' if oe.types.boolean(d.getVar('ARAGO_SYSVINIT')) else 'systemd-compat-units'}"
+VIRTUAL-RUNTIME_initramfs = "${@'sysvinit-initramfs' if oe.types.boolean(d.getVar('ARAGO_SYSVINIT')) else 'systemd-initramfs'}"
+VIRTUAL-RUNTIME_login_manager = "${@'busybox' if oe.types.boolean(d.getVar('ARAGO_SYSVINIT')) else 'shadow-base'}"
 
-DISTRO_FEATURES:append = "${@[""," systemd"][bool(d.getVar("ARAGO_SYSVINIT"))]}"
+DISTRO_FEATURES:append = " ${@'' if oe.types.boolean(d.getVar('ARAGO_SYSVINIT')) else ' systemd'}"
 
  # Distro-specific package configuration
  PACKAGECONFIG:append:pn-systemd = " coredump"
#3 lore raw

PATCH v2 2/4 systemd: drop the useradd params

In reply to [email protected]

From: Randolph Sapp <[email protected]>

This currently points to an invalid shell (bin -> sbin) and OE-Core has been carrying the equivalent patch since: d18957925c (systemd: Create missing sysusers offline, 2016-05-17)

---
 meta-arago-distro/recipes-core/systemd/systemd_%.bbappend | 2 --
 1 file changed, 2 deletions(-)
meta-arago-distro/recipes-core/systemd/systemd_%.bbappend +0 -2
index 9e49ac69..a38ca124 100644
@@ -3,8 +3,6 @@ PR:append = ".arago6"
 FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
 
 PACKAGECONFIG:append = " networkd resolved"
-USERADD_PARAM:${PN} += "--system -d / -M --shell /bin/nologin systemd-network;"
-USERADD_PARAM:${PN} += "--system -d / -M --shell /bin/nologin systemd-resolve;"
 
 SRC_URI:append = " \
     file://local.rules \
Signature · 1 line
2.41.0
#4 lore raw

PATCH v2 3/4 arago.conf: add serial-getty-generator to systemd

In reply to [email protected]

From: Randolph Sapp <[email protected]>

Use systemd's built-in getty generator instead of the OE-Core variant.

---
 meta-arago-distro/conf/distro/arago.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-arago-distro/conf/distro/arago.conf +1 -1
index 2606ca39..fcbb3f74 100644
@@ -68,7 +68,7 @@ VIRTUAL-RUNTIME_login_manager = "${@'busybox' if oe.types.boolean(d.getVar('ARAG
 DISTRO_FEATURES:append = " ${@'' if oe.types.boolean(d.getVar('ARAGO_SYSVINIT')) else ' systemd'}"
 
 # Distro-specific package configuration
-PACKAGECONFIG:append:pn-systemd = " coredump"
+PACKAGECONFIG:append:pn-systemd = " coredump serial-getty-generator"
 
 # Configure Qt5 flags (GLES is still required for qtdeclarative and qtwebkit)
 PACKAGECONFIG_GL:pn-qtbase = "gles2 linuxfb"
Signature · 1 line
2.41.0
#5 lore raw

PATCH v2 4/4 systemd: move packageconfig appends to distro config

In reply to [email protected]

From: Randolph Sapp <[email protected]>

Move the systemd PACKAGECONFIG append strings to the distro config.

---
 meta-arago-distro/conf/distro/arago.conf                  | 2 +-
 meta-arago-distro/recipes-core/systemd/systemd_%.bbappend | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)
meta-arago-distro/conf/distro/arago.conf +1 -1
index fcbb3f74..d0640c5a 100644
@@ -68,7 +68,7 @@ VIRTUAL-RUNTIME_login_manager = "${@'busybox' if oe.types.boolean(d.getVar('ARAG
 DISTRO_FEATURES:append = " ${@'' if oe.types.boolean(d.getVar('ARAGO_SYSVINIT')) else ' systemd'}"
 
 # Distro-specific package configuration
-PACKAGECONFIG:append:pn-systemd = " coredump serial-getty-generator"
+PACKAGECONFIG:append:pn-systemd = " coredump networkd resolved serial-getty-generator"
 
 # Configure Qt5 flags (GLES is still required for qtdeclarative and qtwebkit)
 PACKAGECONFIG_GL:pn-qtbase = "gles2 linuxfb"
meta-arago-distro/recipes-core/systemd/systemd_%.bbappend +0 -2
index a38ca124..3de94336 100644
@@ -2,8 +2,6 @@ PR:append = ".arago6"
 
 FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
 
-PACKAGECONFIG:append = " networkd resolved"
-
 SRC_URI:append = " \
     file://local.rules \
     file://usb1-rules.sh \
Signature · 1 line
2.41.0