Skip to contentSkip to conversation

mtd-utils: disable xattr if DISTRO_FEATURES doesn't contain acl

PATCH In review Andrea Adami 6 participants 13 messages Aug 22, 2015 – Aug 27, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mtd-utils: disable xattr if DISTRO_FEATURES doesn't contain acl

After commit 24fde4d do_compile fails:

| mkfs.jffs2.c:70:21: fatal error: sys/acl.h: No such file or directory | #include <sys/acl.h>

This is a missing dependency on acl.
To fix this we add a check to disable xattr when acl is not in DISTRO_FEATURES.

---
 meta/recipes-devtools/mtd/mtd-utils_git.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-devtools/mtd/mtd-utils_git.bb +2 -1
index 8d4892a..6a388c8 100644
@@ -19,7 +19,8 @@ SRC_URI = "git://git.infradead.org/mtd-utils.git \
 
 S = "${WORKDIR}/git/"
 
-EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} -I${S}/include' 'BUILDDIR=${S}'"
+DISABLE_XATTR = "${@bb.utils.contains('DISTRO_FEATURES', 'acl', '', '-DWITHOUT_XATTR', d)}"
+EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} -I${S}/include ${DISABLE_XATTR}' 'BUILDDIR=${S}'"
 
 do_install () {
 	oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} INCLUDEDIR=${includedir}
Signature · 1 line
1.9.1
#1 lore raw
Quoted 8 lines · Andrea Adami

After commit 24fde4d do_compile fails:

| mkfs.jffs2.c:70:21: fatal error: sys/acl.h: No such file or directory | #include <sys/acl.h>

This is a missing dependency on acl.
To fix this we add a check to disable xattr when acl is not in DISTRO_FEATURES.

I'm unsure whether checking for acl is the right approach. If "xattr" was added to DISTRO_FEATURES, I'd expect the xattr support in mtd-utils to be enabled, even if that creates some additional dependencies.

Signature · 6 lines
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
#2 lore raw
In reply to Andrea Adami
Quoted 9 lines

-----Original Message-----
From: [email protected] [mailto:openembedded-core- [email protected]] On Behalf Of Andrea Adami
Sent: Sunday, August 23, 2015 5:59 AM
To: [email protected]
Subject: [OE-core] [PATCH v2] mtd-utils: disable xattr if DISTRO_FEATURES doesn't contain acl

Quoted 7 lines

After commit 24fde4d do_compile fails:

| mkfs.jffs2.c:70:21: fatal error: sys/acl.h: No such file or directory | #include <sys/acl.h>

This is a missing dependency on acl.
To fix this we add a check to disable xattr when acl is not in DISTRO_FEATURES.

I think you should check the xattr distro feature, but only checking the DISTRO_FEATURES can't ensure the dependency satisfied, why not use the PACKAGECONFIG, something like:

PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'xattr', '', d)}" PACKAGECONFIG[xattr] = ", -DWITHOUT_XATTR,attr acl,"

Thanks,
Jackie

Quoted 32 lines
---
 meta/recipes-devtools/mtd/mtd-utils_git.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-devtools/mtd/mtd- renamed from meta/recipes-devtools/mtd/mtd-utils_git.bb +0 -0

utils_git.bb
index 8d4892a..6a388c8 100644

meta/recipes-devtools/mtd/mtd-utils_git.bb +0 -1
@@ -19,7 +19,8 @@ SRC_URI = "git://git.infradead.org/mtd-utils.git \
 
 S = "${WORKDIR}/git/"
 
-EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} -I${S}/include'

'BUILDDIR=${S}'"

meta/recipes-devtools/mtd/mtd-utils_git.bb +2 -0
+DISABLE_XATTR = "${@bb.utils.contains('DISTRO_FEATURES', 'acl', '', '-DWITHOUT_XATTR', d)}"
+EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} -I${S}/include

${DISABLE_XATTR}' 'BUILDDIR=${S}'"

do_install () {
oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir}
INCLUDEDIR=${includedir}
--
1.9.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#3 lore raw
Quoted 13 lines · Jie (Jackie)
Quoted 13 lines

-----Original Message-----
From: [email protected] [mailto:openembedded-core- [email protected]] On Behalf Of Andrea Adami
Sent: Sunday, August 23, 2015 5:59 AM
To: [email protected]
Subject: [OE-core] [PATCH v2] mtd-utils: disable xattr if DISTRO_FEATURES doesn't contain acl

After commit 24fde4d do_compile fails:

| mkfs.jffs2.c:70:21: fatal error: sys/acl.h: No such file or directory | #include <sys/acl.h>

Quoted 8 lines
Quoted 2 lines

This is a missing dependency on acl.
To fix this we add a check to disable xattr when acl is not in DISTRO_FEATURES.

I think you should check the xattr distro feature, but only checking the DISTRO_FEATURES can't ensure the dependency satisfied, why not use the PACKAGECONFIG, something like:

PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'xattr', '', d)}" PACKAGECONFIG[xattr] = ", -DWITHOUT_XATTR,attr acl,"

I agree that we should check the xattr distro feature. The actual patch is a bit more complex, though, because PACKAGECONFIG cannot influence EXTRA_OEMAKE, can it?

I'll reply with a patch that worked for me.

Signature · 6 lines
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
#4 lore raw

PATCH 1/1 mtd-utils: add xattr PACKAGECONFIG and fix acl dependency

The unconditional removal of -DWITHOUT_XATTR accidentally introduced a compile-time dependency on "acl", because "sys/acl.h" gets included. This caused random compile failures.

To fix this, we introduce a proper PACKAGECONFIG for the "xattr" support, with the distro's "xattr" feature determining the default. Setting the define must be done with custom code because PACKAGECONFIG can only influence configure parameters.

The "acl" distro feature is not checked because although enabling "xattr" support now triggers a build of acl, nothing from it will not get included in the resulting target image. This seems more suitable than not enabling xattr support in mtd-utils when acl support in the distro is disabled.

---
 meta/recipes-devtools/mtd/mtd-utils_git.bb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
meta/recipes-devtools/mtd/mtd-utils_git.bb +7 -1
index 8d4892a..17dca77 100644
@@ -19,7 +19,13 @@ SRC_URI = "git://git.infradead.org/mtd-utils.git \
 
 S = "${WORKDIR}/git/"
 
-EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} -I${S}/include' 'BUILDDIR=${S}'"
+# xattr support creates an additional compile-time dependency on acl because
+# the sys/acl.h header is needed. libacl is not needed and thus enabling xattr
+# regardless whether acl is enabled or disabled in the distro should be okay.
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'xattr', '', d)}"
+PACKAGECONFIG[xattr] = ",,acl,"
+
+EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} ${@bb.utils.contains('PACKAGECONFIG', 'xattr', '', '-DWITHOUT_XATTR', d)} -I${S}/include' 'BUILDDIR=${S}'"
 
 do_install () {
 	oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} INCLUDEDIR=${includedir}
Signature · 1 line
2.1.4
Acked-by on v1 1/1
#5 lore raw

Re: [PATCH 1/1] mtd-utils: add xattr PACKAGECONFIG and fix acl dependency

While I haven't tried this, it is exactly what I would have expected.

Quoted 40 lines · Patrick Ohly

The unconditional removal of -DWITHOUT_XATTR accidentally introduced a compile-time dependency on "acl", because "sys/acl.h" gets included. This caused random compile failures.

To fix this, we introduce a proper PACKAGECONFIG for the "xattr" support, with the distro's "xattr" feature determining the default. Setting the define must be done with custom code because PACKAGECONFIG can only influence configure parameters.

The "acl" distro feature is not checked because although enabling "xattr" support now triggers a build of acl, nothing from it will not get included in the resulting target image. This seems more suitable than not enabling xattr support in mtd-utils when acl support in the distro is disabled.

---
 meta/recipes-devtools/mtd/mtd-utils_git.bb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
meta/recipes-devtools/mtd/mtd-utils_git.bb +7 -1
index 8d4892a..17dca77 100644
@@ -19,7 +19,13 @@ SRC_URI = "git://git.infradead.org/mtd-utils.git \
 
 S = "${WORKDIR}/git/"
 
-EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} -I${S}/include' 'BUILDDIR=${S}'"
+# xattr support creates an additional compile-time dependency on acl because
+# the sys/acl.h header is needed. libacl is not needed and thus enabling xattr
+# regardless whether acl is enabled or disabled in the distro should be okay.
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'xattr', '', d)}"
+PACKAGECONFIG[xattr] = ",,acl,"
+
+EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} ${@bb.utils.contains('PACKAGECONFIG', 'xattr', '', '-DWITHOUT_XATTR', d)} -I${S}/include' 'BUILDDIR=${S}'"
 
 do_install () {
 	oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} INCLUDEDIR=${includedir}
#6 lore raw

Re: [PATCH 1/1] mtd-utils: add xattr PACKAGECONFIG and fix acl dependency

In reply to Patrick Ohly
Quoted 4 lines · Patrick Ohly

The unconditional removal of -DWITHOUT_XATTR accidentally introduced a compile-time dependency on "acl", because "sys/acl.h" gets included. This caused random compile failures.

Quoted 8 lines

To fix this, we introduce a proper PACKAGECONFIG for the "xattr" support, with the distro's "xattr" feature determining the default. Setting the define must be done with custom code because PACKAGECONFIG can only influence configure parameters.

The "acl" distro feature is not checked because although enabling "xattr" support now triggers a build of acl, nothing from it will not get included in the resulting target image.

Typo?

Quoted 36 lines

This seems more suitable
than not enabling xattr support in mtd-utils when acl support in the distro is disabled.

---
 meta/recipes-devtools/mtd/mtd-utils_git.bb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
meta/recipes-devtools/mtd/mtd-utils_git.bb +7 -2
index 8d4892a..17dca77 100644
@@ -19,7 +19,13 @@ SRC_URI = "git://git.infradead.org/mtd-utils.git \
 
 S = "${WORKDIR}/git/"
 
-EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} -I${S}/include' 'BUILDDIR=${S}'"
+# xattr support creates an additional compile-time dependency on acl because
+# the sys/acl.h header is needed. libacl is not needed and thus enabling xattr
+# regardless whether acl is enabled or disabled in the distro should be okay.
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'xattr', '', d)}"
+PACKAGECONFIG[xattr] = ",,acl,"
+
+EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} ${@bb.utils.contains('PACKAGECONFIG', 'xattr', '', '-DWITHOUT_XATTR', d)} -I${S}/include' 'BUILDDIR=${S}'"
 
 do_install () {
        oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} INCLUDEDIR=${includedir}
--

2.1.4

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#8 lore raw

Re: [PATCH 1/1] mtd-utils: add xattr PACKAGECONFIG and fix acl dependency

In reply to Patrick Ohly
Quoted 16 lines · Patrick Ohly

The unconditional removal of -DWITHOUT_XATTR accidentally introduced a compile-time dependency on "acl", because "sys/acl.h" gets included. This caused random compile failures.

To fix this, we introduce a proper PACKAGECONFIG for the "xattr" support, with the distro's "xattr" feature determining the default. Setting the define must be done with custom code because PACKAGECONFIG can only influence configure parameters.

The "acl" distro feature is not checked because although enabling "xattr" support now triggers a build of acl, nothing from it will not get included in the resulting target image. This seems more suitable than not enabling xattr support in mtd-utils when acl support in the distro is disabled.

Review

Quoted 6 lines
---
 meta/recipes-devtools/mtd/mtd-utils_git.bb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/meta/recipes-devtools/mtd/mtd-utils_git.bb

meta/recipes-devtools/mtd/mtd-utils_git.bb SRC_URI = "git://git.infradead.org/mtd-utils.git \ · line 22

Quoted 8 lines

index 8d4892a..17dca77 100644

meta/recipes-devtools/mtd/mtd-utils_git.bb +0 -1
@@ -19,7 +19,13 @@ SRC_URI = "git://git.infradead.org/mtd-utils.git \
 
 S = "${WORKDIR}/git/"
 
-EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}'

'CFLAGS=${CFLAGS} -I${S}/include' 'BUILDDIR=${S}'"

meta/recipes-devtools/mtd/mtd-utils_git.bb SRC_URI = "git://git.infradead.org/mtd-utils.git \ · line 22

Quoted 1 line
meta/recipes-devtools/mtd/mtd-utils_git.bb +1 -0
+# xattr support creates an additional compile-time dependency on acl

because

meta/recipes-devtools/mtd/mtd-utils_git.bb SRC_URI = "git://git.infradead.org/mtd-utils.git \ · line 23

Quoted 1 line
meta/recipes-devtools/mtd/mtd-utils_git.bb +1 -0
+# the sys/acl.h header is needed. libacl is not needed and thus enabling

xattr

meta/recipes-devtools/mtd/mtd-utils_git.bb SRC_URI = "git://git.infradead.org/mtd-utils.git \ · line 24

Quoted 1 line
meta/recipes-devtools/mtd/mtd-utils_git.bb +1 -0
+# regardless whether acl is enabled or disabled in the distro should be

okay.

meta/recipes-devtools/mtd/mtd-utils_git.bb SRC_URI = "git://git.infradead.org/mtd-utils.git \ · line 25

Quoted 1 line
meta/recipes-devtools/mtd/mtd-utils_git.bb +1 -0
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'xattr',

'xattr', '', d)}"

meta/recipes-devtools/mtd/mtd-utils_git.bb SRC_URI = "git://git.infradead.org/mtd-utils.git \

Quoted 3 lines
meta/recipes-devtools/mtd/mtd-utils_git.bb +3 -0
+PACKAGECONFIG[xattr] = ",,acl,"
+
+EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}'

'CFLAGS=${CFLAGS} ${@bb.utils.contains('PACKAGECONFIG', 'xattr', '', '-DWITHOUT_XATTR', d)} -I${S}/include' 'BUILDDIR=${S}'"

Quoted 1 line

Do I see a spurious " in the middle

Quoted 2 lines
 do_install () {
        oe_runmake install DESTDIR=${D} SBINDIR=${sbindir}

MANDIR=${mandir} INCLUDEDIR=${includedir}

Quoted 8 lines

--
2.1.4

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#12 lore raw
In reply to Patrick Ohly
Quoted 30 lines

-----Original Message-----
From: Patrick Ohly [mailto:[email protected]]
Sent: Thursday, August 27, 2015 12:04 AM
To: Huang, Jie (Jackie); Hatle, Mark
Cc: Andrea Adami; [email protected]
Subject: Re: [OE-core] [PATCH v2] mtd-utils: disable xattr if DISTRO_FEATURES doesn't contain acl

Quoted 12 lines · Jie (Jackie)
Quoted 12 lines

-----Original Message-----
From: [email protected] [mailto:openembedded-core- [email protected]] On Behalf Of Andrea Adami
Sent: Sunday, August 23, 2015 5:59 AM
To: [email protected]
Subject: [OE-core] [PATCH v2] mtd-utils: disable xattr if DISTRO_FEATURES doesn't contain acl

After commit 24fde4d do_compile fails:

Quoted 8 lines
Quoted 5 lines

| mkfs.jffs2.c:70:21: fatal error: sys/acl.h: No such file or | directory #include <sys/acl.h>

This is a missing dependency on acl.
To fix this we add a check to disable xattr when acl is not in DISTRO_FEATURES.

I think you should check the xattr distro feature, but only checking
the DISTRO_FEATURES can't ensure the dependency satisfied, why not use the PACKAGECONFIG,

Quoted 7 lines

something like:

Quoted 3 lines

PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'xattr', '', d)}" PACKAGECONFIG[xattr] = ", -DWITHOUT_XATTR,attr acl,"

I agree that we should check the xattr distro feature. The actual patch is a bit more complex, though, because PACKAGECONFIG cannot influence EXTRA_OEMAKE, can it?

Oh, I didn't notice it was for EXTRA_OEMAKE.

Quoted 2 lines

I'll reply with a patch that worked for me.

I see your patch, it looks fine to me.

Thanks,
Jackie

Quoted 9 lines

--
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although I am an employee of Intel, the statements I make here in no way represent Intel's position on the issue, nor am I authorized to speak on behalf of Intel on this matter.

#9 lore raw

Re: [PATCH 1/1] mtd-utils: add xattr PACKAGECONFIG and fix acl dependency

In reply to Khem Raj
Quoted 6 lines · Khem Raj
Quoted 2 lines · Patrick Ohly

+EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} ${@bb.utils.contains('PACKAGECONFIG', 'xattr', '', '-DWITHOUT_XATTR', d)} -I${S}/include' 'BUILDDIR=${S}'"

Do I see a spurious " in the middle

The one in bb.utils.contains()? That is there intentionally: it's for the "xattr enabled" case, in which case nothing gets added to EXTRA_OEMAKE.

Signature · 6 lines
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
#7 lore raw

Re: [PATCH 1/1] mtd-utils: add xattr PACKAGECONFIG and fix acl dependency

In reply to Andre McCurdy
Quoted 10 lines · Andre McCurdy
Quoted 9 lines · Patrick Ohly

The unconditional removal of -DWITHOUT_XATTR accidentally introduced a compile-time dependency on "acl", because "sys/acl.h" gets included. This caused random compile failures.

To fix this, we introduce a proper PACKAGECONFIG for the "xattr" support, with the distro's "xattr" feature determining the default. Setting the define must be done with custom code because PACKAGECONFIG can only influence configure parameters.

Quoted 5 lines
Quoted 3 lines

The "acl" distro feature is not checked because although enabling "xattr" support now triggers a build of acl, nothing from it will not get included in the resulting target image.

Typo?

Yes, the "not" needs to be removed. Can whoever merges the patch fix that or should I send a revised version?

Signature · 6 lines
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
#10 lore raw

Re: [PATCH 1/1] mtd-utils: add xattr PACKAGECONFIG and fix acl dependency

In reply to Patrick Ohly
Quoted 3 lines · Patrick Ohly

The one in bb.utils.contains()? That is there intentionally: it's for the "xattr enabled" case, in which case nothing gets added to EXTRA_OEMAKE.

is it required to have extra " ?
can it work without it

#11 lore raw

Re: [PATCH 1/1] mtd-utils: add xattr PACKAGECONFIG and fix acl dependency

Quoted 7 lines · Khem Raj
Quoted 3 lines · Patrick Ohly

The one in bb.utils.contains()? That is there intentionally: it's for the "xattr enabled" case, in which case nothing gets added to EXTRA_OEMAKE.

is it required to have extra " ?
can it work without it

bb.utils.contains() expects exactly 5 parameters and has no defaults, so no, that empty string cannot be omitted.

Signature · 6 lines
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.