diff options
Diffstat (limited to 'poky/meta/recipes-core/glibc')
-rw-r--r-- | poky/meta/recipes-core/glibc/glibc-locale.inc | 6 | ||||
-rw-r--r-- | poky/meta/recipes-core/glibc/glibc-mtrace.inc | 3 | ||||
-rw-r--r-- | poky/meta/recipes-core/glibc/glibc-package.inc | 79 | ||||
-rw-r--r-- | poky/meta/recipes-core/glibc/glibc-scripts.inc | 3 | ||||
-rw-r--r-- | poky/meta/recipes-core/glibc/glibc/CVE-2019-9169.patch | 1 | ||||
-rw-r--r-- | poky/meta/recipes-core/glibc/glibc_2.29.bb | 1 |
6 files changed, 60 insertions, 33 deletions
diff --git a/poky/meta/recipes-core/glibc/glibc-locale.inc b/poky/meta/recipes-core/glibc/glibc-locale.inc index f033635bd..ef06389ff 100644 --- a/poky/meta/recipes-core/glibc/glibc-locale.inc +++ b/poky/meta/recipes-core/glibc/glibc-locale.inc @@ -87,6 +87,9 @@ do_install() { if [ ${PACKAGE_NO_GCONV} -eq 0 ]; then copy_locale_files ${libdir}/gconv 0755 copy_locale_files ${datadir}/i18n 0644 + else + # Remove the libdir if it is empty when gconv is not copied + find ${D}${libdir} -type d -empty -delete fi copy_locale_files ${datadir}/locale 0644 install -m 0644 ${LOCALETREESRC}/SUPPORTED ${WORKDIR}/SUPPORTED @@ -95,3 +98,6 @@ do_install() { inherit libc-package BBCLASSEXTEND = "nativesdk" + +# Don't scan for CVEs as glibc will be scanned +CVE_PRODUCT = "" diff --git a/poky/meta/recipes-core/glibc/glibc-mtrace.inc b/poky/meta/recipes-core/glibc/glibc-mtrace.inc index d703c14bd..ef9d60ec2 100644 --- a/poky/meta/recipes-core/glibc/glibc-mtrace.inc +++ b/poky/meta/recipes-core/glibc/glibc-mtrace.inc @@ -11,3 +11,6 @@ do_install() { install -d -m 0755 ${D}${bindir} install -m 0755 ${SRC}/mtrace ${D}${bindir}/ } + +# Don't scan for CVEs as glibc will be scanned +CVE_PRODUCT = "" diff --git a/poky/meta/recipes-core/glibc/glibc-package.inc b/poky/meta/recipes-core/glibc/glibc-package.inc index b7c64a0b2..b150a3437 100644 --- a/poky/meta/recipes-core/glibc/glibc-package.inc +++ b/poky/meta/recipes-core/glibc/glibc-package.inc @@ -161,27 +161,34 @@ bashscripts = "mtrace sotruss xtrace" do_stash_locale () { dest=${LOCALESTASH} - install -d ${dest}${base_libdir} ${dest}${bindir} ${dest}${libdir} ${dest}${datadir} - if [ "${base_libdir}" != "${libdir}" ]; then - cp -fpPR ${D}${base_libdir}/* ${dest}${base_libdir} - fi + install -d $dest${base_libdir} $dest${bindir} $dest${libdir} $dest${datadir} + # Hide away the locale data from the deployment if [ -e ${D}${bindir}/localedef ]; then - mv -f ${D}${bindir}/localedef ${dest}${bindir} + cp -a ${D}${bindir}/localedef $dest${bindir} fi if [ -e ${D}${libdir}/gconv ]; then - mv -f ${D}${libdir}/gconv ${dest}${libdir} - fi - if [ -e ${D}${exec_prefix}/lib ]; then - cp -fpPR ${D}${exec_prefix}/lib ${dest}${exec_prefix} + cp -a ${D}${libdir}/gconv $dest${libdir} fi if [ -e ${D}${datadir}/i18n ]; then - mv ${D}${datadir}/i18n ${dest}${datadir} + cp -a ${D}${datadir}/i18n $dest${datadir} + fi + + # Make a copy of all the libraries into the locale stash + cp -fpPR ${D}${libdir}/* $dest${libdir} + if [ "${base_libdir}" != "${libdir}" ]; then + cp -fpPR ${D}${base_libdir}/* $dest${base_libdir} fi - cp -fpPR ${D}${datadir}/* ${dest}${datadir} + if [ -e ${D}${exec_prefix}/lib ]; then + if [ ${exec_prefix}/lib != ${base_libdir} ] && [ ${exec_prefix}/lib != ${libdir} ]; then + cp -fpPR ${D}${exec_prefix}/lib $dest${exec_prefix} + fi + fi + + cp -fpPR ${D}${datadir}/* $dest${datadir} rm -rf ${D}${datadir}/locale/ - cp -fpPR ${WORKDIR}/SUPPORTED ${dest} + cp -fpPR ${WORKDIR}/SUPPORTED $dest - target=${dest}/scripts + target=$dest/scripts mkdir -p $target for i in ${bashscripts}; do if [ -f ${D}${bindir}/$i ]; then @@ -203,30 +210,38 @@ python do_stash_locale_setscene () { } addtask do_stash_locale_setscene -do_poststash_install_cleanup () { - # Remove all files which do_stash_locale would remove (mv) - # since that task could have come from sstate and not get run. +PACKAGE_PREPROCESS_FUNCS += "stash_locale_package_cleanup" +SYSROOT_PREPROCESS_FUNCS += "stash_locale_sysroot_cleanup" +stash_locale_cleanup () { + cleanupdir=$1 + # Remove all files which do_stash_locale() copies for i in ${bashscripts}; do - rm -f ${D}${bindir}/$i + rm -f $cleanupdir${bindir}/$i done - rm -f ${D}${bindir}/localedef - rm -rf ${D}${datadir}/i18n - rm -rf ${D}${libdir}/gconv - rm -rf ${D}/${localedir} - rm -rf ${D}${datadir}/locale - if [ "${libdir}" != "${exec_prefix}/lib" ]; then - if [ -d "${D}${exec_prefix}/lib" ]; then - if [ -z "${ARCH_DYNAMIC_LOADER}" -o \ - ! -e "${D}${exec_prefix}/lib/${ARCH_DYNAMIC_LOADER}" ]; then - # error out if directory isn't empty - # this dir should only contain locale dir - # which has been deleted in the previous step - rmdir ${D}${exec_prefix}/lib + rm -f $cleanupdir${bindir}/localedef + rm -rf $cleanupdir${datadir}/i18n + rm -rf $cleanupdir${libdir}/gconv + rm -rf $cleanupdir${localedir} + rm -rf $cleanupdir${datadir}/locale + if [ "${libdir}" != "${exec_prefix}/lib" ] && [ "${root_prefix}/lib" != "${exec_prefix}/lib" ]; then + if [ -d "$cleanupdir${exec_prefix}/lib" ]; then + if [ -z "${ARCH_DYNAMIC_LOADER}" -o \ + ! -e "$cleanupdir${exec_prefix}/lib/${ARCH_DYNAMIC_LOADER}" ]; then + # error out if directory isn't empty + # this dir should only contain locale dir + # which has been deleted in the previous step + rmdir $cleanupdir${exec_prefix}/lib + fi fi - fi fi } -addtask do_poststash_install_cleanup after do_stash_locale do_install before do_populate_sysroot do_package + +stash_locale_sysroot_cleanup() { + stash_locale_cleanup ${SYSROOT_DESTDIR} +} +stash_locale_package_cleanup() { + stash_locale_cleanup ${PKGD} +} pkg_postinst_nscd () { if [ -z "$D" ]; then diff --git a/poky/meta/recipes-core/glibc/glibc-scripts.inc b/poky/meta/recipes-core/glibc/glibc-scripts.inc index 2a2b41507..14a14e451 100644 --- a/poky/meta/recipes-core/glibc/glibc-scripts.inc +++ b/poky/meta/recipes-core/glibc/glibc-scripts.inc @@ -18,3 +18,6 @@ do_install() { # sotruss script requires sotruss-lib.so (given by libsotruss package), # to produce trace of the library calls. RDEPENDS_${PN} += "libsotruss" + +# Don't scan for CVEs as glibc will be scanned +CVE_PRODUCT = "" diff --git a/poky/meta/recipes-core/glibc/glibc/CVE-2019-9169.patch b/poky/meta/recipes-core/glibc/glibc/CVE-2019-9169.patch index bc40361c5..cf3744b24 100644 --- a/poky/meta/recipes-core/glibc/glibc/CVE-2019-9169.patch +++ b/poky/meta/recipes-core/glibc/glibc/CVE-2019-9169.patch @@ -1,4 +1,5 @@ CVE: CVE-2019-9169 +CVE: CVE-2018-20796 Upstream-Status: Backport Signed-off-by: Ross Burton <ross.burton@intel.com> diff --git a/poky/meta/recipes-core/glibc/glibc_2.29.bb b/poky/meta/recipes-core/glibc/glibc_2.29.bb index 073d1533e..c6b2caad4 100644 --- a/poky/meta/recipes-core/glibc/glibc_2.29.bb +++ b/poky/meta/recipes-core/glibc/glibc_2.29.bb @@ -121,7 +121,6 @@ do_compile () { echo "ldd \"${prevrtld} ${RTLDLIST}\" -> \"${newrtld}\"" sed -i ${B}/elf/ldd -e "s#^RTLDLIST=.*\$#RTLDLIST=\"${newrtld}\"#" fi - } require glibc-package.inc |