config: add erofs filesystem erofs
authorPaul Spooren <mail@aparcar.org>
Mon, 18 Jul 2022 21:51:03 +0000 (23:51 +0200)
committerPaul Spooren <mail@aparcar.org>
Mon, 18 Jul 2022 21:56:14 +0000 (23:56 +0200)
It is now possible to select erofs as rootfs if Kernel 5.15 is selected.

Signed-off-by: Paul Spooren <mail@aparcar.org>
config/Config-images.in
include/image.mk

index dcd7575c3e453547e4c0f1c0840d2b0222982a7b..f3d3fbeb44b8c57aa1955a296aa0c79f7e383703 100644 (file)
@@ -160,6 +160,12 @@ menu "Target Images"
                        default 1024 if (SMALL_FLASH && !LOW_MEMORY_FOOTPRINT)
                        default 256
 
+       menuconfig TARGET_ROOTFS_EROFS
+               bool "erofs"
+               help
+                 Build a erofs-lzma root filesystem.
+               depends on LINUX_5_15
+
        menuconfig TARGET_ROOTFS_UBIFS
                bool "ubifs"
                default y if USES_UBIFS
index bdcf20d30c70a7229d4f0ecc6f80e6d90197fcb6..56aee64f9f72f6e965ba481456ca54d309291ef4 100644 (file)
@@ -88,6 +88,7 @@ endif
 JFFS2_BLOCKSIZE ?= 64k 128k
 
 fs-types-$(CONFIG_TARGET_ROOTFS_SQUASHFS) += squashfs
+fs-types-$(CONFIG_TARGET_ROOTFS_EROFS) += erofs
 fs-types-$(CONFIG_TARGET_ROOTFS_JFFS2) += $(addprefix jffs2-,$(JFFS2_BLOCKSIZE))
 fs-types-$(CONFIG_TARGET_ROOTFS_JFFS2_NAND) += $(addprefix jffs2-nand-,$(NAND_BLOCKSIZE))
 fs-types-$(CONFIG_TARGET_ROOTFS_EXT4FS) += ext4
@@ -225,6 +226,10 @@ define Image/mkfs/squashfs-common
                -comp $(SQUASHFSCOMP) $(SQUASHFSOPT)
 endef
 
+define Image/mkfs/erofs
+  $(STAGING_DIR_HOST)/bin/mkfs.erofs -zlzma,9 -Eztailpacking -C 65536 $@ $(call mkfs_target_dir,$(1))
+endef
+
 ifeq ($(CONFIG_TARGET_ROOTFS_SECURITY_LABELS),y)
 define Image/mkfs/squashfs
        echo ". $(call mkfs_target_dir,$(1))/etc/selinux/config" > $@.fakeroot-script