Skip to contentSkip to conversation

package/mtd: add host-acl dependency for host

PATCH Superseded Antoine Tenart 4 participants 8 messages Oct 6, 2020 – Oct 8, 2020 Journalling flash file system V2 (JFFS2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 package/mtd: add host-acl dependency for host

When compiling the host version of mtd, --with-jffs and --with-ubifs are always set, meaning --with-xattr is set by default. The xattr support only work if 'sys/acl.h' is available, otherwise the feature is silently dropped (a warning is shown during the configuration step).

This patch adds a dependency on host-acl for host-mtd, so that the xattr feature is correctly supported. Logic to have xattr support is already there and working for the non-host flavour.

---
 package/mtd/mtd.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/mtd/mtd.mk +1 -1
index 1186fa52d552..9f259b35d906 100644
@@ -53,7 +53,7 @@ else
 MTD_CONF_OPTS += --without-xattr
 endif
 
-HOST_MTD_DEPENDENCIES = host-zlib host-lzo host-util-linux host-zstd
+HOST_MTD_DEPENDENCIES = host-acl host-zlib host-lzo host-util-linux host-zstd
 HOST_MTD_CONF_OPTS = \
 	--with-jffs \
 	--with-ubifs \
Signature · 1 line
2.26.2
#1 lore raw

PATCH v2 2/2 fs/jffs2: copy xattrs

This patch sets the --with-xattr option when generating an image with mkfs.jffs2 if BR2_PACKAGE_LIBSELINUX is selected, so that SELinux security contexts will be kept and available in jffs2 images.

---

Since v1:
- s/BR2_PACKAGE_REFPOLICY/BR2_PACKAGE_LIBSELINUX/

 fs/jffs2/jffs2.mk | 4 ++++
 1 file changed, 4 insertions(+)
fs/jffs2/jffs2.mk +4 -0
index 2adbc2320e38..d93ba58ded6e 100644
@@ -35,6 +35,10 @@ JFFS2_OPTS += -n
 SUMTOOL_OPTS += -n
 endif
 
+ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
+JFFS2_OPTS += --with-xattr
+endif
+
 ROOTFS_JFFS2_DEPENDENCIES = host-mtd
 
 ifneq ($(BR2_TARGET_ROOTFS_JFFS2_SUMMARY),)
Signature · 1 line
2.26.2
#3 lore raw

PATCH v2 2/2 fs/jffs2: copy xattrs

In reply to Antoine Tenart

Antoine, All,

On 2020-10-06 17:37 +0200, Antoine Tenart spake thusly:

Quoted 18 lines

This patch sets the --with-xattr option when generating an image with mkfs.jffs2 if BR2_PACKAGE_LIBSELINUX is selected, so that SELinux security contexts will be kept and available in jffs2 images.

---

Since v1:
- s/BR2_PACKAGE_REFPOLICY/BR2_PACKAGE_LIBSELINUX/

 fs/jffs2/jffs2.mk | 4 ++++
 1 file changed, 4 insertions(+)
fs/jffs2/jffs2.mk +0 -0
index 2adbc2320e38..d93ba58ded6e 100644

fs/jffs2/jffs2.mk JFFS2_OPTS += -n · line 40

Quoted 6 lines
fs/jffs2/jffs2.mk +3 -0
@@ -35,6 +35,10 @@ JFFS2_OPTS += -n
 SUMTOOL_OPTS += -n
 endif
 
+ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
+JFFS2_OPTS += --with-xattr
+endif

Does that means that, if people are using extended attributes in their device tables [0], then their jffs2 filesystem will not carry those xattrs?

[0] https://buildroot.org/downloads/manual/manual.html#makedev-syntax

Basically, I fiond it dubious that a filesystem option depens on a package being enabled or not.

Regards,
Yann E. MORIN.

Quoted 10 lines
fs/jffs2/jffs2.mk +0 -0
 ROOTFS_JFFS2_DEPENDENCIES = host-mtd
 
 ifneq ($(BR2_TARGET_ROOTFS_JFFS2_SUMMARY),)
Signature · 6 lines
2.26.2

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#4 lore raw

PATCH v2 2/2 fs/jffs2: copy xattrs

Quoted 3 lines · On Tue, 6 Oct 2020 23:09:02 +0200 "Yann E. MORIN" <[email protected]>…

Does that means that, if people are using extended attributes in their device tables [0], then their jffs2 filesystem will not carry those xattrs?

Correct.

Quoted 2 lines

Basically, I fiond it dubious that a filesystem option depens on a package being enabled or not.

True, but what do you suggest? That we unconditionally enable xattr support when generating a JFFS2 image?

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#5 lore raw

PATCH v2 2/2 fs/jffs2: copy xattrs

Hello,

Quoting Thomas Petazzoni (2020-10-06 23:14:02)

Quoted 8 lines
Quoted 2 lines · On Tue, 6 Oct 2020 23:09:02 +0200 "Yann E. MORIN" <[email protected]>…

Basically, I fiond it dubious that a filesystem option depens on a package being enabled or not.

True, but what do you suggest? That we unconditionally enable xattr support when generating a JFFS2 image?

Enabling xattr support unconditionally would be consistent with what is done with ext images (mkfs.extX does copy the xattr by default unless explicitly disabled).

Should I post a v3 with the condition on BR2_PACKAGE_LIBSELINUX removed?

Thanks,
Antoine

Signature · 3 lines
Antoine T?nart, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#6 lore raw

PATCH v2 2/2 fs/jffs2: copy xattrs

Quoted 7 lines · On Thu, 08 Oct 2020 09:49:34 +0200 Antoine Tenart <[email protected]>…

Quoting Thomas Petazzoni (2020-10-06 23:14:02)

Quoted 6 lines
Quoted 2 lines · On Tue, 6 Oct 2020 23:09:02 +0200 "Yann E. MORIN" <[email protected]>…

Basically, I fiond it dubious that a filesystem option depens on a package being enabled or not.

Quoted 8 lines
Quoted 2 lines

True, but what do you suggest? That we unconditionally enable xattr support when generating a JFFS2 image?

Enabling xattr support unconditionally would be consistent with what is done with ext images (mkfs.extX does copy the xattr by default unless explicitly disabled).

Should I post a v3 with the condition on BR2_PACKAGE_LIBSELINUX removed?

I would say yes. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#7 lore raw

PATCH v2 1/2 package/mtd: add host-acl dependency for host

In reply to Antoine Tenart

Antoine,

Quoted 11 lines · Antoine Tenart

When compiling the host version of mtd, --with-jffs and --with-ubifs are always set, meaning --with-xattr is set by default. The xattr support only work if 'sys/acl.h' is available, otherwise the feature is silently dropped (a warning is shown during the configuration step).

This patch adds a dependency on host-acl for host-mtd, so that the xattr feature is correctly supported. Logic to have xattr support is already there and working for the non-host flavour.

Good catch, I think we noticed this internally and never sent the patch.