All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] dpkg: add nativesdk support
@ 2021-01-15  9:45 hongxu
  2021-01-15  9:45 ` [PATCH 2/3] apt: " hongxu
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: hongxu @ 2021-01-15  9:45 UTC (permalink / raw)
  To: openembedded-core

- 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

- 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>
---
 meta/recipes-devtools/dpkg/dpkg.inc | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
index 04fe85c4a8..3325159299 100644
--- a/meta/recipes-devtools/dpkg/dpkg.inc
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -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,7 @@ 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"
+RDEPENDS_${PN} += "${PN}-start-stop ldconfig"
 
 
-BBCLASSEXTEND = "native"
+BBCLASSEXTEND = "native nativesdk"
-- 
2.18.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/3] apt: add nativesdk support
  2021-01-15  9:45 [PATCH 1/3] dpkg: add nativesdk support hongxu
@ 2021-01-15  9:45 ` hongxu
  2021-01-15 11:26   ` [OE-core] " Richard Purdie
       [not found]   ` <165A643B5E417599.21794@lists.openembedded.org>
  2021-01-15  9:45 ` [PATCH 3/3] deb: do not insert feed uris if apt not installed hongxu
  2021-01-15 22:15 ` [OE-core] [PATCH 1/3] dpkg: add nativesdk support Richard Purdie
  2 siblings, 2 replies; 12+ messages in thread
From: hongxu @ 2021-01-15  9:45 UTC (permalink / raw)
  To: openembedded-core

1. Add nativesdk support
- Apply the same patches of native
- Generate the same apt.conf.sample of native

2. Create user '_apt' to fix apt runtime warning
[snip]
$ apt update
...
W: No sandbox user '_apt' on the system, can not drop privileges
[snip]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-devtools/apt/apt_1.8.2.1.bb | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-devtools/apt/apt_1.8.2.1.bb b/meta/recipes-devtools/apt/apt_1.8.2.1.bb
index de0e150a2e..57bd7ca600 100644
--- a/meta/recipes-devtools/apt/apt_1.8.2.1.bb
+++ b/meta/recipes-devtools/apt/apt_1.8.2.1.bb
@@ -17,6 +17,12 @@ SRC_URI_append_class-native = " \
            file://0001-Do-not-configure-packages-on-installation.patch \
            "
 
+SRC_URI_append_class-nativesdk = " \
+           file://0001-Do-not-init-tables-from-dpkg-configuration.patch \
+           file://0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch \
+           file://0001-Do-not-configure-packages-on-installation.patch \
+           "
+
 SRC_URI[sha256sum] = "6d447f2e9437ec24e78350b63bb0592bee1f050811d51990b0c783183b0983f8"
 LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263"
 
@@ -24,9 +30,12 @@ LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263"
 # so we check the latest upstream from a directory that does get updated
 UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/apt/"
 
-inherit cmake perlnative bash-completion upstream-version-is-even
+inherit cmake perlnative bash-completion upstream-version-is-even useradd
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --home /nonexistent --no-create-home _apt"
 
-BBCLASSEXTEND = "native"
+BBCLASSEXTEND = "native nativesdk"
 
 DEPENDS += "virtual/libiconv virtual/libintl db gnutls lz4 zlib bzip2 xz"
 
@@ -41,7 +50,7 @@ do_configure_prepend () {
 FILES_${PN} += "${prefix}/lib/dpkg ${prefix}/lib/apt"
 RDEPENDS_${PN} += "bash perl dpkg"
 
-do_install_append_class-native() {
+customize_apt_conf_sample() {
     cat > ${D}${sysconfdir}/apt/apt.conf.sample << EOF
 Dir "${STAGING_DIR_NATIVE}/"
 {
@@ -94,6 +103,15 @@ DPkg::Path "";
 EOF
 }
 
+do_install_append_class-native() {
+    customize_apt_conf_sample
+}
+
+do_install_append_class-nativesdk() {
+    customize_apt_conf_sample
+}
+
+
 do_install_append_class-target() {
     #Write the correct apt-architecture to apt.conf
     APT_CONF=${D}/etc/apt/apt.conf
-- 
2.18.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/3] deb: do not insert feed uris if apt not installed
  2021-01-15  9:45 [PATCH 1/3] dpkg: add nativesdk support hongxu
  2021-01-15  9:45 ` [PATCH 2/3] apt: " hongxu
@ 2021-01-15  9:45 ` hongxu
  2021-01-15 22:21   ` [OE-core] " Richard Purdie
  2021-01-15 22:15 ` [OE-core] [PATCH 1/3] dpkg: add nativesdk support Richard Purdie
  2 siblings, 1 reply; 12+ messages in thread
From: hongxu @ 2021-01-15  9:45 UTC (permalink / raw)
  To: openembedded-core

- The dir /etc/apt was created in package apt, if package apt was not
  installed, there is no need to insert package feed. Otherwise, it
  will fail with no such dir

- Output the result of apt install

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/lib/oe/package_manager/deb/__init__.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oe/package_manager/deb/__init__.py b/meta/lib/oe/package_manager/deb/__init__.py
index 10ad707c23..1e2278d6a4 100644
--- a/meta/lib/oe/package_manager/deb/__init__.py
+++ b/meta/lib/oe/package_manager/deb/__init__.py
@@ -287,7 +287,8 @@ class DpkgPM(OpkgDpkgPM):
 
         try:
             bb.note("Installing the following packages: %s" % ' '.join(pkgs))
-            subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
+            output = subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
+            bb.note(output.decode("utf-8"))
         except subprocess.CalledProcessError as e:
             (bb.fatal, bb.warn)[attempt_only]("Unable to install packages. "
                                               "Command '%s' returned %d:\n%s" %
@@ -343,8 +344,12 @@ class DpkgPM(OpkgDpkgPM):
         if feed_uris == "":
             return
 
+
         sources_conf = os.path.join("%s/etc/apt/sources.list"
                                     % self.target_rootfs)
+        if not os.path.exists(os.path.dirname(sources_conf)):
+            return
+
         arch_list = []
 
         if feed_archs is None:
-- 
2.18.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [OE-core] [PATCH 2/3] apt: add nativesdk support
  2021-01-15  9:45 ` [PATCH 2/3] apt: " hongxu
@ 2021-01-15 11:26   ` Richard Purdie
       [not found]   ` <165A643B5E417599.21794@lists.openembedded.org>
  1 sibling, 0 replies; 12+ messages in thread
From: Richard Purdie @ 2021-01-15 11:26 UTC (permalink / raw)
  To: hongxu, openembedded-core

On Fri, 2021-01-15 at 17:45 +0800, hongxu wrote:
> 1. Add nativesdk support
> - Apply the same patches of native
> - Generate the same apt.conf.sample of native
> 
> 2. Create user '_apt' to fix apt runtime warning
> [snip]
> $ apt update
> ...
> W: No sandbox user '_apt' on the system, can not drop privileges
> [snip]
> 
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
>  meta/recipes-devtools/apt/apt_1.8.2.1.bb | 24 +++++++++++++++++++++---
>  1 file changed, 21 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/recipes-devtools/apt/apt_1.8.2.1.bb b/meta/recipes-devtools/apt/apt_1.8.2.1.bb
> index de0e150a2e..57bd7ca600 100644
> --- a/meta/recipes-devtools/apt/apt_1.8.2.1.bb
> +++ b/meta/recipes-devtools/apt/apt_1.8.2.1.bb
> @@ -17,6 +17,12 @@ SRC_URI_append_class-native = " \
>             file://0001-Do-not-configure-packages-on-installation.patch \
>             "
>  
> 
> 
> 
> 
> 
> 
> 
> +SRC_URI_append_class-nativesdk = " \
> +           file://0001-Do-not-init-tables-from-dpkg-configuration.patch \
> +           file://0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch \
> +           file://0001-Do-not-configure-packages-on-installation.patch \
> +           "
> +
>  SRC_URI[sha256sum] = "6d447f2e9437ec24e78350b63bb0592bee1f050811d51990b0c783183b0983f8"
>  LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263"
>  
> 
> 
> 
> 
> 
> 
> 
> @@ -24,9 +30,12 @@ LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263"
>  # so we check the latest upstream from a directory that does get updated
>  UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/apt/"
>  
> 
> 
> 
> 
> 
> 
> 
> -inherit cmake perlnative bash-completion upstream-version-is-even
> +inherit cmake perlnative bash-completion upstream-version-is-even useradd
> +
> +USERADD_PACKAGES = "${PN}"
> +USERADD_PARAM_${PN} = "--system --home /nonexistent --no-create-home _apt"
> 

I think meta-selftest/files/static-passwd  will need this adding for
the selftests to pass?

Cheers,

Richard


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [OE-core] [PATCH 2/3] apt: add nativesdk support
       [not found]   ` <165A643B5E417599.21794@lists.openembedded.org>
@ 2021-01-15 16:51     ` Richard Purdie
  2021-01-16  2:49       ` hongxu
  0 siblings, 1 reply; 12+ messages in thread
From: Richard Purdie @ 2021-01-15 16:51 UTC (permalink / raw)
  To: hongxu, openembedded-core

On Fri, 2021-01-15 at 11:26 +0000, Richard Purdie via
lists.openembedded.org wrote:
> On Fri, 2021-01-15 at 17:45 +0800, hongxu wrote:
> > 
> > 
> > -inherit cmake perlnative bash-completion upstream-version-is-even
> > +inherit cmake perlnative bash-completion upstream-version-is-even useradd
> > +
> > +USERADD_PACKAGES = "${PN}"
> > +USERADD_PARAM_${PN} = "--system --home /nonexistent --no-create-home _apt"
> > 
> 
> I think meta-selftest/files/static-passwd  will need this adding for
> the selftests to pass?

I've tweaked the patch I've queued in master-next for testing.

I also added a comment here to say why we need this user (it used to
exist but was removed as it wasn't realised what it was for).

Cheers,

Richard


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [OE-core] [PATCH 1/3] dpkg: add nativesdk support
  2021-01-15  9:45 [PATCH 1/3] dpkg: add nativesdk support hongxu
  2021-01-15  9:45 ` [PATCH 2/3] apt: " hongxu
  2021-01-15  9:45 ` [PATCH 3/3] deb: do not insert feed uris if apt not installed hongxu
@ 2021-01-15 22:15 ` Richard Purdie
  2021-01-16  2:50   ` hongxu
  2021-01-16  3:47   ` [PATCH V2] " hongxu
  2 siblings, 2 replies; 12+ messages in thread
From: Richard Purdie @ 2021-01-15 22:15 UTC (permalink / raw)
  To: hongxu, openembedded-core; +Cc: Khem Raj

On Fri, 2021-01-15 at 17:45 +0800, hongxu wrote:
> - 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
> 
> - 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>
> ---
>  meta/recipes-devtools/dpkg/dpkg.inc | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)

Seems to break poky-tiny:

https://autobuilder.yoctoproject.org/typhoon/#/builders/15/builds/3209

(ldconfig may not be available with musl?)

Cheers,

Richard


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [OE-core] [PATCH 3/3] deb: do not insert feed uris if apt not installed
  2021-01-15  9:45 ` [PATCH 3/3] deb: do not insert feed uris if apt not installed hongxu
@ 2021-01-15 22:21   ` Richard Purdie
  2021-01-16  2:46     ` hongxu
  2021-01-16  3:49     ` [PATCH V2] " hongxu
  0 siblings, 2 replies; 12+ messages in thread
From: Richard Purdie @ 2021-01-15 22:21 UTC (permalink / raw)
  To: hongxu, openembedded-core

On Fri, 2021-01-15 at 17:45 +0800, hongxu wrote:
> - The dir /etc/apt was created in package apt, if package apt was not
>   installed, there is no need to insert package feed. Otherwise, it
>   will fail with no such dir
> 
> - Output the result of apt install
> 
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
>  meta/lib/oe/package_manager/deb/__init__.py | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/lib/oe/package_manager/deb/__init__.py b/meta/lib/oe/package_manager/deb/__init__.py
> index 10ad707c23..1e2278d6a4 100644
> --- a/meta/lib/oe/package_manager/deb/__init__.py
> +++ b/meta/lib/oe/package_manager/deb/__init__.py
> @@ -287,7 +287,8 @@ class DpkgPM(OpkgDpkgPM):
>  
> 
> 
> 
>          try:
>              bb.note("Installing the following packages: %s" % ' '.join(pkgs))
> -            subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
> +            output = subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
> +            bb.note(output.decode("utf-8"))
>          except subprocess.CalledProcessError as e:
>              (bb.fatal, bb.warn)[attempt_only]("Unable to install packages. "
>                                                "Command '%s' returned %d:\n%s" %
> @@ -343,8 +344,12 @@ class DpkgPM(OpkgDpkgPM):
>          if feed_uris == "":
>              return
>  
> 
> 
> 
> +
>          sources_conf = os.path.join("%s/etc/apt/sources.list"
>                                      % self.target_rootfs)
> +        if not os.path.exists(os.path.dirname(sources_conf)):
> +            return
> +
>          arch_list = []
>  
> 
> 
> 
>          if feed_archs is None:

I think this is resulting in these warnings:

https://autobuilder.yoctoproject.org/typhoon/#/builders/50/builds/2925

Cheers,

Richard


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [OE-core] [PATCH 3/3] deb: do not insert feed uris if apt not installed
  2021-01-15 22:21   ` [OE-core] " Richard Purdie
@ 2021-01-16  2:46     ` hongxu
  2021-01-16  3:49     ` [PATCH V2] " hongxu
  1 sibling, 0 replies; 12+ messages in thread
From: hongxu @ 2021-01-16  2:46 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core

On 1/16/21 6:21 AM, Richard Purdie wrote:
> I think this is resulting in these warnings:
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/50/builds/2925

This is caused by the warning message in the output of 'apt install'

...

WARNING: The following packages cannot be authenticated!

...

I will try to fix the warning

//Hongxu

>
> Cheers,
>
> Richard



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [OE-core] [PATCH 2/3] apt: add nativesdk support
  2021-01-15 16:51     ` Richard Purdie
@ 2021-01-16  2:49       ` hongxu
  0 siblings, 0 replies; 12+ messages in thread
From: hongxu @ 2021-01-16  2:49 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core

On 1/16/21 12:51 AM, Richard Purdie wrote:
> [Please note this e-mail is from an EXTERNAL e-mail address]
>
> On Fri, 2021-01-15 at 11:26 +0000, Richard Purdie via
> lists.openembedded.org wrote:
>> On Fri, 2021-01-15 at 17:45 +0800, hongxu wrote:
>>>
>>> -inherit cmake perlnative bash-completion upstream-version-is-even
>>> +inherit cmake perlnative bash-completion upstream-version-is-even useradd
>>> +
>>> +USERADD_PACKAGES = "${PN}"
>>> +USERADD_PARAM_${PN} = "--system --home /nonexistent --no-create-home _apt"
>>>
>> I think meta-selftest/files/static-passwd  will need this adding for
>> the selftests to pass?
> I've tweaked the patch I've queued in master-next for testing.
>
> I also added a comment here to say why we need this user (it used to
> exist but was removed as it wasn't realised what it was for).

Got it, thanks a lot

//Hongxu

> Cheers,
>
> Richard
>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [OE-core] [PATCH 1/3] dpkg: add nativesdk support
  2021-01-15 22:15 ` [OE-core] [PATCH 1/3] dpkg: add nativesdk support Richard Purdie
@ 2021-01-16  2:50   ` hongxu
  2021-01-16  3:47   ` [PATCH V2] " hongxu
  1 sibling, 0 replies; 12+ messages in thread
From: hongxu @ 2021-01-16  2:50 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core; +Cc: Khem Raj

On 1/16/21 6:15 AM, Richard Purdie wrote:
> [Please note this e-mail is from an EXTERNAL e-mail address]
>
> On Fri, 2021-01-15 at 17:45 +0800, hongxu wrote:
>> - 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
>>
>> - 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>
>> ---
>>   meta/recipes-devtools/dpkg/dpkg.inc | 10 ++++++----
>>   1 file changed, 6 insertions(+), 4 deletions(-)
> Seems to break poky-tiny:
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/15/builds/3209
>
> (ldconfig may not be available with musl?)

I will try it in musl,

//Hongxu

> Cheers,
>
> Richard
>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH V2] dpkg: add nativesdk support
  2021-01-15 22:15 ` [OE-core] [PATCH 1/3] dpkg: add nativesdk support Richard Purdie
  2021-01-16  2:50   ` hongxu
@ 2021-01-16  3:47   ` hongxu
  1 sibling, 0 replies; 12+ messages in thread
From: hongxu @ 2021-01-16  3:47 UTC (permalink / raw)
  To: openembedded-core, richard.purdie

From: hongxu <hongxu.jia@windriver.com>

- 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>
---
 meta/recipes-devtools/dpkg/dpkg.inc | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
index 04fe85c4a8..3419aa56bf 100644
--- a/meta/recipes-devtools/dpkg/dpkg.inc
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -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"
-- 
2.18.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH V2] deb: do not insert feed uris if apt not installed
  2021-01-15 22:21   ` [OE-core] " Richard Purdie
  2021-01-16  2:46     ` hongxu
@ 2021-01-16  3:49     ` hongxu
  1 sibling, 0 replies; 12+ messages in thread
From: hongxu @ 2021-01-16  3:49 UTC (permalink / raw)
  To: openembedded-core, richard.purdie

- The dir /etc/apt was created in package apt, if package apt was not
installed, there is no need to insert package feed. Otherwise, it
will fail with no such dir

- Output the result of apt install

- Explicitly trust the deb package repository from build
This could avoid apt install warning:
...
WARNING: The following packages cannot be authenticated!
...

- Also trust the inserted deb package repository from PACKAGE_FEED_URIS

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/lib/oe/package_manager/deb/__init__.py | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/meta/lib/oe/package_manager/deb/__init__.py b/meta/lib/oe/package_manager/deb/__init__.py
index 10ad707c23..7fdfdaa4fa 100644
--- a/meta/lib/oe/package_manager/deb/__init__.py
+++ b/meta/lib/oe/package_manager/deb/__init__.py
@@ -287,7 +287,8 @@ class DpkgPM(OpkgDpkgPM):
 
         try:
             bb.note("Installing the following packages: %s" % ' '.join(pkgs))
-            subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
+            output = subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
+            bb.note(output.decode("utf-8"))
         except subprocess.CalledProcessError as e:
             (bb.fatal, bb.warn)[attempt_only]("Unable to install packages. "
                                               "Command '%s' returned %d:\n%s" %
@@ -343,8 +344,12 @@ class DpkgPM(OpkgDpkgPM):
         if feed_uris == "":
             return
 
+
         sources_conf = os.path.join("%s/etc/apt/sources.list"
                                     % self.target_rootfs)
+        if not os.path.exists(os.path.dirname(sources_conf)):
+            return
+
         arch_list = []
 
         if feed_archs is None:
@@ -362,11 +367,11 @@ class DpkgPM(OpkgDpkgPM):
                 if arch_list:
                     for arch in arch_list:
                         bb.note('Adding dpkg channel at (%s)' % uri)
-                        sources_file.write("deb %s/%s ./\n" %
+                        sources_file.write("deb [trusted=yes] %s/%s ./\n" %
                                            (uri, arch))
                 else:
                     bb.note('Adding dpkg channel at (%s)' % uri)
-                    sources_file.write("deb %s ./\n" % uri)
+                    sources_file.write("deb [trusted=yes] %s ./\n" % uri)
 
     def _create_configs(self, archs, base_archs):
         base_archs = re.sub(r"_", r"-", base_archs)
@@ -406,7 +411,7 @@ class DpkgPM(OpkgDpkgPM):
 
         with open(os.path.join(self.apt_conf_dir, "sources.list"), "w+") as sources_file:
             for arch in arch_list:
-                sources_file.write("deb file:%s/ ./\n" %
+                sources_file.write("deb [trusted=yes] file:%s/ ./\n" %
                                    os.path.join(self.deploy_dir, arch))
 
         base_arch_list = base_archs.split()
-- 
2.18.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-01-16  3:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-15  9:45 [PATCH 1/3] dpkg: add nativesdk support hongxu
2021-01-15  9:45 ` [PATCH 2/3] apt: " hongxu
2021-01-15 11:26   ` [OE-core] " Richard Purdie
     [not found]   ` <165A643B5E417599.21794@lists.openembedded.org>
2021-01-15 16:51     ` Richard Purdie
2021-01-16  2:49       ` hongxu
2021-01-15  9:45 ` [PATCH 3/3] deb: do not insert feed uris if apt not installed hongxu
2021-01-15 22:21   ` [OE-core] " Richard Purdie
2021-01-16  2:46     ` hongxu
2021-01-16  3:49     ` [PATCH V2] " hongxu
2021-01-15 22:15 ` [OE-core] [PATCH 1/3] dpkg: add nativesdk support Richard Purdie
2021-01-16  2:50   ` hongxu
2021-01-16  3:47   ` [PATCH V2] " hongxu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.