build,squashfs: switch to squashfs-tools-ng
authorPaul Spooren <mail@aparcar.org>
Sat, 11 Apr 2020 07:55:48 +0000 (21:55 -1000)
committerAlexander Couzens <lynxis@fe80.eu>
Mon, 4 May 2020 05:18:31 +0000 (07:18 +0200)
Let the newly added `squasfs-tools-ng` handle the squashfs file
creation.

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

index 984b64fb9c73d419e9f198efe2a50c5fba42a767..2ebc89d9a3e2db2f00a2a23eae77e67b9383de44 100644 (file)
@@ -78,7 +78,6 @@ JFFS2OPTS += $(MKFS_DEVTABLE_OPT)
 
 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
 ifeq ($(CONFIG_SQUASHFS_XZ),y)
@@ -234,11 +233,12 @@ endef
 $(eval $(foreach S,$(JFFS2_BLOCKSIZE),$(call Image/mkfs/jffs2/template,$(S))))
 $(eval $(foreach S,$(NAND_BLOCKSIZE),$(call Image/mkfs/jffs2-nand/template,$(S))))
 
+# use tar2sqfs because gensquashfs lacks the owned by root feature
 define Image/mkfs/squashfs
-       $(STAGING_DIR_HOST)/bin/mksquashfs4 $(call mkfs_target_dir,$(1)) $@ \
-               -nopad -noappend -root-owned \
-               -comp $(SQUASHFSCOMP) $(SQUASHFSOPT) \
-               -processors 1
+       echo 'dir / 0755 0 0' > $@.squashfs.packfile
+       echo 'dir /dev 0755 0 0' >> $@.squashfs.packfile
+       echo 'nod /dev/console 0600 0 0 c 5 1' >> $@.squashfs.packfile
+       $(STAGING_DIR_HOST)/bin/gensquashfs -d uid=0,gid=0,mtime=0 --all-root $(SQUASHFSOPT) -F $@.squashfs.packfile -D $(call mkfs_target_dir,$(1))
 endef
 
 # $(1): board name
index 02556d4b83f3e44bef980ba0d8748933645a79a1..97a2a5bd69dbdd9bdc2df56802d458b669c28e7b 100644 (file)
@@ -33,7 +33,7 @@ tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
 tools-$(CONFIG_TARGET_ar71xx) += lzma-old
 tools-$(CONFIG_TARGET_ar71xx)$(CONFIG_TARGET_ath79) += squashfs
 tools-$(CONFIG_USES_MINOR) += kernel2minor
-tools-y += lzma squashfskit4 zip
+tools-y += lzma squashfs-tools-ng zip
 tools-$(BUILD_B43_TOOLS) += b43-tools
 tools-$(BUILD_ISL) += isl
 tools-$(CONFIG_USE_SPARSE) += sparse
@@ -45,7 +45,7 @@ $(curdir)/bison/compile := $(curdir)/flex/compile
 $(curdir)/flex/compile := $(curdir)/libtool/compile
 $(curdir)/libtool/compile := $(curdir)/m4/compile $(curdir)/autoconf/compile $(curdir)/automake/compile $(curdir)/missing-macros/compile
 $(curdir)/squashfs/compile := $(curdir)/lzma-old/compile
-$(curdir)/squashfskit4/compile := $(curdir)/xz/compile $(curdir)/zlib/compile
+$(curdir)/squashfs-tools-ng/compile := $(curdir)/xz/compile $(curdir)/zlib/compile
 $(curdir)/quilt/compile := $(curdir)/autoconf/compile $(curdir)/findutils/compile
 $(curdir)/autoconf/compile := $(curdir)/m4/compile
 $(curdir)/automake/compile := $(curdir)/m4/compile $(curdir)/autoconf/compile $(curdir)/pkgconf/compile $(curdir)/xz/compile
@@ -80,7 +80,7 @@ $(curdir)/make-ext4fs/compile := $(curdir)/zlib/compile
 $(curdir)/cbootimage/compile += $(curdir)/automake/compile
 
 ifneq ($(HOST_OS),Linux)
-  $(curdir)/squashfskit4/compile += $(curdir)/coreutils/compile
+  $(curdir)/squashfs-tools-ng/compile += $(curdir)/coreutils/compile
   tools-y += coreutils
 endif