Skip to contentSkip to conversation

opkg: enable ACL only when present in DISTRO_FEATURES

PATCH In review Gyorgy Sarvari 3 participants 5 messages Nov 27, 2025 – Nov 28, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 opkg: enable ACL only when present in DISTRO_FEATURES

During the last opkg update the application's ACL feature was enabled by default, which requires acl recipe as a dependency, however it wasn't enabled in the recipe, making compilation fail when libacl wasn't in the sysroot.

This change adds a PACKAGECONFIG that makes acl an optional dependency, and it is only enabled automatically if "acl" is present in DISTRO_FEATURES.

---
 meta/recipes-devtools/opkg/opkg_0.9.0.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-devtools/opkg/opkg_0.9.0.bb +2 -1
index ed2f36d636..0b3bb3d24c 100644
@@ -31,7 +31,7 @@ inherit cmake pkgconfig ptest
 target_localstatedir := "${localstatedir}"
 OPKGLIBDIR ??= "${target_localstatedir}/lib"
 
-PACKAGECONFIG ??= "libsolv"
+PACKAGECONFIG ??= "libsolv ${@bb.utils.filter('DISTRO_FEATURES', 'acl', d)}"
 
 PACKAGECONFIG[gpg] = "-DWITH_GPGME=ON,-DWITH_GPGME=OFF,\
     gnupg gpgme libgpg-error,\
@@ -41,6 +41,7 @@ PACKAGECONFIG[curl] = "-DWITH_CURL=ON,-DWITH_CURL=OFF,curl"
 PACKAGECONFIG[ssl-curl] = "-DWITH_SSLCURL=ON,-DWITH_SSLCURL=OFF,curl openssl"
 PACKAGECONFIG[sha256] = "-DWITH_SHA256=ON,-DWITH_SHA256=OFF"
 PACKAGECONFIG[libsolv] = "-DUSE_SOLVER_LIBSOLV=ON,-DUSE_SOLVER_LIBSOLV=OFF,libsolv"
+PACKAGECONFIG[acl] = "-DUSE_ACL=ON, -DUSE_ACL=OFF, acl"
 
 EXTRA_OECMAKE = "-DWITH_ZSTD=ON"
 EXTRA_OECMAKE:append:class-native = " -DVARDIR=/${@os.path.relpath('${localstatedir}', '${STAGING_DIR_NATIVE}')} -DSYSCONFDIR=/${@os.path.relpath('${sysconfdir}', '${STAGING_DIR_NATIVE}')}"
#1 lore raw

Hi Gyorgy,
I have sent a patch to opkg upstream to fix this issue (
https://lists.yoctoproject.org/g/opkg/message/175 ).
I think it would be better to either:
- add my opkg patch to oe-core and not merge yours
- or to keep your patch and not add mine, but at least add those lines as os-core patch:

libopkg/opkg_archive.c +0 -0
@@ -914,11 +914,11 @@ struct opkg_ar *ar_open_pkg_data_archive(const char

*filename)
ar->extract_flags = ARCHIVE_EXTRACT_OWNER | ARCHIVE_EXTRACT_PERM |
ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_UNLINK |
ARCHIVE_EXTRACT_NO_OVERWRITE;

-#ifdef USE_ACL
+#if USE_ACL

     ar->extract_flags |= ARCHIVE_EXTRACT_ACL;

#endif

What do you think?

Étienne

Quoted 43 lines · Gyorgy Sarvari

During the last opkg update the application's ACL feature was enabled by default, which requires acl recipe as a dependency, however it wasn't enabled in the recipe, making compilation fail when libacl wasn't in the sysroot.

This change adds a PACKAGECONFIG that makes acl an optional dependency, and it is only enabled automatically if "acl" is present in DISTRO_FEATURES.

---
 meta/recipes-devtools/opkg/opkg_0.9.0.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-devtools/opkg/opkg_0.9.0.bb +1 -1
index ed2f36d636..0b3bb3d24c 100644
@@ -31,7 +31,7 @@ inherit cmake pkgconfig ptest
 target_localstatedir := "${localstatedir}"
 OPKGLIBDIR ??= "${target_localstatedir}/lib"
 
-PACKAGECONFIG ??= "libsolv"
+PACKAGECONFIG ??= "libsolv ${@bb.utils.filter('DISTRO_FEATURES', 'acl',

d)}"

 PACKAGECONFIG[gpg] = "-DWITH_GPGME=ON,-DWITH_GPGME=OFF,\
     gnupg gpgme libgpg-error,\
meta/recipes-devtools/opkg/opkg_0.9.0.bb +0 -0
@@ -41,6 +41,7 @@ PACKAGECONFIG[curl] =

"-DWITH_CURL=ON,-DWITH_CURL=OFF,curl"
PACKAGECONFIG[ssl-curl] = "-DWITH_SSLCURL=ON,-DWITH_SSLCURL=OFF,curl
openssl"
PACKAGECONFIG[sha256] = "-DWITH_SHA256=ON,-DWITH_SHA256=OFF" PACKAGECONFIG[libsolv] =
"-DUSE_SOLVER_LIBSOLV=ON,-DUSE_SOLVER_LIBSOLV=OFF,libsolv"

meta/recipes-devtools/opkg/opkg_0.9.0.bb +1 -2
+PACKAGECONFIG[acl] = "-DUSE_ACL=ON, -DUSE_ACL=OFF, acl"
 
 EXTRA_OECMAKE = "-DWITH_ZSTD=ON"
 EXTRA_OECMAKE:append:class-native = "
-DVARDIR=/${@os.path.relpath('${localstatedir}', '${STAGING_DIR_NATIVE}')}
-DSYSCONFDIR=/${@os.path.relpath('${sysconfdir}', '${STAGING_DIR_NATIVE}')}"
#2 lore raw
Quoted 21 lines · Etienne Cordonnier

Hi Gyorgy,
I have sent a patch to opkg upstream to fix this issue
( https://lists.yoctoproject.org/g/opkg/message/175 ).
I think it would be better to either:
- add my opkg patch to oe-core and not merge yours
- or to keep your patch and not add mine, but at least add those lines as os-core patch:

libopkg/opkg_archive.c +0 -0
@@ -914,11 +914,11 @@ struct opkg_ar *ar_open_pkg_data_archive(const
 char *filename)

     ar->extract_flags = ARCHIVE_EXTRACT_OWNER | ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_UNLINK | ARCHIVE_EXTRACT_NO_OVERWRITE;

libopkg/opkg_archive.c +1 -1
-#ifdef USE_ACL
+#if USE_ACL

     ar->extract_flags |= ARCHIVE_EXTRACT_ACL;
 #endif

Quoted 2 lines

What do you think?

Please feel free to send your patch - I just sent this as one possible solution, but I am not particularly attached to it :)

Quoted 52 lines

Étienne

On Thu, Nov 27, 2025 at 6:41 PM Gyorgy Sarvari <[email protected]> wrote:

    During the last opkg update the application's ACL feature was
    enabled by default, which requires acl recipe as a dependency,
    however it wasn't enabled in the recipe, making compilation
    fail when libacl wasn't in the sysroot.

    This change adds a PACKAGECONFIG that makes acl an optional
    dependency, and it is only enabled automatically if "acl"
    is present in DISTRO_FEATURES.

    Signed-off-by: Gyorgy Sarvari <[email protected]>
    ---
     meta/recipes-devtools/opkg/opkg_0.9.0.bb <http://opkg_0.9.0.bb> |
    3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/meta/recipes-devtools/opkg/opkg_0.9.0.bb
    <http://opkg_0.9.0.bb> b/meta/recipes-devtools/opkg/opkg_0.9.0.bb
    <http://opkg_0.9.0.bb>
    index ed2f36d636..0b3bb3d24c 100644
    --- a/meta/recipes-devtools/opkg/opkg_0.9.0.bb <http://opkg_0.9.0.bb>
    +++ b/meta/recipes-devtools/opkg/opkg_0.9.0.bb <http://opkg_0.9.0.bb>
    @@ -31,7 +31,7 @@ inherit cmake pkgconfig ptest
     target_localstatedir := "${localstatedir}"
     OPKGLIBDIR ??= "${target_localstatedir}/lib"

    -PACKAGECONFIG ??= "libsolv"
    +PACKAGECONFIG ??= "libsolv ${@bb.utils.filter('DISTRO_FEATURES',
    'acl', d)}"

     PACKAGECONFIG[gpg] = "-DWITH_GPGME=ON,-DWITH_GPGME=OFF,\
         gnupg gpgme libgpg-error,\
    @@ -41,6 +41,7 @@ PACKAGECONFIG[curl] =
    "-DWITH_CURL=ON,-DWITH_CURL=OFF,curl"
     PACKAGECONFIG[ssl-curl] =
    "-DWITH_SSLCURL=ON,-DWITH_SSLCURL=OFF,curl openssl"
     PACKAGECONFIG[sha256] = "-DWITH_SHA256=ON,-DWITH_SHA256=OFF"
     PACKAGECONFIG[libsolv] =
    "-DUSE_SOLVER_LIBSOLV=ON,-DUSE_SOLVER_LIBSOLV=OFF,libsolv"
    +PACKAGECONFIG[acl] = "-DUSE_ACL=ON, -DUSE_ACL=OFF, acl"

     EXTRA_OECMAKE = "-DWITH_ZSTD=ON"
     EXTRA_OECMAKE:append:class-native = "
    -DVARDIR=/${@os.path.relpath('${localstatedir}',
    '${STAGING_DIR_NATIVE}')}
    -DSYSCONFDIR=/${@os.path.relpath('${sysconfdir}',
    '${STAGING_DIR_NATIVE}')}"
#3 lore raw
Quoted 11 lines · Gyorgy Sarvari via lists.openembedded.org
Quoted 7 lines · Etienne Cordonnier

Hi Gyorgy,
I have sent a patch to opkg upstream to fix this issue
( https://lists.yoctoproject.org/g/opkg/message/175 ).
I think it would be better to either:
- add my opkg patch to oe-core and not merge yours
- or to keep your patch and not add mine, but at least add those lines as os-core patch:

Please feel free to send your patch - I just sent this as one possible solution, but I am not particularly attached to it :)

Option three: both patches are correct :) Regardless of upstream behaviour, adding missing packageconfigs to recipes is always desirable as it lowers the chance of build non-determinism and floating configurations.

Alex

#4 lore raw

"Option three: both patches are correct :)"

I agree in general, but in this particular case both patches are logically interfering with each other (one patch adds a PACKAGECONFIG option for USE_ACL, and the other patch renames USE_ACL to WITH_ACL).
I will wait a couple days in the hope that my opkg patch gets reviewed/merged upstream and then send a backport to oe-core.

Étienne

Quoted 24 lines · Alexander Kanavin
Quoted 5 lines · Gyorgy Sarvari via lists.openembedded.org
Quoted 3 lines · Etienne Cordonnier

Hi Gyorgy,
I have sent a patch to opkg upstream to fix this issue (

https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.yoctoproject.org_g_opkg_message_175&d=DwIBaQ&c=ncDTmphkJTvjIDPh0hpF_4vCHvabgGkICC2epckfdiw&r=AhkbNonVuMIGRfPx_Qj9TsRih1DULJTKUkSGa66m67E&m=skv6vITjRx1biFf-pISzu3mA39-5qXt1NoaexzWpNijLhnsMTj14xC_aJdOuQ9uD&s=tbZyO5O988bK4-b-uyVVvSeBbZ4hTvKf9TQGPps-bhQ&e=
).

Quoted 6 lines
Quoted 4 lines

I think it would be better to either:
- add my opkg patch to oe-core and not merge yours
- or to keep your patch and not add mine, but at least add those lines as os-core patch:

Please feel free to send your patch - I just sent this as one possible solution, but I am not particularly attached to it :)

Option three: both patches are correct :) Regardless of upstream behaviour, adding missing packageconfigs to recipes is always desirable as it lowers the chance of build non-determinism and floating configurations.

Alex