Skip to contentSkip to conversation

package/erofs-utils: new package

PATCH RESEND Superseded Gao Xiang 1 participant 2 messages Mar 14, 2020 1 message not in the archive

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Gao Xiang

author
#1 lore raw

PATCH RESEND 1/2 package/erofs-utils: new package

In reply to a message not in the archive

This patch adds EROFS userspace tool erofs-utils to buildroot, which can be used to generate EROFS images.

---

RESEND due to mailing list restriction.

Hi,

EROFS filesystem has been included in linux-5.4 formally. This patchset enables alternative EROFS support for buildroot.

Thanks,
Gao Xiang

 package/Config.in                             |  1 +
 package/Config.in.host                        |  1 +
 .../0001-erofs-utils-fix-configure.ac.patch   | 33 +++++++++++
 ...d-_LARGEFILE64_SOURCE-and-_GNU_SOURC.patch | 58 +++++++++++++++++++
 package/erofs-utils/Config.in                 | 16 +++++
 package/erofs-utils/Config.in.host            |  6 ++
 package/erofs-utils/erofs-utils.hash          |  3 +
 package/erofs-utils/erofs-utils.mk            | 22 +++++++
 8 files changed, 140 insertions(+)
 create mode 100644 package/erofs-utils/0001-erofs-utils-fix-configure.ac.patch
 create mode 100644 package/erofs-utils/0002-erofs-utils-avoid-_LARGEFILE64_SOURCE-and-_GNU_SOURC.patch
 create mode 100644 package/erofs-utils/Config.in
 create mode 100644 package/erofs-utils/Config.in.host
 create mode 100644 package/erofs-utils/erofs-utils.hash
 create mode 100644 package/erofs-utils/erofs-utils.mk
package/Config.in +1 -0
index 146fc1bbc3..3aeb32a5de 100644
@@ -196,6 +196,7 @@ menu "Filesystem and flash utilities"
 	source "package/e2fsprogs/Config.in"
 	source "package/e2tools/Config.in"
 	source "package/ecryptfs-utils/Config.in"
+	source "package/erofs-utils/Config.in"
 	source "package/exfat/Config.in"
 	source "package/exfat-utils/Config.in"
 	source "package/f2fs-tools/Config.in"
package/Config.in.host +1 -0
index dfea478868..64a88f7630 100644
@@ -18,6 +18,7 @@ menu "Host utilities"
 	source "package/dtc/Config.in.host"
 	source "package/e2fsprogs/Config.in.host"
 	source "package/e2tools/Config.in.host"
+	source "package/erofs-utils/Config.in.host"
 	source "package/eudev/Config.in.host"
 	source "package/f2fs-tools/Config.in.host"
 	source "package/faketime/Config.in.host"
package/erofs-utils/0001-erofs-utils-fix-configure.ac.patch new file +33 -0
new file mode 100644
index 0000000000..7ced565995
@@ -0,0 +1,33 @@
+From eefd95b37e1042992cb07bec1ac3f6dbe199d8f0 Mon Sep 17 00:00:00 2001
+From: Haruue Icymoon <[email protected]>
+Date: Fri, 22 Nov 2019 16:58:59 +0800
+Subject: [PATCH] erofs-utils: fix configure.ac
+
+./configure will fail when --with-lz4-libdir is not set, since
+$with_lz4_libdir will be an empty string and generate an empty -L
+into LDFLAGS. This patch fixes it.
+
+Link: https://lore.kernel.org/r/20191122085859.GA2414688 at usamimi.host.haruue.net
+Signed-off-by: Haruue Icymoon <[email protected]>
+Fixes: d51c2d043773 ("erofs-utils: introduce lz4/lz4hc compression algorithm")
+Signed-off-by: Gao Xiang <[email protected]>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index f925358..870dfb9 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -174,7 +174,7 @@ if test "x$enable_lz4" = "xyes"; then
+ 
+   if test "x${have_lz4h}" = "xyes" ; then
+     saved_LDFLAGS=${LDFLAGS}
+-    LDFLAGS="-L$with_lz4_libdir ${LDFLAGS}"
++    test -z "${with_lz4_libdir}" || LDFLAGS="-L$with_lz4_libdir ${LDFLAGS}"
+     AC_CHECK_LIB(lz4, LZ4_compress_destSize, [
+       have_lz4="yes"
+       have_lz4hc="yes"
+-- 
+2.20.1
+
package/erofs-utils/0002-erofs-utils-avoid-_LARGEFILE64_SOURCE-and-_GNU_SOURC.patch new file +58 -0

58 lines not on this page · raw message

package/erofs-utils/Config.in new file +16 -0
new file mode 100644
index 0000000000..75bcbdaae2
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_EROFS_UTILS
+	bool "erofs-utils"
+	help
+	  Userspace utilities for EROFS filesystem
+
+	  https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git
+
+if BR2_PACKAGE_EROFS_UTILS
+
+config BR2_PACKAGE_EROFS_UTILS_LZ4
+	bool "lz4 support"
+	select BR2_PACKAGE_LZ4
+	help
+	  Support LZ4 compression algorithm
+
+endif
package/erofs-utils/Config.in.host new file +6 -0
new file mode 100644
index 0000000000..31ea6eb2ea
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_HOST_EROFS_UTILS
+	bool "host erofs-utils"
+	help
+	  Userspace utilities for EROFS filesystem
+
+	  https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git
package/erofs-utils/erofs-utils.hash new file +3 -0
new file mode 100644
index 0000000000..45d4883a01
@@ -0,0 +1,3 @@
+# Locally computed
+sha256 508ee818dc6a02cf986647e37cb991b76f7b3e7ea303ffc9e980772de68f3b10  erofs-utils-1.0.tar.gz
+sha256 feee3b3157dcdf78d4f50edefbd5dd7adf8b6d52c11bfaaa746a85a373256713  COPYING
package/erofs-utils/erofs-utils.mk new file +22 -0
new file mode 100644
index 0000000000..3f28547e8e
@@ -0,0 +1,22 @@
+################################################################################
+#
+# erofs-utils
+#
+################################################################################
+
+EROFS_UTILS_VERSION = 1.0
+EROFS_UTILS_SITE = https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/snapshot
+EROFS_UTILS_AUTORECONF = YES
+EROFS_UTILS_LICENSE = GPL-2.0+
+EROFS_UTILS_LICENSE_FILES = COPYING
+
+ifeq ($(BR2_PACKAGE_EROFS_UTILS_LZ4),y)
+EROFS_UTILS_DEPENDENCIES += lz4
+else
+EROFS_UTILS_CONF_OPTS += --disable-lz4
+endif
+
+HOST_EROFS_UTILS_DEPENDENCIES = host-lz4
+
+$(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 1 line
2.20.1
author
#2 lore raw

PATCH RESEND 2/2 fs/erofs: add support for creating erofs rootfs image

This patch makes possible to create rootfs image using EROFS filesystem.

---
 fs/Config.in       |  1 +
 fs/erofs/Config.in | 24 ++++++++++++++++++++++++
 fs/erofs/erofs.mk  | 17 +++++++++++++++++
 3 files changed, 42 insertions(+)
 create mode 100644 fs/erofs/Config.in
 create mode 100644 fs/erofs/erofs.mk
fs/Config.in +1 -0
index 527051ef54..37a2aa21f8 100644
@@ -5,6 +5,7 @@ source "fs/btrfs/Config.in"
 source "fs/cloop/Config.in"
 source "fs/cpio/Config.in"
 source "fs/cramfs/Config.in"
+source "fs/erofs/Config.in"
 source "fs/ext2/Config.in"
 source "fs/f2fs/Config.in"
 source "fs/initramfs/Config.in"
fs/erofs/Config.in new file +24 -0
new file mode 100644
index 0000000000..dad2498a15
@@ -0,0 +1,24 @@
+config BR2_TARGET_ROOTFS_EROFS
+	bool "erofs root filesystem"
+	select BR2_PACKAGE_HOST_EROFS_UTILS
+	help
+	  Build a EROFS root filesystem. If you enable this option,
+	  you probably want to enable the erofs-utils package too.
+
+if BR2_TARGET_ROOTFS_EROFS
+
+choice
+	prompt "Compression algorithm"
+	default BR2_TARGET_ROOTFS_EROFS_LZ4HC
+	help
+	  Select the primary compression algorithm to use when
+	  generating EROFS filesystem image.
+
+config BR2_TARGET_ROOTFS_EROFS_NONE
+	bool "none"
+
+config BR2_TARGET_ROOTFS_EROFS_LZ4HC
+	bool "lz4hc"
+
+endchoice
+endif # BR2_TARGET_ROOTFS_EROFS
fs/erofs/erofs.mk new file +17 -0
new file mode 100644
index 0000000000..c9eb0d8e8f
@@ -0,0 +1,17 @@
+################################################################################
+#
+# Build the erofs root filesystem image
+#
+################################################################################
+
+ROOTFS_EROFS_DEPENDENCIES = host-erofs-utils
+
+ifeq ($(BR2_TARGET_ROOTFS_EROFS_LZ4HC),y)
+ROOTFS_EROFS_ARGS += -zlz4hc
+endif
+
+define ROOTFS_EROFS_CMD
+	$(HOST_DIR)/bin/mkfs.erofs $(ROOTFS_EROFS_ARGS) $@ $(TARGET_DIR)
+endef
+
+$(eval $(rootfs))
Signature · 1 line
2.20.1