Skip to content

Commit

Permalink
image: allow creating a zstd-compressed squashfs rootfs
Browse files Browse the repository at this point in the history
Zstd decompresses much faster than xz, but it also requires large amounts of
RAM. This is useful mostly for x86-64-based devices.

Signed-off-by: Rui Salvaterra <[email protected]>
  • Loading branch information
rsalvaterra committed Dec 9, 2024
1 parent 3d8d818 commit 944e817
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,15 @@ SQUASHFSOPT := -b $(SQUASHFS_BLOCKSIZE)
SQUASHFSOPT += -p '/dev d 755 0 0' -p '/dev/console c 600 0 0 5 1'
SQUASHFSOPT += $(if $(CONFIG_SELINUX),-xattrs,-no-xattrs)
SQUASHFSCOMP := gzip
LZMA_XZ_OPTIONS := -Xpreset 9 -Xe -Xlc 0 -Xlp 2 -Xpb 2
ifeq ($(CONFIG_SQUASHFS_XZ),y)
ifneq ($(filter arm x86 powerpc sparc,$(LINUX_KARCH)),)
BCJ_FILTER:=-Xbcj $(LINUX_KARCH)
endif
LZMA_XZ_OPTIONS := -Xpreset 9 -Xe -Xlc 0 -Xlp 2 -Xpb 2
SQUASHFSCOMP := xz $(LZMA_XZ_OPTIONS) $(BCJ_FILTER)
else ifeq ($(CONFIG_SQUASHFS_ZSTD),y)
ZSTD_OPTIONS := -Xcompression-level 19
SQUASHFSCOMP := zstd $(ZSTD_OPTIONS)
endif

JFFS2_BLOCKSIZE ?= 64k 128k
Expand Down
1 change: 1 addition & 0 deletions tools/squashfs4/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ define Host/Compile
XZ_SUPPORT=1 \
LZMA_XZ_SUPPORT=1 \
XZ_EXTENDED_OPTIONS=1 \
ZSTD_SUPPORT=1 \
EXTRA_CFLAGS="-I$(STAGING_DIR_HOST)/include" \
mksquashfs unsquashfs
endef
Expand Down

0 comments on commit 944e817

Please sign in to comment.