build,squashfs: switch to squashfs-tools-ng
authorPaul Spooren <mail@aparcar.org>
Sun, 27 Dec 2020 23:03:31 +0000 (13:03 -1000)
committerPaul Spooren <mail@aparcar.org>
Thu, 24 Jun 2021 17:42:38 +0000 (07:42 -1000)
Let the newly added `squasfs-tools-ng` handle the squashfs file
creation.

Signed-off-by: Paul Spooren <mail@aparcar.org>
include/image.mk
tools/Makefile

index a7473abe68f4fd61c7e7f6bbb0454744394e0db7..cf43ff118010199337ff408b8d76849b3f73ec05 100644 (file)
@@ -76,12 +76,13 @@ SQUASHFS_BLOCKSIZE := $(CONFIG_TARGET_SQUASHFS_BLOCK_SIZE)k
 SQUASHFSOPT := -b $(SQUASHFS_BLOCKSIZE)
 SQUASHFSOPT += -p '/dev d 755 0 0' -p '/dev/console c 600 0 0 5 1'
 SQUASHFSCOMP := gzip
-LZMA_XZ_OPTIONS := -Xpreset 9 -Xe -Xlc 0 -Xlp 2 -Xpb 2
+LZMA_XZ_OPTIONS := -X lc=0,lp=2,pb=2
+BCJ_FILTER:=extreme
 ifeq ($(CONFIG_SQUASHFS_XZ),y)
   ifneq ($(filter arm x86 powerpc sparc,$(LINUX_KARCH)),)
-    BCJ_FILTER:=-Xbcj $(LINUX_KARCH)
+    BCJ_FILTER:=,$(LINUX_KARCH)
   endif
-  SQUASHFSCOMP := xz $(LZMA_XZ_OPTIONS) $(BCJ_FILTER)
+  SQUASHFSCOMP := xz $(LZMA_XZ_OPTIONS)$(BCJ_FILTER)
 endif
 
 JFFS2_BLOCKSIZE ?= 64k 128k
@@ -226,10 +227,18 @@ $(eval $(foreach S,$(JFFS2_BLOCKSIZE),$(call Image/mkfs/jffs2/template,$(S))))
 $(eval $(foreach S,$(NAND_BLOCKSIZE),$(call Image/mkfs/jffs2-nand/template,$(S))))
 
 define Image/mkfs/squashfs-common
-       $(STAGING_DIR_HOST)/bin/mksquashfs4 $(call mkfs_target_dir,$(1)) $@ \
-               -nopad -noappend -root-owned \
-               -comp $(SQUASHFSCOMP) $(SQUASHFSOPT) \
-               -processors 1
+       echo 'dir /dev 0755 0 0' > $@.squashfs.packfile; \
+       echo 'nod /dev/console 0600 0 0 c 5 1' >> $@.squashfs.packfile; \
+       echo 'glob / * * *' >> $@.squashfs.packfile; \
+       $(STAGING_DIR_HOST)/bin/gensquashfs \
+               --block-size $(SQUASHFS_BLOCKSIZE) \
+               --all-root \
+               --force \
+               --compressor $(SQUASHFSCOMP) \
+               --defaults uid=0,gid=0,mtime=0 \
+               --pack-dir $(call mkfs_target_dir,$(1)) \
+               --pack-file $@.squashfs.packfile \
+               $@
 endef
 
 ifeq ($(CONFIG_TARGET_ROOTFS_SECURITY_LABELS),y)
index 6c402087a5f95a66bb61e4a292f23812a35926d9..e61e7625e1fa7505d02aa65682fc117a9ecb1f51 100644 (file)
@@ -25,7 +25,7 @@ tools-y += autoconf autoconf-archive automake bc bison cmake cpio dosfstools
 tools-y += e2fsprogs fakeroot findutils firmware-utils flex gengetopt
 tools-y += libressl libtool lzma m4 make-ext4fs meson missing-macros mkimage
 tools-y += mklibs mm-macros mtd-utils mtools ninja padjffs2 patch-image
-tools-y += patchelf pkgconf quilt squashfskit4 sstrip xxd zip zlib zstd
+tools-y += patchelf pkgconf quilt squashfs-tools-ng sstrip xxd zip zlib zstd
 tools-$(BUILD_B43_TOOLS) += b43-tools
 tools-$(BUILD_ISL) += isl
 tools-$(BUILD_TOOLCHAIN) += expat gmp mpc mpfr
@@ -69,13 +69,13 @@ $(curdir)/patchelf/compile := $(curdir)/libtool/compile
 $(curdir)/quilt/compile := $(curdir)/autoconf/compile $(curdir)/findutils/compile
 $(curdir)/sdcc/compile := $(curdir)/bison/compile
 $(curdir)/squashfs/compile := $(curdir)/lzma-old/compile
-$(curdir)/squashfskit4/compile := $(curdir)/xz/compile $(curdir)/zlib/compile
 $(curdir)/squashfs-tools-ng/compile := $(curdir)/libtool/compile $(curdir)/xz/compile $(curdir)/zlib/compile
+>>>>>>> 107716fe30 (build,squashfs: switch to squashfs-tools-ng)
 $(curdir)/zlib/compile := $(curdir)/cmake/compile
 $(curdir)/zstd/compile := $(curdir)/cmake/compile
 
 ifneq ($(HOST_OS),Linux)
-  $(curdir)/squashfskit4/compile += $(curdir)/coreutils/compile
+  $(curdir)/squashfs-tools-ng/compile += $(curdir)/coreutils/compile
   tools-y += coreutils
 endif