From b93236b7e4a41995228a1329e5e16fd3c8d3351c Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Wed, 12 Jun 2024 06:06:32 +0200 Subject: [PATCH] feat(systemd*): include systemd config files from /usr/lib/systemd (bsc#1228398) and also use proper variables for the paths. -- The new systemd reads from both /etc and /usr/, so to accomodate this, I've added new paths to install configs from (I probably haven't covered all). This changes only hostonly behaviour; uses global variables: systemdutilconfdir: "/etc/systemd" systemdutildir: "/lib/systemd:/lib/systemd/systemd-udevd" "/usr/lib/systemd:/usr/lib/systemd/systemd-udevd" Ref: https://issues.redhat.com/browse/RHEL-32506 (cherry picked from commit https://github.com/dracut-ng/dracut-ng/commit/6c99c07327b9600f18fcf97564f427610453a771) --- modules.d/00systemd/module-setup.sh | 6 ++++-- modules.d/01systemd-coredump/module-setup.sh | 3 ++- modules.d/01systemd-pstore/module-setup.sh | 2 ++ modules.d/01systemd-resolved/module-setup.sh | 1 + modules.d/01systemd-timesyncd/module-setup.sh | 1 + 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh index 554c25a08e..1e71596129 100755 --- a/modules.d/00systemd/module-setup.sh +++ b/modules.d/00systemd/module-setup.sh @@ -47,6 +47,8 @@ install() { "$systemdutildir"/system-generators/systemd-debug-generator \ "$systemdutildir"/system-generators/systemd-fstab-generator \ "$systemdutildir"/system-generators/systemd-gpt-auto-generator \ + "$systemdutildir"/system.conf \ + "$systemdutildir"/system.conf.d/*.conf \ "$systemdsystemunitdir"/debug-shell.service \ "$systemdsystemunitdir"/cryptsetup.target \ "$systemdsystemunitdir"/cryptsetup-pre.target \ @@ -166,8 +168,8 @@ install() { inst_multiple -H -o \ /etc/systemd/journald.conf \ /etc/systemd/journald.conf.d/*.conf \ - /etc/systemd/system.conf \ - /etc/systemd/system.conf.d/*.conf \ + "$systemdutilconfdir"/system.conf \ + "$systemdutilconfdir"/system.conf.d/*.conf \ "$systemdsystemconfdir"/modprobe@.service \ "$systemdsystemconfdir/modprobe@.service.d/*.conf" \ /etc/hosts \ diff --git a/modules.d/01systemd-coredump/module-setup.sh b/modules.d/01systemd-coredump/module-setup.sh index 69ec966864..3bb00bd974 100755 --- a/modules.d/01systemd-coredump/module-setup.sh +++ b/modules.d/01systemd-coredump/module-setup.sh @@ -33,6 +33,7 @@ install() { inst_multiple -o \ "$sysctld"/50-coredump.conf \ "$systemdutildir"/coredump.conf \ + "$systemdutildir/coredump.conf.d/*.conf" \ "$systemdutildir"/systemd-coredump \ "$systemdsystemunitdir"/systemd-coredump.socket \ "$systemdsystemunitdir"/systemd-coredump@.service \ @@ -44,7 +45,7 @@ install() { if [[ $hostonly ]]; then inst_multiple -H -o \ "$systemdutilconfdir"/coredump.conf \ - "$systemdsystemconfdir/coredump.conf.d/*.conf" \ + "$systemdutilconfdir/coredump.conf.d/*.conf" \ "$systemdsystemconfdir"/systemd-coredump.socket \ "$systemdsystemconfdir/systemd-coredump.socket.d/*.conf" \ "$systemdsystemconfdir"/systemd-coredump@.service \ diff --git a/modules.d/01systemd-pstore/module-setup.sh b/modules.d/01systemd-pstore/module-setup.sh index 67034bbfa4..5de5db4b65 100755 --- a/modules.d/01systemd-pstore/module-setup.sh +++ b/modules.d/01systemd-pstore/module-setup.sh @@ -34,6 +34,8 @@ install() { inst_dir /var/lib/systemd/pstore inst_multiple -o \ "$tmpfilesdir/systemd-pstore.conf" \ + "$systemdutildir"/pstore.conf \ + "$systemdutildir/pstore.conf.d/*.conf" \ "$systemdutildir"/systemd-pstore \ "$systemdsystemunitdir"/systemd-pstore.service \ "$systemdsystemunitdir/systemd-pstore.service.d/*.conf" diff --git a/modules.d/01systemd-resolved/module-setup.sh b/modules.d/01systemd-resolved/module-setup.sh index 0c2e8c2827..7b4b26e81a 100755 --- a/modules.d/01systemd-resolved/module-setup.sh +++ b/modules.d/01systemd-resolved/module-setup.sh @@ -49,6 +49,7 @@ install() { # Install the hosts local user configurations if enabled. if [[ $hostonly ]]; then inst_multiple -H -o \ + "$systemdutilconfdir"/resolv.conf \ "$systemdutilconfdir"/resolved.conf \ "$systemdutilconfdir/resolved.conf.d/*.conf" \ "$systemdsystemconfdir"/systemd-resolved.service \ diff --git a/modules.d/01systemd-timesyncd/module-setup.sh b/modules.d/01systemd-timesyncd/module-setup.sh index a2c6754086..77f7b11393 100755 --- a/modules.d/01systemd-timesyncd/module-setup.sh +++ b/modules.d/01systemd-timesyncd/module-setup.sh @@ -38,6 +38,7 @@ install() { "$systemdntpunits/*.list" \ "$systemdutildir"/systemd-timesyncd \ "$systemdutildir"/systemd-time-wait-sync \ + "$systemdutildir"/timesyncd.conf \ "$systemdutildir/timesyncd.conf.d/*.conf" \ "$systemdsystemunitdir"/systemd-timesyncd.service \ "$systemdsystemunitdir/systemd-timesyncd.service.d/*.conf" \