Skip to content

Commit a9972ae

Browse files
DragonBluepPolynomialDivision
authored andcommitted
build: image: support specifying mksquashfs4 parallel threads
By enabling multi-threading file reading, the squashfs rootfs build process can be greatly accelerated. We use 4 as the default thread number. This is the default value for squashfs4 tool 4.7 if we don't append "-block-readers" or "-small-readers" options. For more test results: https://github.com/plougher/squashfs-tools/blob/4.7/Documentation/4.7/README Signed-off-by: Shiji Yang <[email protected]> Link: openwrt/openwrt#19019 Signed-off-by: Nick Hainke <[email protected]>
1 parent dbfe355 commit a9972ae

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

config/Config-images.in

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,22 @@ menu "Target Images"
160160
Select squashfs block size, must be one of:
161161
4, 8, 16, 32, 64, 128, 256, 512, 1024
162162

163+
config TARGET_SQUASHFS_BLOCK_READERS
164+
int "mksquashfs tool parallel block reader threads"
165+
depends on TARGET_ROOTFS_SQUASHFS
166+
default 4
167+
help
168+
Specify the number of parallel block reader threads
169+
(for files equal or larger than the squashfs block size).
170+
171+
config TARGET_SQUASHFS_SMALL_READERS
172+
int "mksquashfs tool parallel small file reader threads"
173+
depends on TARGET_ROOTFS_SQUASHFS
174+
default 4
175+
help
176+
Specify the number of parallel small file reader threads
177+
(for files less than the squashfs block size).
178+
163179
menuconfig TARGET_ROOTFS_UBIFS
164180
bool "ubifs"
165181
default y if USES_UBIFS

include/image.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ SQUASHFS_BLOCKSIZE := $(CONFIG_TARGET_SQUASHFS_BLOCK_SIZE)k
8686
SQUASHFSOPT := -b $(SQUASHFS_BLOCKSIZE)
8787
SQUASHFSOPT += -p '/dev d 755 0 0' -p '/dev/console c 600 0 0 5 1'
8888
SQUASHFSOPT += $(if $(CONFIG_SELINUX),-xattrs,-no-xattrs)
89+
SQUASHFSOPT += -block-readers $(CONFIG_TARGET_SQUASHFS_BLOCK_READERS)
90+
SQUASHFSOPT += -small-readers $(CONFIG_TARGET_SQUASHFS_SMALL_READERS)
8991
SQUASHFSCOMP := gzip
9092
LZMA_XZ_OPTIONS := -Xpreset 9 -Xe -Xlc 0 -Xlp 2 -Xpb 2
9193
ifeq ($(CONFIG_SQUASHFS_XZ),y)

0 commit comments

Comments
 (0)