From: Louis Rannou <lrannou@baylibre.com>
To: openembedded-core@lists.openembedded.org
Cc: Louis Rannou <lrannou@baylibre.com>, anuj.mittal@intel.com
Subject: [PATCH 2/3] systemd: replace the sysusers.d basic configuration
Date: Thu, 15 Jun 2023 13:43:54 +0200 [thread overview]
Message-ID: <20230613-sysusersd-v1-2-eaddf3179773@baylibre.com> (raw)
In-Reply-To: <20230613-sysusersd-v1-0-eaddf3179773@baylibre.com>
The default sysusers basic.conf.in file sets the root home directory to `/root`
and does not permit its configuration. Replace the file delivered by systemd so
the root home directory matches the `ROOT_HOME` variable.
Signed-off-by: Louis Rannou <lrannou@baylibre.com>
---
meta/recipes-core/systemd/systemd/basic.conf.in | 40 +++++++++++++++++++++++++
meta/recipes-core/systemd/systemd_253.3.bb | 5 ++++
2 files changed, 45 insertions(+)
diff --git a/meta/recipes-core/systemd/systemd/basic.conf.in b/meta/recipes-core/systemd/systemd/basic.conf.in
new file mode 100644
index 0000000000..fac288f7fa
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/basic.conf.in
@@ -0,0 +1,40 @@
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+
+# The superuser
+u root 0 "root" :ROOT_HOME:
+
+# The nobody user/group for NFS file systems
+g {{NOBODY_GROUP_NAME}} 65534 - -
+u {{NOBODY_USER_NAME }} 65534:65534 "Nobody" -
+
+# Administrator group: can *see* more than normal users
+g adm {{ADM_GID }} - -
+
+# Administrator group: can *do* more than normal users
+g wheel {{WHEEL_GID }} - -
+
+# Access to shared database of users on the system
+g utmp {{UTMP_GID }} - -
+
+# Physical and virtual hardware access groups
+g audio {{AUDIO_GID }} - -
+g cdrom {{CDROM_GID }} - -
+g dialout {{DIALOUT_GID}} - -
+g disk {{DISK_GID }} - -
+g input {{INPUT_GID }} - -
+g kmem {{KMEM_GID }} - -
+g kvm {{KVM_GID }} - -
+g lp {{LP_GID }} - -
+g render {{RENDER_GID }} - -
+g sgx {{SGX_GID }} - -
+g tape {{TAPE_GID }} - -
+g tty {{TTY_GID }} - -
+g video {{VIDEO_GID }} - -
+
+# Default group for normal users
+g users {{USERS_GID }} - -
diff --git a/meta/recipes-core/systemd/systemd_253.3.bb b/meta/recipes-core/systemd/systemd_253.3.bb
index 45dc6ab5bb..87fbf6f785 100644
--- a/meta/recipes-core/systemd/systemd_253.3.bb
+++ b/meta/recipes-core/systemd/systemd_253.3.bb
@@ -17,6 +17,7 @@ REQUIRED_DISTRO_FEATURES = "systemd"
SRC_URI += " \
file://touchscreen.rules \
file://00-create-volatile.conf \
+ file://basic.conf.in \
${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', 'file://org.freedesktop.hostname1_no_polkit.conf', '', d)} \
${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', 'file://00-hostnamed-network-user.conf', '', d)} \
file://init \
@@ -252,6 +253,10 @@ EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \
# The 60 seconds is watchdog's default vaule.
WATCHDOG_TIMEOUT ??= "60"
+do_configure:prepend() {
+ sed s@:ROOT_HOME:@${ROOT_HOME}@g ${WORKDIR}/basic.conf.in > ${S}/sysusers.d/basic.conf.in
+}
+
do_install() {
meson_do_install
install -d ${D}/${base_sbindir}
--
2.41.0
next prev parent reply other threads:[~2023-06-15 11:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-15 11:43 [PATCH 0/3] rootfs-postcommands: replace the sysusers.d postcommand Louis Rannou
2023-06-15 11:43 ` [PATCH 1/3] rootfs-postcommands: change sysusers.d command Louis Rannou
2023-06-15 11:43 ` Louis Rannou [this message]
2023-06-16 16:51 ` [OE-core] [PATCH 2/3] systemd: replace the sysusers.d basic configuration Peter Kjellerstedt
2023-06-19 12:27 ` Louis Rannou
[not found] ` <5a438786-9f24-e30d-ed84-08bf48b7bfd4@baylibre.com>
2023-06-29 13:03 ` Louis Rannou
2023-07-25 17:11 ` Peter Kjellerstedt
2023-06-15 11:43 ` [PATCH 3/3] base-passwd: add the wheel group Louis Rannou
2023-06-18 9:37 ` [OE-core] " Alexandre Belloni
2023-06-19 12:28 ` Louis Rannou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230613-sysusersd-v1-2-eaddf3179773@baylibre.com \
--to=lrannou@baylibre.com \
--cc=anuj.mittal@intel.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.