JFFS2/UBIFS select zlib/lzo even if compression is disabled

Geert Uytterhoeven Geert.Uytterhoeven at sonycom.com
Thu Dec 4 03:55:18 EST 2008


On Thu, 4 Dec 2008, Alexander Beregalov wrote:
> I have found the following misbehaviour:
> 
> # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
> CONFIG_JFFS2_ZLIB=y
> # CONFIG_JFFS2_LZO is not set
> CONFIG_JFFS2_RTIME=y
> # CONFIG_JFFS2_RUBIN is not set
> 
> # CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
> CONFIG_UBIFS_FS_LZO=y
> CONFIG_UBIFS_FS_ZLIB=y
> 
> config JFFS2_ZLIB
>         bool "JFFS2 ZLIB compression support" if JFFS2_COMPRESSION_OPTIONS
>         select ZLIB_INFLATE
>         select ZLIB_DEFLATE
>         depends on JFFS2_FS
>         default y
> 
> Is it an error in kconfig scripts for a long time or should it be
> described differently in Kconfig?
> Something like this
> 
> config JFFS2_ZLIB
>         bool "JFFS2 ZLIB compression support" if JFFS2_COMPRESSION_OPTIONS
>         select ZLIB_INFLATE
>         select ZLIB_DEFLATE
> -        depends on JFFS2_FS
> +        depends on JFFS2_FS && JFFS2_COMPRESSION_OPTIONS
> 
> But it looks ugly

Kconfig is correct.

| config JFFS2_COMPRESSION_OPTIONS
|         bool "Advanced compression options for JFFS2"
|         depends on JFFS2_FS
|         default n
|         help
|           Enabling this option allows you to explicitly choose which
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^
|           compression modules, if any, are enabled in JFFS2.
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


| config UBIFS_FS_ADVANCED_COMPR
|         bool "Advanced compression options"
|         depends on UBIFS_FS
|         help
|           This option allows to explicitly choose which compressions, if any,
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|           are enabled in UBIFS.
            ^^^^^^^^^^^

JFFS2_COMPRESSION_OPTIONS and UBIFS_FS_ADVANCED_COMPR are not meant to
enable/disable compression in se, but to let you _choose_ which compression
modules to include. They're meant for advanced users who know they can leave
out some modules.

So if you want to disable compression, you have to first enable
JFFS2_COMPRESSION_OPTIONS resp. UBIFS_FS_ADVANCED_COMPR. After that, you can
disable e.g. CONFIG_JFFS2_ZLIB.

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   Geert.Uytterhoeven at sonycom.com
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010



More information about the linux-mtd mailing list