Changing lzma compression to lzo

We are using Mediatek MT7628 EVB (MIPS) for our development purpose. There was a requirement to change the compression/decompression format from lzma to lzo in order to minimize decompression time on each reboot. While changing format to lzo, it seems like lzo is not supported by sqashfs in openwrt. Following error is shown up:

**make[5]: Entering directory `/media/source-17.01.2/target/linux/ramips/image'
make[5]: Nothing to be done for 'compile'.
mkdir -p /media/source-17.01.2/bin/targets/ramips/mt7628 /media/source-17.01.2/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7628/tmp
/media/source-17.01.2/staging_dir/host/bin/mksquashfs4 /media/source-17.01.2/build_dir/target-mipsel_24kc_musl-1.1.16/root-ramips /media/source-17.01.2/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7628/root.squashfs -nopad -noappend -root-owned -comp lzo  -b 256k -p '/dev d 755 0 0' -p '/dev/console c 600 0 0 5 1' -processors 1 -fixed-time 1496955757
/media/source-17.01.2/staging_dir/host/bin/mksquashfs4: Compressor "lzo" is not supported!
/media/source-17.01.2/staging_dir/host/bin/mksquashfs4: Compressors available:
	gzip (default)
	lzma
	xz
make[5]: *** [/media/source-17.01.2/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7628/root.squashfs] Error 1
make[5]: *** Waiting for unfinished jobs....**

We searched git repository for this and haven't found the support for lzo in last 2 years history.
Anbody having any idea on enabling LZO compression/decompression for squashfs filesystem in lede ? We are using 17.04 tag.

Since mksquashfs is a host-based (build system, not router) tool, you should be able to patch it when built.

./build_dir/host/squashfs4.2/squashfs-tools/

It may be as simple as changing some build options, or using a newer version of the source.

define Host/Compile
        +$(HOST_MAKE_VARS) \
        $(MAKE) -C $(HOST_BUILD_DIR)/squashfs-tools \
                XZ_SUPPORT=1 \
                LZMA_XZ_SUPPORT=1 \
                XATTR_SUPPORT= \
                LZMA_LIB="$(STAGING_DIR_HOST)/lib/liblzma.a" \
                EXTRA_CFLAGS="-I$(STAGING_DIR_HOST)/include" \
                mksquashfs unsquashfs
endef

As many devices are struggling with insufficient flash, even with xz compression, there probably hasn't been a focus on decompression speed.

Curious, why not LZ4 if you're interested in decompression speed?

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.