diff options
| author | Chen Qi <Qi.Chen@windriver.com> | 2023-11-01 18:42:20 -0700 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2023-12-05 11:51:37 -1000 |
| commit | 394a53b2a119e6f4760ff4c0d7aa00c984aa8d11 (patch) | |
| tree | d639ec15bb50159d1d952ccc2fca606829f8ca74 /meta | |
| parent | cb7590123a63a308a285386177f8ae634f90e89c (diff) | |
| download | poky-394a53b2a119e6f4760ff4c0d7aa00c984aa8d11.tar.gz | |
systemd: fix DynamicUser issue
The DynamicUser needs libnss-systemd to be installed to function
well. The tweaks to nsswitch.conf should be conditional on PACKAGECONFIG
values.
(From OE-Core rev: 5420215a3415f08c1d961fca2e3d8258f82fb7f1)
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit ba3a78c08cb0ce08afde049610d3172b9e3b0695)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/recipes-core/systemd/systemd_254.4.bb | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/meta/recipes-core/systemd/systemd_254.4.bb b/meta/recipes-core/systemd/systemd_254.4.bb index 77724eb822..285ca92e68 100644 --- a/meta/recipes-core/systemd/systemd_254.4.bb +++ b/meta/recipes-core/systemd/systemd_254.4.bb | |||
| @@ -178,7 +178,7 @@ PACKAGECONFIG[microhttpd] = "-Dmicrohttpd=true,-Dmicrohttpd=false,libmicrohttpd" | |||
| 178 | PACKAGECONFIG[myhostname] = "-Dnss-myhostname=true,-Dnss-myhostname=false,,libnss-myhostname" | 178 | PACKAGECONFIG[myhostname] = "-Dnss-myhostname=true,-Dnss-myhostname=false,,libnss-myhostname" |
| 179 | PACKAGECONFIG[networkd] = "-Dnetworkd=true,-Dnetworkd=false" | 179 | PACKAGECONFIG[networkd] = "-Dnetworkd=true,-Dnetworkd=false" |
| 180 | PACKAGECONFIG[no-dns-fallback] = "-Ddns-servers=" | 180 | PACKAGECONFIG[no-dns-fallback] = "-Ddns-servers=" |
| 181 | PACKAGECONFIG[nss] = "-Dnss-systemd=true,-Dnss-systemd=false" | 181 | PACKAGECONFIG[nss] = "-Dnss-systemd=true,-Dnss-systemd=false,,libnss-systemd" |
| 182 | PACKAGECONFIG[nss-mymachines] = "-Dnss-mymachines=true,-Dnss-mymachines=false" | 182 | PACKAGECONFIG[nss-mymachines] = "-Dnss-mymachines=true,-Dnss-mymachines=false" |
| 183 | PACKAGECONFIG[nss-resolve] = "-Dnss-resolve=true,-Dnss-resolve=false" | 183 | PACKAGECONFIG[nss-resolve] = "-Dnss-resolve=true,-Dnss-resolve=false" |
| 184 | PACKAGECONFIG[oomd] = "-Doomd=true,-Doomd=false" | 184 | PACKAGECONFIG[oomd] = "-Doomd=true,-Doomd=false" |
| @@ -826,15 +826,31 @@ ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel" | |||
| 826 | ALTERNATIVE_PRIORITY[runlevel] ?= "300" | 826 | ALTERNATIVE_PRIORITY[runlevel] ?= "300" |
| 827 | 827 | ||
| 828 | pkg_postinst:${PN}:libc-glibc () { | 828 | pkg_postinst:${PN}:libc-glibc () { |
| 829 | sed -e '/^hosts:/s/\s*\<myhostname\>//' \ | 829 | if ${@bb.utils.contains('PACKAGECONFIG', 'myhostname', 'true', 'false', d)}; then |
| 830 | -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \ | 830 | sed -e '/^hosts:/s/\s*\<myhostname\>//' \ |
| 831 | -i $D${sysconfdir}/nsswitch.conf | 831 | -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \ |
| 832 | -i $D${sysconfdir}/nsswitch.conf | ||
| 833 | fi | ||
| 834 | if ${@bb.utils.contains('PACKAGECONFIG', 'nss', 'true', 'false', d)}; then | ||
| 835 | sed -e 's#\(^passwd:.*\)#\1 systemd#' \ | ||
| 836 | -e 's#\(^group:.*\)#\1 systemd#' \ | ||
| 837 | -e 's#\(^shadow:.*\)#\1 systemd#' \ | ||
| 838 | -i $D${sysconfdir}/nsswitch.conf | ||
| 839 | fi | ||
| 832 | } | 840 | } |
| 833 | 841 | ||
| 834 | pkg_prerm:${PN}:libc-glibc () { | 842 | pkg_prerm:${PN}:libc-glibc () { |
| 835 | sed -e '/^hosts:/s/\s*\<myhostname\>//' \ | 843 | if ${@bb.utils.contains('PACKAGECONFIG', 'myhostname', 'true', 'false', d)}; then |
| 836 | -e '/^hosts:/s/\s*myhostname//' \ | 844 | sed -e '/^hosts:/s/\s*\<myhostname\>//' \ |
| 837 | -i $D${sysconfdir}/nsswitch.conf | 845 | -e '/^hosts:/s/\s*myhostname//' \ |
| 846 | -i $D${sysconfdir}/nsswitch.conf | ||
| 847 | fi | ||
| 848 | if ${@bb.utils.contains('PACKAGECONFIG', 'nss', 'true', 'false', d)}; then | ||
| 849 | sed -e '/^passwd:/s#\s*systemd##' \ | ||
| 850 | -e '/^group:/s#\s*systemd##' \ | ||
| 851 | -e '/^shadow:/s#\s*systemd##' \ | ||
| 852 | -i $D${sysconfdir}/nsswitch.conf | ||
| 853 | fi | ||
| 838 | } | 854 | } |
| 839 | 855 | ||
| 840 | PACKAGE_WRITE_DEPS += "qemu-native" | 856 | PACKAGE_WRITE_DEPS += "qemu-native" |
