[PATCH] Add options to enable support for acl and xattr

30 views
Skip to first unread message

Piotr Łobacz

unread,
Jul 10, 2023, 4:50:34 AM7/10/23
to opkg-...@googlegroups.com, Maciej Liszewski, Piotr Łobacz
From: Maciej Liszewski <m.lis...@welotec.com>

The libarchive library, which is being used by opkg supports ACLs
and xattr already.

Mor informations can be read at this link:
https://github.com/libarchive/libarchive/pull/691

Signed-off-by: Maciej Liszewski <m.lis...@welotec.com>
Signed-off-by: Piotr Łobacz <p.lo...@welotec.com>
---
configure.ac | 12 ++++++++++++
libopkg/opkg_archive.c | 8 ++++++++
2 files changed, 20 insertions(+)

diff --git a/configure.ac b/configure.ac
index 389a818..46949cd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -158,6 +158,18 @@ return OPENSSL_VERSION_NUMBER; ],
AC_SUBST(OPENSSL_LIBS)
fi

+# check for ACL support
+AC_ARG_WITH([acl], [AS_HELP_STRING([--with-acl], [Enable ACL support])])
+if test "x$with_acl" = "xyes"; then
+ AC_DEFINE([ENABLE_ACL], [1], [Enable ACL support])
+fi
+
+# check for xattr support
+AC_ARG_WITH([xattr], [AS_HELP_STRING([--with-xattr], [Enable xattr support])])
+if test "x$with_xattr" = "xyes"; then
+ AC_DEFINE([ENABLE_XATTR], [1], [Enable xattr support])
+fi
+
# check for libsolv solver
AC_ARG_WITH(libsolv, AC_HELP_STRING([--with-libsolv], [Use libsolv solver support.
]), [], [with_libsolv="no"])
diff --git a/libopkg/opkg_archive.c b/libopkg/opkg_archive.c
index 03a4afb..8dd902d 100644
--- a/libopkg/opkg_archive.c
+++ b/libopkg/opkg_archive.c
@@ -912,6 +912,14 @@ 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 ENABLE_ACL
+ ar->extract_flags |= ARCHIVE_EXTRACT_ACL;
+#endif
+
+#ifdef ENABLE_XATTR
+ ar->extract_flags |= ARCHIVE_EXTRACT_FFLAGS | ARCHIVE_EXTRACT_XATTR;
+#endif
+
if (opkg_config->ignore_uid)
ar->extract_flags &= ~ARCHIVE_EXTRACT_OWNER;

--
2.34.1

Alex Stewart

unread,
Jul 11, 2023, 12:06:21 PM7/11/23
to Piotr Łobacz, Maciej Liszewski, opkg-...@googlegroups.com
Hey Piotr,

Thanks for submitting this patchset. It's a rare day that someone
actually solves their own bugs around here. :)

This patch, and the sibling patch to opkg-build, both look good to me.

Since this is new functionality, I would normally ask that we include
some tests to validate that ACLs and xattrs are actually being
respected. But I'm not sure how we would check in the current test
framework that either feature has been enabled in the projection
configuration. And since the whole test framework deserves to be revised
anyway, I'm fine skipping that testing for now.


I'm planning to cut a new release of opkg and opkg-utils this week,
based on the last 6 months of development. My plan is to not include
these patches in that release. But as soon as I submit the patchset to
OE-core to upgrade the opkg recipes to the new version, I'll include
these commits as .patches to the recipes, so you'll get them for free.
Let me know if you have any objections to that plan.

Thanks,
Alex Stewart
Software Engineer - NI Real-Time OS
NI (National Instruments)

alex.s...@ni.com

Piotr Łobacz

unread,
Jul 11, 2023, 2:52:38 PM7/11/23
to Alex Stewart, Maciej Liszewski, opkg-...@googlegroups.com
Hi Alex,
Generally I have no objections, moreover Ross asked me to add them as patches to oe-core so I may add them becausei was already doing that but haven’t finished due to other duties….

With tests I dunno either how to do it. Ross has given some guidelines for yocto image but this is completly different stuff.

P.S. Yeah rare days, I would says that we are living in curious times if you know what I mean😜

BR
Piotr

Wysyłane z aplikacji Outlook dla systemu iOS

Od: Alex Stewart <alex.s...@ni.com>
Wysłane: Tuesday, July 11, 2023 6:06:12 PM
Do: Piotr Łobacz <p.lo...@welotec.com>
DW: Maciej Liszewski <m.lis...@welotec.com>; opkg-...@googlegroups.com <opkg-...@googlegroups.com>
Temat: Re: [opkg-devel] [PATCH] Add options to enable support for acl and xattr
 
Hey Piotr,

Thanks for submitting this patchset. It's a rare day that someone
actually solves their own bugs around here. :)

This patch, and the sibling patch to opkg-build, both look good to me.

Since this is new functionality, I would normally ask that we include
some tests to validate that ACLs and xattrs are actually being
respected. But I'm not sure how we would check in the current test
framework that either feature has been enabled in the projection
configuration. And since the whole test framework deserves to be revised
anyway, I'm fine skipping that testing for now.


I'm planning to cut a new release of opkg and opkg-utils this week,
based on the last 6 months of development. My plan is to not include
these patches in that release. But as soon as I submit the patchset to
OE-core to upgrade the opkg recipes to the new version, I'll include
these commits as .patches to the recipes, so you'll get them for free.
Let me know if you have any objections to that plan.

Thanks,

On 7/10/23 04:50, Piotr Łobacz wrote:
> From: Maciej Liszewski <m.lis...@welotec.com>
>
> The libarchive library, which is being used by opkg supports ACLs
> and xattr already.
>
> Mor informations can be read at this link:

Alex Stewart

unread,
Jul 12, 2023, 3:49:55 PM7/12/23
to Piotr Łobacz, Maciej Liszewski, opkg-...@googlegroups.com
Pulled this PR to opkg as commit
ef743b75745939df210a9e6a70a44d69181ef05a [1].

[1]
https://git.yoctoproject.org/opkg/commit/?id=ef743b75745939df210a9e6a70a44d69181ef05a

Thanks!

On 7/10/23 04:50, Piotr Łobacz wrote:

Piotr Łobacz

unread,
Jul 19, 2023, 10:08:36 AM7/19/23
to Alex Stewart, Maciej Liszewski, opkg-...@googlegroups.com
Hi Alex I have posted a new message on yocto regarding this change of environment variables.

I'd appreciate it if you could take a look at your free time on my suspicions.

BR
Piotr

Od: Alex Stewart <alex.s...@ni.com>
Wysłane: środa, 12 lipca 2023 21:49

Do: Piotr Łobacz <p.lo...@welotec.com>
DW: Maciej Liszewski <m.lis...@welotec.com>; opkg-...@googlegroups.com <opkg-...@googlegroups.com>
Temat: Re: [opkg-devel] [PATCH] Add options to enable support for acl and xattr
Pulled this PR to opkg as commit
ef743b75745939df210a9e6a70a44d69181ef05a [1].

[1]


Thanks!

On 7/10/23 04:50, Piotr Łobacz wrote:
> From: Maciej Liszewski <m.lis...@welotec.com>
>
> The libarchive library, which is being used by opkg supports ACLs
> and xattr already.
>
> Mor informations can be read at this link:
Reply all
Reply to author
Forward
0 new messages