diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2020-08-29 15:51:50 +0300 |
---|---|---|
committer | Andrew Geissler <geissonator@yahoo.com> | 2020-09-01 22:09:43 +0300 |
commit | 92b518cf76c02e710f12e0a8a0f06ee3905e8d90 (patch) | |
tree | 950922485e373d0930799c0d2be89dfb0792c629 | |
parent | 1f6ac83881328c7103994c53e81f1564d7a93736 (diff) | |
download | openbmc-92b518cf76c02e710f12e0a8a0f06ee3905e8d90.tar.xz |
meta-phosphor: ldap: nsswitch: add rootfs posthook
An ldap image feature was recently added. If the image feature is used
without the distro feature, nsswitch will have the wrong content and the
function won't work. Move this logic to a rootfs post hook so that the
distro feature is not required (and can be deprecated) and because this
is the expected way to make these sorts of modifications to base files
anyway.
(From meta-phosphor rev: 22de160c862b4cf4fee2a3f62e9bd7fad807344d)
Change-Id: I1bc69a96e833801c58bebce68b633e8550982fb8
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
3 files changed, 9 insertions, 25 deletions
diff --git a/meta-phosphor/classes/obmc-phosphor-image.bbclass b/meta-phosphor/classes/obmc-phosphor-image.bbclass index 1c744ca8be..5961839cb7 100644 --- a/meta-phosphor/classes/obmc-phosphor-image.bbclass +++ b/meta-phosphor/classes/obmc-phosphor-image.bbclass @@ -84,3 +84,11 @@ disable_systemd_pager() { echo "SYSTEMD_PAGER=" >> ${IMAGE_ROOTFS}${sysconfdir}/profile echo "export SYSTEMD_PAGER" >> ${IMAGE_ROOTFS}${sysconfdir}/profile } + +enable_ldap_nsswitch() { + sed -i 's/\(\(passwd\|group\|shadow\):\s*\).*/\1files ldap/' \ + "${IMAGE_ROOTFS}${sysconfdir}/nsswitch.conf" +} + +ROOTFS_POSTPROCESS_COMMAND += "${@bb.utils.contains('IMAGE_FEATURES', 'obmc-user-mgmt-ldap', 'enable_ldap_nsswitch ;', '', d)}" + diff --git a/meta-phosphor/recipes-core/base-files/base-files/nsswitch_ldap.conf b/meta-phosphor/recipes-core/base-files/base-files/nsswitch_ldap.conf deleted file mode 100644 index 78141f6440..0000000000 --- a/meta-phosphor/recipes-core/base-files/base-files/nsswitch_ldap.conf +++ /dev/null @@ -1,20 +0,0 @@ -# /etc/nsswitch.conf -# -# Example configuration of GNU Name Service Switch functionality. -# If you have the `glibc-doc' and `info' packages installed, try: -# `info libc "Name Service Switch"' for information about this file. - -passwd: files ldap -group: files ldap -shadow: files ldap - -hosts: files dns -networks: files - -protocols: db files -services: db files -ethers: db files -rpc: db files - -netgroup: nis - diff --git a/meta-phosphor/recipes-core/base-files/base-files_%.bbappend b/meta-phosphor/recipes-core/base-files/base-files_%.bbappend index 60d2bd6c84..b6c4222b2f 100644 --- a/meta-phosphor/recipes-core/base-files/base-files_%.bbappend +++ b/meta-phosphor/recipes-core/base-files/base-files_%.bbappend @@ -7,16 +7,12 @@ RDEPENDS_${PN}_append_df-obmc-ubi-fs = " preinit-mounts" SRC_URI += " \ file://50-rp_filter.conf \ - ${@bb.utils.contains('DISTRO_FEATURES', 'ldap', 'file://nsswitch_ldap.conf', '', d)}" +" do_install_append() { install -d ${D}/srv - if [ "${@bb.utils.filter('DISTRO_FEATURES', 'ldap', d)}" ]; then - install -D -m 600 ${WORKDIR}/nsswitch_ldap.conf ${D}/${sysconfdir}/nsswitch.conf - fi - install -d ${D}/${libdir}/sysctl.d install -D -m 644 ${WORKDIR}/50-rp_filter.conf ${D}/${libdir}/sysctl.d/50-rp_filter.conf } |