diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2018-08-16 18:37:58 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-08-19 16:35:22 +0100 |
commit | 72844f54318c31a0f05c75d59283f1fe92a1b1b7 (patch) | |
tree | 2aeae1b0948364780d07d27adb750bc1cd456de5 /meta/recipes-core/glibc/glibc-package.inc | |
parent | 704e725bba37911e56ecd0edda694edfe9fce40f (diff) | |
download | poky-72844f54318c31a0f05c75d59283f1fe92a1b1b7.tar.gz |
glibc: re-package for libnss-db
On other distros like ubuntu/centos, libnss-db usually provides:
- The libraries
- The Makefile to create database
(in /var/db for centos, /var/lib/misc/ for ubuntu)
- The makedb command (it's in glibc-common for centos7)
What we had is:
- The libraries are in glibc-extra-nss
- The Makefile is removed
- The makedb command is in glibc-utils (lack of dependency)
So when glibc-extra-nss is installed but glibc-utils is not,
we see error like:
nscd[165]: 165 checking for monitored file `/var/db/group.db': No such file or directory
nscd[165]: 165 checking for monitored file `/var/db/passwd.db': No such file or directory
And there is not an easy way to create these databases.
To fix the issue:
- Re-package the libraries into libnss-db
- Don't remove the Makefile and add it in libnss-db
- Add RDEPENDS for libnss-db on glibc-utils
- Provide a shell script, makedbs.sh, to generate the db files.
This is to avoid dependency on 'make'.
Notes:
1. For external toolchain, an extra package 'libnss-db' need to be provided
If replacing glibc from core.
2. I've check the git history of nss/db-Makefile, the last two functionality
fix is as below.
- fix non-portable `echo -n` usage -- Date: Thu Aug 6 04:14:20 2015 -0400
- Fix db makefile rule for group.db -- Date: Fri Nov 11 14:43:36 2011 +0100
So I think this file is stable enough. And using makedbs.sh which is crafted according
to that file is not likely to cause maintanence problem.
(From OE-Core rev: 13cf502fce8956f95fdc8ac0c7a37d741223bcc9)
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/glibc/glibc-package.inc')
-rw-r--r-- | meta/recipes-core/glibc/glibc-package.inc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/meta/recipes-core/glibc/glibc-package.inc b/meta/recipes-core/glibc/glibc-package.inc index 07ce75df5d..9ea41b7b54 100644 --- a/meta/recipes-core/glibc/glibc-package.inc +++ b/meta/recipes-core/glibc/glibc-package.inc | |||
@@ -1,6 +1,6 @@ | |||
1 | INHIBIT_SYSROOT_STRIP = "1" | 1 | INHIBIT_SYSROOT_STRIP = "1" |
2 | 2 | ||
3 | PACKAGES = "${PN}-dbg catchsegv sln nscd ldd tzcode glibc-thread-db ${PN}-pic libcidn libmemusage libsegfault ${PN}-pcprofile libsotruss ${PN} ${PN}-utils glibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc" | 3 | PACKAGES = "${PN}-dbg catchsegv sln nscd ldd tzcode glibc-thread-db ${PN}-pic libcidn libmemusage libnss-db libsegfault ${PN}-pcprofile libsotruss ${PN} ${PN}-utils glibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc" |
4 | 4 | ||
5 | # The ld.so in this glibc supports the GNU_HASH | 5 | # The ld.so in this glibc supports the GNU_HASH |
6 | RPROVIDES_${PN} = "eglibc rtld(GNU_HASH)" | 6 | RPROVIDES_${PN} = "eglibc rtld(GNU_HASH)" |
@@ -23,6 +23,8 @@ FILES_ldd = "${bindir}/ldd" | |||
23 | FILES_libsegfault = "${base_libdir}/libSegFault*" | 23 | FILES_libsegfault = "${base_libdir}/libSegFault*" |
24 | FILES_libcidn = "${base_libdir}/libcidn-*.so ${base_libdir}/libcidn.so.*" | 24 | FILES_libcidn = "${base_libdir}/libcidn-*.so ${base_libdir}/libcidn.so.*" |
25 | FILES_libmemusage = "${base_libdir}/libmemusage.so" | 25 | FILES_libmemusage = "${base_libdir}/libmemusage.so" |
26 | FILES_libnss-db = "${base_libdir}/libnss_db.so.* ${base_libdir}/libnss_db-*.so ${localstatedir}/db/Makefile ${localstatedir}/db/makedbs.sh" | ||
27 | RDEPENDS_libnss-db = "${PN}-utils" | ||
26 | FILES_glibc-extra-nss = "${base_libdir}/libnss_*-*.so ${base_libdir}/libnss_*.so.*" | 28 | FILES_glibc-extra-nss = "${base_libdir}/libnss_*-*.so ${base_libdir}/libnss_*.so.*" |
27 | FILES_sln = "${base_sbindir}/sln" | 29 | FILES_sln = "${base_sbindir}/sln" |
28 | FILES_${PN}-pic = "${libdir}/*_pic.a ${libdir}/*_pic.map ${libdir}/libc_pic/*.o" | 30 | FILES_${PN}-pic = "${libdir}/*_pic.a ${libdir}/*_pic.map ${libdir}/libc_pic/*.o" |
@@ -59,7 +61,6 @@ inherit libc-common multilib_header | |||
59 | 61 | ||
60 | do_install_append () { | 62 | do_install_append () { |
61 | rm -f ${D}${sysconfdir}/localtime | 63 | rm -f ${D}${sysconfdir}/localtime |
62 | rm -rf ${D}${localstatedir} | ||
63 | 64 | ||
64 | # remove empty glibc dir | 65 | # remove empty glibc dir |
65 | if [ -d ${D}${libexecdir} ]; then | 66 | if [ -d ${D}${libexecdir} ]; then |
@@ -95,6 +96,7 @@ do_install_append () { | |||
95 | install -d ${D}${localstatedir}/db/nscd | 96 | install -d ${D}${localstatedir}/db/nscd |
96 | install -m 0755 ${S}/nscd/nscd.init ${D}${sysconfdir}/init.d/nscd | 97 | install -m 0755 ${S}/nscd/nscd.init ${D}${sysconfdir}/init.d/nscd |
97 | install -m 0755 ${S}/nscd/nscd.conf ${D}${sysconfdir}/nscd.conf | 98 | install -m 0755 ${S}/nscd/nscd.conf ${D}${sysconfdir}/nscd.conf |
99 | install -m 0755 ${WORKDIR}/makedbs.sh ${D}${localstatedir}/db | ||
98 | sed -i "s%daemon%start-stop-daemon --start --exec%g" ${D}${sysconfdir}/init.d/nscd | 100 | sed -i "s%daemon%start-stop-daemon --start --exec%g" ${D}${sysconfdir}/init.d/nscd |
99 | sed -i "s|\(enable-cache\t\+netgroup\t\+\)yes|\1no|" ${D}${sysconfdir}/nscd.conf | 101 | sed -i "s|\(enable-cache\t\+netgroup\t\+\)yes|\1no|" ${D}${sysconfdir}/nscd.conf |
100 | 102 | ||