[openwrt/openwrt] image: only calculate EROFS_PCLUSTERSIZE when needed

LEDE Commits lede-commits at lists.infradead.org
Sun Jul 6 01:40:40 PDT 2025


nbd pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5adc663af6c9669493d4fe9bf8169d6debe7aab8

commit 5adc663af6c9669493d4fe9bf8169d6debe7aab8
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sun Jul 6 10:32:41 2025 +0200

    image: only calculate EROFS_PCLUSTERSIZE when needed
    
    Fixes shell warning on any makefile including image.mk when EROFS
    is not enabled
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 include/image.mk | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index 262edd79d4..048e750f33 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -99,9 +99,8 @@ endif
 
 JFFS2_BLOCKSIZE ?= 64k 128k
 
-EROFS_PCLUSTERSIZE := $(shell echo $$(($(CONFIG_TARGET_EROFS_PCLUSTER_SIZE)*1024)))
-EROFSOPT := -C$(EROFS_PCLUSTERSIZE)
-EROFSOPT += -Efragments,dedupe,ztailpacking -Uclear --all-root
+EROFS_PCLUSTERSIZE = $(shell echo $$(($(CONFIG_TARGET_EROFS_PCLUSTER_SIZE)*1024)))
+EROFSOPT := -Efragments,dedupe,ztailpacking -Uclear --all-root
 EROFSOPT += $(if $(SOURCE_DATE_EPOCH),-T$(SOURCE_DATE_EPOCH) --ignore-mtime)
 EROFSOPT += $(if $(CONFIG_SELINUX),,-x-1)
 EROFSCOMP := lz4hc,12
@@ -322,7 +321,8 @@ endef
 
 # Don't use the mkfs.erofs builtin $SOURCE_DATE_EPOCH behavior
 define Image/mkfs/erofs
-	env -u SOURCE_DATE_EPOCH $(STAGING_DIR_HOST)/bin/mkfs.erofs -z$(EROFSCOMP) $(EROFSOPT) \
+	env -u SOURCE_DATE_EPOCH $(STAGING_DIR_HOST)/bin/mkfs.erofs -z$(EROFSCOMP) \
+		-C$(EROFS_PCLUSTERSIZE) $(EROFSOPT) \
 		$@ $(call mkfs_target_dir,$(1))
 endef
 




More information about the lede-commits mailing list