[OpenWrt-Devel] [PATCH 07/11] include/image.mk: add support for building a dm-verity enabled squashfs image
Thomas Petazzoni
thomas.petazzoni at bootlin.com
Mon Mar 25 14:00:38 EDT 2019
Hello Hauke,
One again, thanks for the review!
On Mon, 25 Mar 2019 18:21:56 +0100
Hauke Mehrtens <hauke at hauke-m.de> wrote:
> > fs-types-$(CONFIG_TARGET_ROOTFS_SQUASHFS) += squashfs
> > +fs-types-$(CONFIG_TARGET_ROOTFS_SQUASHFS_HASHED) += squashfs-hashed
> > fs-types-$(CONFIG_TARGET_ROOTFS_JFFS2) += $(addprefix jffs2-,$(JFFS2_BLOCKSIZE))
> > fs-types-$(CONFIG_TARGET_ROOTFS_JFFS2_NAND) += $(addprefix jffs2-nand-,$(NAND_BLOCKSIZE))
> > fs-types-$(CONFIG_TARGET_ROOTFS_EXT4FS) += ext4
> > @@ -207,6 +208,17 @@ define Image/mkfs/squashfs
> > $(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH))
> > endef
> >
> > +define Image/mkfs/squashfs-hashed
> > + $(STAGING_DIR_HOST)/bin/mksquashfs4 $(call mkfs_target_dir,$(1)) $@ \
>
> Why don't you just call Image/mkfs/squashfs here and then do the
> additional veritysetup?
Because Image/mkfs/squashfs passes the -nopad option, causing the image
to not be 4 KB-padded, while "veritysetup format" needs a 4KB-padded
image, which is what mksquashfs does by default when -nopad is *not*
passed. An alternate solution is to use Image/mkfs/squashfs, and then
pad the image separately.
> > + -noappend -root-owned \
> > + -comp $(SQUASHFSCOMP) $(SQUASHFSOPT) \
> > + -processors 1 \
> > + $(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH))
>
> Setting SOURCE_DATE_EPOCH is not needed any more.
Ah, indeed, it has been dropped from Image/mkfs/squashfs. Allowed me to
discover the squashfskit fork of squashfs-tools, which I wasn't aware
of.
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list