]> code.ossystems Code Review - openembedded-core.git/commitdiff
dpkg: add nativesdk support
authorhongxu <hongxu.jia@windriver.com>
Sat, 16 Jan 2021 03:47:19 +0000 (11:47 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 16 Jan 2021 22:39:17 +0000 (22:39 +0000)
- Add nativesdk support and override EXTRA_OECONF and PROV for
nativesdk

- Replace ${bindir} with ${STAGING_BINDIR_NATIVE} for perl-native
shebang to fix QA error of shebang too long in nativesdk build

- Conditionally (except musl) add ldconfig to runtime depends to
fix the following issue on target
[snip]
...
dpkg: warning: 'ldconfig' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and/sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)
[snip]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/dpkg/dpkg.inc

index 04fe85c4a8176ad42eea536d7fd193b99b4a9b36..3419aa56bfa674acc57f5fd06652093929866de7 100644 (file)
@@ -26,6 +26,7 @@ EXTRA_OECONF = "\
                "
 
 EXTRA_OECONF_append_class-target = " --disable-update-alternatives DEB_HOST_ARCH=${DPKG_ARCH}"
+EXTRA_OECONF_append_class-nativesdk = " --disable-update-alternatives DEB_HOST_ARCH=${DPKG_ARCH}"
 
 PACKAGECONFIG = "liblzma"
 PACKAGECONFIG[liblzma] = "--with-liblzma,--without-liblzma, xz"
@@ -46,14 +47,15 @@ do_install_append () {
        if [ "${PN}" = "dpkg-native" ]; then
                # update-alternatives doesn't have an offline mode
                rm ${D}${bindir}/update-alternatives
-               sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env nativeperl|' ${D}${bindir}/dpkg-*
+               sed -i -e 's|^#!.*${STAGING_BINDIR_NATIVE}/perl-native.*/perl|#!/usr/bin/env nativeperl|' ${D}${bindir}/dpkg-*
        else
-               sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env perl|' ${D}${bindir}/dpkg-*
+               sed -i -e 's|^#!.*${STAGING_BINDIR_NATIVE}/perl-native.*/perl|#!/usr/bin/env perl|' ${D}${bindir}/dpkg-*
        fi
 }
 
 PROV = "virtual/update-alternatives"
 PROV_class-native = ""
+PROV_class-nativesdk = ""
 
 PROVIDES += "${PROV}"
 
@@ -93,7 +95,8 @@ ALTERNATIVE_${PN}-start-stop = "start-stop-daemon"
 ALTERNATIVE_LINK_NAME[start-stop-daemon] = "${sbindir}/start-stop-daemon"
 ALTERNATIVE_PRIORITY = "100"
 
-RDEPENDS_${PN} += "${PN}-start-stop"
+EXTRA_RDPENDS = "ldconfig"
+EXTRA_RDPENDS_libc-musl = ""
+RDEPENDS_${PN} += "${PN}-start-stop ${EXTRA_RDPENDS}"
 
-
-BBCLASSEXTEND = "native"
+BBCLASSEXTEND = "native nativesdk"