0

I am working on an embedded Linux system (5.10.24), and I am using jffs2 as the rootfs.
Now I changed the kernel configuration of jffs2 as follows,

# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
# CONFIG_JFFS2_SUMMARY is not set
# CONFIG_JFFS2_FS_XATTR is not set
CONFIG_JFFS2_COMPRESSION_OPTIONS=y
# CONFIG_JFFS2_ZLIB is not set
CONFIG_JFFS2_LZO=y
# CONFIG_JFFS2_RTIME is not set
# CONFIG_JFFS2_RUBIN is not set
# CONFIG_JFFS2_CMODE_NONE is not set
# CONFIG_JFFS2_CMODE_PRIORITY is not set
# CONFIG_JFFS2_CMODE_SIZE is not set
CONFIG_JFFS2_CMODE_FAVOURLZO=y

And used mkfs.jffs2 -e 0x8000 -p -l -n -X lzo to build jffs2 image.

After system booted up, it reported following error.

Run /init as init process
jffs2: compression type 0x06 not available
jffs2: Error: jffs2_decompress returned -5
Kernel panic - not syncing: Requested init /init failed (error -5).

I am puzzled!

From the error message, it seemed that jffs2 image is compressed by ZLIB, but I specified -X lzo to the mkfs.jffs2.

So how to make system boot with jffs2 system using LZO?

1 Answer 1

1

I figured out the root cause.

This is from the building of rootfs image, which is using ZLIB by default. To make LZO work, there needs 2 things.

  1. Enable CONFIG_JFFS2_LZO=y in kernel configuration, other compression configurations can be disabled.
  2. Run mkfs.jffs2 with -X lzo -x zlib -x rtime, which means enable LZO compressor, and disable ZLIB and RTIME compressors.

With above, the rootfs image is compressed with LZO, and it can be booted up with kernel enabled LZO.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.