Skip to contentSkip to conversation

package/erofs-utils: bump version to 1.2

PATCH New Gao Xiang 2 participants 2 messages Dec 17, 2020 – Dec 29, 2020 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Gao Xiang

author
#1 lore raw

PATCH 1/1 package/erofs-utils: bump version to 1.2

- add selinux support;
- add erofsfuse support;
- add 0001-erofs-utils-fix-multiple-definition-of-sbi.patch [1];
- add 0002-erofs-utils-fuse-fix-linking-when-using-with-selinux.patch [2];
- add 0003-erofs-utils-fuse-disable-backtrace-if-unsupported.patch.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/patch/?id=6c938b755682629a26f85e5540f40c0d316130ed
[2] https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/patch/?id=f1f9659e98ea925a100e50332309955f5b2b4234

---
build regression fixes are included.

 ...utils-fix-multiple-definition-of-sbi.patch | 62 ++++++++++++++
 ...-fix-linking-when-using-with-selinux.patch | 33 ++++++++
 ...use-disable-backtrace-if-unsupported.patch | 82 +++++++++++++++++++
 package/erofs-utils/Config.in                 | 11 +++
 package/erofs-utils/erofs-utils.hash          |  2 +-
 package/erofs-utils/erofs-utils.mk            | 18 +++-
 6 files changed, 205 insertions(+), 3 deletions(-)
 create mode 100644 package/erofs-utils/0001-erofs-utils-fix-multiple-definition-of-sbi.patch
 create mode 100644 package/erofs-utils/0002-erofs-utils-fuse-fix-linking-when-using-with-selinux.patch
 create mode 100644 package/erofs-utils/0003-erofs-utils-fuse-disable-backtrace-if-unsupported.patch
package/erofs-utils/0001-erofs-utils-fix-multiple-definition-of-sbi.patch new file +62 -0
new file mode 100644
index 000000000000..374c9ab72db4
@@ -0,0 +1,62 @@
+From 6c938b755682629a26f85e5540f40c0d316130ed Mon Sep 17 00:00:00 2001
+From: Gao Xiang <[email protected]>
+Date: Tue, 8 Dec 2020 18:57:41 +0800
+Subject: erofs-utils: fix multiple definition of `sbi'
+
+As nl6720 reported [1], lib/inode.o (mkfs) and lib/super.o (erofsfuse)
+could be compiled together by some options. Fix it now.
+
+[1] https://lore.kernel.org/r/10789285.Na0ui7I3VY at walnut
+
+Link: https://lore.kernel.org/r/20201208105741.9614-1-hsiangkao at aol.com
+Fixes: 5e35b75ad499 ("erofs-utils: introduce fuse implementation")
+Reported-by: nl6720 <[email protected]>
+Reviewed-by: Li Guifu <[email protected]>
+Signed-off-by: Gao Xiang <[email protected]>
+---
+ lib/config.c | 1 +
+ lib/inode.c  | 2 --
+ lib/super.c  | 2 --
+ 3 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/lib/config.c b/lib/config.c
+index 3155112..3ecd481 100644
+--- a/lib/config.c
++++ b/lib/config.c
+@@ -11,6 +11,7 @@
+ #include "erofs/internal.h"
+ 
+ struct erofs_configure cfg;
++struct erofs_sb_info sbi;
+ 
+ void erofs_init_configure(void)
+ {
+diff --git a/lib/inode.c b/lib/inode.c
+index 3d634fc..0c4839d 100644
+--- a/lib/inode.c
++++ b/lib/inode.c
+@@ -22,8 +22,6 @@
+ #include "erofs/xattr.h"
+ #include "erofs/exclude.h"
+ 
+-struct erofs_sb_info sbi;
+-
+ #define S_SHIFT                 12
+ static unsigned char erofs_ftype_by_mode[S_IFMT >> S_SHIFT] = {
+ 	[S_IFREG >> S_SHIFT]  = EROFS_FT_REG_FILE,
+diff --git a/lib/super.c b/lib/super.c
+index 2d36692..025cefe 100644
+--- a/lib/super.c
++++ b/lib/super.c
+@@ -11,8 +11,6 @@
+ #include "erofs/io.h"
+ #include "erofs/print.h"
+ 
+-struct erofs_sb_info sbi;
+-
+ static bool check_layout_compatibility(struct erofs_sb_info *sbi,
+ 				       struct erofs_super_block *dsb)
+ {
+-- 
+cgit 1.2.3-1.el7
+
package/erofs-utils/0002-erofs-utils-fuse-fix-linking-when-using-with-selinux.patch new file +33 -0
new file mode 100644
index 000000000000..bea3168b53da
@@ -0,0 +1,33 @@
+From f1f9659e98ea925a100e50332309955f5b2b4234 Mon Sep 17 00:00:00 2001
+From: David Michael <[email protected]>
+Date: Thu, 10 Dec 2020 21:29:43 -0500
+Subject: erofs-utils: fuse: fix linking when using --with-selinux
+
+The libselinux functions selabel_open and selabel_close are called
+by lib/config.c, so include libselinux in CFLAGS and LIBS to fix
+building erofsfuse.
+
+Link: https://lore.kernel.org/r/87360dnkh4.fsf at gmail.com
+Signed-off-by: David Michael <[email protected]>
+Reviewed-and-tested-by: Li Guifu <[email protected]>
+Signed-off-by: Gao Xiang <[email protected]>
+---
+ fuse/Makefile.am | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/fuse/Makefile.am b/fuse/Makefile.am
+index f14f6fd..e7757bc 100644
+--- a/fuse/Makefile.am
++++ b/fuse/Makefile.am
+@@ -5,6 +5,6 @@ AUTOMAKE_OPTIONS = foreign
+ bin_PROGRAMS     = erofsfuse
+ erofsfuse_SOURCES = dir.c main.c
+ erofsfuse_CFLAGS = -Wall -Werror -I$(top_srcdir)/include
+-erofsfuse_CFLAGS += -DFUSE_USE_VERSION=26 ${libfuse_CFLAGS}
+-erofsfuse_LDADD = $(top_builddir)/lib/liberofs.la ${libfuse_LIBS} ${liblz4_LIBS}
++erofsfuse_CFLAGS += -DFUSE_USE_VERSION=26 ${libfuse_CFLAGS} ${libselinux_CFLAGS}
++erofsfuse_LDADD = $(top_builddir)/lib/liberofs.la ${libfuse_LIBS} ${liblz4_LIBS} ${libselinux_LIBS}
+ 
+-- 
+cgit 1.2.3-1.el7
+
package/erofs-utils/0003-erofs-utils-fuse-disable-backtrace-if-unsupported.patch new file +82 -0

82 lines not on this page · raw message

package/erofs-utils/Config.in +11 -0
index ffb2a891d8d6..741501d40b97 100644
@@ -15,4 +15,15 @@ config BR2_PACKAGE_EROFS_UTILS_LZ4
 	help
 	  Support LZ4 compression algorithm
 
+config BR2_PACKAGE_EROFS_UTILS_EROFSFUSE
+	bool "erofsfuse support"
+	depends on !BR2_STATIC_LIBS # libfuse
+	depends on BR2_TOOLCHAIN_HAS_THREADS # libfuse
+	select BR2_PACKAGE_LIBFUSE
+	help
+	  FUSE file system client for EROFS
+
+comment "erofsfuse needs a toolchain w/ threads, dynamic library"
+	depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS
+
 endif
package/erofs-utils/erofs-utils.hash +1 -1
index 31624b1817be..cd29ea96ff0a 100644
@@ -1,3 +1,3 @@
 # Locally computed
-sha256 a14a30d0d941f6642cad130fbba70a2493fabbe7baa09a8ce7d20745ea3385d6  erofs-utils-1.1.tar.gz
+sha256 b3f65a6b6d8b1dc37694e083e01492041619100211757564adc851e327f1553c  erofs-utils-1.2.tar.gz
 sha256 feee3b3157dcdf78d4f50edefbd5dd7adf8b6d52c11bfaaa746a85a373256713  COPYING
package/erofs-utils/erofs-utils.mk +16 -2
index edc5288b1b56..d4e719470eda 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-EROFS_UTILS_VERSION = 1.1
+EROFS_UTILS_VERSION = 1.2
 EROFS_UTILS_SITE = https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/snapshot
 EROFS_UTILS_LICENSE = GPL-2.0+
 EROFS_UTILS_LICENSE_FILES = COPYING
@@ -21,8 +21,22 @@ else
 EROFS_UTILS_CONF_OPTS += --disable-lz4
 endif
 
+ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
+EROFS_UTILS_CONF_OPTS += --with-selinux
+EROFS_UTILS_DEPENDENCIES += libselinux
+else
+EROFS_UTILS_CONF_OPTS += --without-selinux
+endif
+
+ifeq ($(BR2_PACKAGE_EROFS_UTILS_EROFSFUSE),y)
+EROFS_UTILS_CONF_OPTS += --enable-fuse
+EROFS_UTILS_DEPENDENCIES += libfuse
+else
+EROFS_UTILS_CONF_OPTS += --disable-fuse
+endif
+
 HOST_EROFS_UTILS_DEPENDENCIES = host-pkgconf host-util-linux host-lz4
-HOST_EROFS_UTILS_CONF_OPTS += --enable-lz4
+HOST_EROFS_UTILS_CONF_OPTS += --enable-lz4 --disable-fuse --without-selinux
 
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
Signature · 1 line
2.24.0
#2 lore raw

PATCH 1/1 package/erofs-utils: bump version to 1.2

Hello,

Quoted 10 lines · On Thu, 17 Dec 2020 17:33:56 +0800 Gao Xiang via buildroot…

- add selinux support;
- add erofsfuse support;
- add 0001-erofs-utils-fix-multiple-definition-of-sbi.patch [1];
- add 0002-erofs-utils-fuse-fix-linking-when-using-with-selinux.patch [2];
- add 0003-erofs-utils-fuse-disable-backtrace-if-unsupported.patch.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/patch/?id=6c938b755682629a26f85e5540f40c0d316130ed
[2] https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/patch/?id=f1f9659e98ea925a100e50332309955f5b2b4234

Thanks, I've applied, with one small change, see below.

package/erofs-utils/Config.in config BR2_PACKAGE_EROFS_UTILS_LZ4 · line 21

Quoted 4 lines
package/erofs-utils/Config.in +4 -0
+config BR2_PACKAGE_EROFS_UTILS_EROFSFUSE
+	bool "erofsfuse support"
+	depends on !BR2_STATIC_LIBS # libfuse
+	depends on BR2_TOOLCHAIN_HAS_THREADS # libfuse

You forgot to replicate the BR2_USE_MMU dependency of BR2_PACKAGE_LIBFUSE here, so I did that.

Thanks!

Thomas

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