<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/fs/squashfs/sqfs_decompressor.c, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>fs/squashfs: sqfs_decompressor: simplify code</title>
<updated>2026-03-26T17:04:28+00:00</updated>
<author>
<name>Richard Genoud</name>
<email>richard.genoud@bootlin.com</email>
</author>
<published>2026-03-13T10:42:24+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=0fe2801730edb99e24b601b043ec5595af319274'/>
<id>0fe2801730edb99e24b601b043ec5595af319274</id>
<content type='text'>
Switch to if (CONFIG_IS_ENABLED()) instead of #if when possible and
remove unnecessary cases.

Signed-off-by: Richard Genoud &lt;richard.genoud@bootlin.com&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Reviewed-by: João Marcos Costa &lt;joaomarcos.costa@bootlin.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Switch to if (CONFIG_IS_ENABLED()) instead of #if when possible and
remove unnecessary cases.

Signed-off-by: Richard Genoud &lt;richard.genoud@bootlin.com&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Reviewed-by: João Marcos Costa &lt;joaomarcos.costa@bootlin.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/squashfs: fix sqfs_decompressor.c build in SPL</title>
<updated>2026-03-26T17:04:28+00:00</updated>
<author>
<name>Richard Genoud</name>
<email>richard.genoud@bootlin.com</email>
</author>
<published>2026-03-13T10:42:23+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=f0b4f502bdd5f17da58aca9ebf86e16e96e0d347'/>
<id>f0b4f502bdd5f17da58aca9ebf86e16e96e0d347</id>
<content type='text'>
CONFIG_IS_ENABLED() must be used in place of IS_ENABLED() for config
options that have a _SPL_ counterpart.

Signed-off-by: Richard Genoud &lt;richard.genoud@bootlin.com&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Reviewed-by: João Marcos Costa &lt;joaomarcos.costa@bootlin.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
CONFIG_IS_ENABLED() must be used in place of IS_ENABLED() for config
options that have a _SPL_ counterpart.

Signed-off-by: Richard Genoud &lt;richard.genoud@bootlin.com&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Reviewed-by: João Marcos Costa &lt;joaomarcos.costa@bootlin.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/squashfs: enable LZ4 compression support</title>
<updated>2023-11-16T23:53:09+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>goliath@infraroot.at</email>
</author>
<published>2023-11-06T10:14:03+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=fa894a36a9090c53050cf0e9cf186c4521209974'/>
<id>fa894a36a9090c53050cf0e9cf186c4521209974</id>
<content type='text'>
The structure is identical to the existing compressor implementations,
trivially adding lz4 decompression to sqfs_decompress.

The changes were tested using a sandbox build. An LZ4 compressed
squashfs image was bound as a host block device.

Signed-off-by: David Oberhollenzer &lt;goliath@infraroot.at&gt;
Reviewed-by: Joao Marcos Costa &lt;jmcosta944@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The structure is identical to the existing compressor implementations,
trivially adding lz4 decompression to sqfs_decompress.

The changes were tested using a sandbox build. An LZ4 compressed
squashfs image was bound as a host block device.

Signed-off-by: David Oberhollenzer &lt;goliath@infraroot.at&gt;
Reviewed-by: Joao Marcos Costa &lt;jmcosta944@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib: zstd: update to latest Linux zstd 1.5.2</title>
<updated>2023-01-19T00:04:17+00:00</updated>
<author>
<name>Brandon Maier</name>
<email>brandon.maier@collins.com</email>
</author>
<published>2023-01-12T16:27:45+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=4b9b25d943ff95c7421cab261333fc29852fe3b1'/>
<id>4b9b25d943ff95c7421cab261333fc29852fe3b1</id>
<content type='text'>
Update the zstd implementation to match Linux zstd 1.5.2 from commit
2aa14b1ab2.

This was motivated by running into decompression corruption issues when
trying to uncompress files compressed with newer versions of zstd. zstd
users also claim significantly improved decompression times with newer
zstd versions which is a side benefit.

Original zstd code was copied from Linux commit 2aa14b1ab2 which is a
custom-built implementation based on zstd 1.3.1. Linux switched to an
implementation that is a copy of the upstream zstd code in Linux commit
e0c1b49f5b, this results in a large code diff. However this should make
future updates easier along with other benefits[1].

This commit is a straight mirror of the Linux zstd code, except to:
- update a few #include that do not translate cleanly
  - linux/swab.h -&gt; asm/byteorder.h
  - linux/limits.h -&gt; linux/kernel.h
  - linux/module.h -&gt; linux/compat.h
- remove assert() from debug.h so it doesn't conflict with u-boot's
  assert()
- strip out the compressor code as was done in the previous u-boot zstd
- update existing zstd users to the new Linux zstd API
- change the #define for MEM_STATIC to use INLINE_KEYWORD for codesize
- add a new KConfig option that sets zstd build options to minify code
  based on zstd's ZSTD_LIB_MINIFY[2].

These changes were tested by booting a zstd 1.5.2 compressed kernel inside a
FIT. And the squashfs changes by loading a file from zstd compressed squashfs
with sqfsload. buildman was used to compile test other boards and check for
binary bloat, as follows:

&gt; $ buildman -b zstd2 --boards dh_imx6,m53menlo,mvebu_espressobin-88f3720,sandbox,sandbox64,stm32mp15_dhcom_basic,stm32mp15_dhcor_basic,turris_mox,turris_omnia -sS
&gt; Summary of 6 commits for 9 boards (8 threads, 1 job per thread)
&gt; 01: Merge branch '2023-01-10-platform-updates'
&gt;        arm:  w+   m53menlo dh_imx6
&gt; 02: lib: zstd: update to latest Linux zstd 1.5.2
&gt;    aarch64: (for 2/2 boards) all -3186.0 rodata +920.0 text -4106.0
&gt;        arm: (for 5/5 boards) all +1254.4 rodata +940.0 text +314.4
&gt;    sandbox: (for 2/2 boards) all -4452.0 data -16.0 rodata +640.0 text -5076.0

[1] https://github.com/torvalds/linux/commit/e0c1b49f5b674cca7b10549c53b3791d0bbc90a8
[2] https://github.com/facebook/zstd/blob/f302ad8811643c428c4e3498e28f53a0578020d3/lib/libzstd.mk#L31

Signed-off-by: Brandon Maier &lt;brandon.maier@collins.com&gt;
[trini: Set ret to -EINVAL for the error of "failed to detect
compressed" to fix warning, drop ZSTD_SRCSIZEHINT_MAX for non-Linux host
tool builds]
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update the zstd implementation to match Linux zstd 1.5.2 from commit
2aa14b1ab2.

This was motivated by running into decompression corruption issues when
trying to uncompress files compressed with newer versions of zstd. zstd
users also claim significantly improved decompression times with newer
zstd versions which is a side benefit.

Original zstd code was copied from Linux commit 2aa14b1ab2 which is a
custom-built implementation based on zstd 1.3.1. Linux switched to an
implementation that is a copy of the upstream zstd code in Linux commit
e0c1b49f5b, this results in a large code diff. However this should make
future updates easier along with other benefits[1].

This commit is a straight mirror of the Linux zstd code, except to:
- update a few #include that do not translate cleanly
  - linux/swab.h -&gt; asm/byteorder.h
  - linux/limits.h -&gt; linux/kernel.h
  - linux/module.h -&gt; linux/compat.h
- remove assert() from debug.h so it doesn't conflict with u-boot's
  assert()
- strip out the compressor code as was done in the previous u-boot zstd
- update existing zstd users to the new Linux zstd API
- change the #define for MEM_STATIC to use INLINE_KEYWORD for codesize
- add a new KConfig option that sets zstd build options to minify code
  based on zstd's ZSTD_LIB_MINIFY[2].

These changes were tested by booting a zstd 1.5.2 compressed kernel inside a
FIT. And the squashfs changes by loading a file from zstd compressed squashfs
with sqfsload. buildman was used to compile test other boards and check for
binary bloat, as follows:

&gt; $ buildman -b zstd2 --boards dh_imx6,m53menlo,mvebu_espressobin-88f3720,sandbox,sandbox64,stm32mp15_dhcom_basic,stm32mp15_dhcor_basic,turris_mox,turris_omnia -sS
&gt; Summary of 6 commits for 9 boards (8 threads, 1 job per thread)
&gt; 01: Merge branch '2023-01-10-platform-updates'
&gt;        arm:  w+   m53menlo dh_imx6
&gt; 02: lib: zstd: update to latest Linux zstd 1.5.2
&gt;    aarch64: (for 2/2 boards) all -3186.0 rodata +920.0 text -4106.0
&gt;        arm: (for 5/5 boards) all +1254.4 rodata +940.0 text +314.4
&gt;    sandbox: (for 2/2 boards) all -4452.0 data -16.0 rodata +640.0 text -5076.0

[1] https://github.com/torvalds/linux/commit/e0c1b49f5b674cca7b10549c53b3791d0bbc90a8
[2] https://github.com/facebook/zstd/blob/f302ad8811643c428c4e3498e28f53a0578020d3/lib/libzstd.mk#L31

Signed-off-by: Brandon Maier &lt;brandon.maier@collins.com&gt;
[trini: Set ret to -EINVAL for the error of "failed to detect
compressed" to fix warning, drop ZSTD_SRCSIZEHINT_MAX for non-Linux host
tool builds]
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/squashfs: add support for LZO decompression</title>
<updated>2020-08-24T18:11:31+00:00</updated>
<author>
<name>Joao Marcos Costa</name>
<email>joaomarcos.costa@bootlin.com</email>
</author>
<published>2020-08-18T15:17:24+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6dfed163bd842bf98fd17875067bf8643819a879'/>
<id>6dfed163bd842bf98fd17875067bf8643819a879</id>
<content type='text'>
Add call to lzo's lzo1x_decompress_safe() into sqfs_decompress().

U-Boot's LZO sources may still have some unsolved issues that could make the
decompression crash when dealing with fragmented files, so those should be
avoided. The "-no-fragments" option can be passed to mksquashfs.

Signed-off-by: Joao Marcos Costa &lt;joaomarcos.costa@bootlin.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add call to lzo's lzo1x_decompress_safe() into sqfs_decompress().

U-Boot's LZO sources may still have some unsolved issues that could make the
decompression crash when dealing with fragmented files, so those should be
avoided. The "-no-fragments" option can be passed to mksquashfs.

Signed-off-by: Joao Marcos Costa &lt;joaomarcos.costa@bootlin.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/squashfs: add support for ZSTD decompression</title>
<updated>2020-08-24T18:11:31+00:00</updated>
<author>
<name>Joao Marcos Costa</name>
<email>joaomarcos.costa@bootlin.com</email>
</author>
<published>2020-08-18T15:17:23+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=9c948f536fec115b590760c2e9e333945dfde990'/>
<id>9c948f536fec115b590760c2e9e333945dfde990</id>
<content type='text'>
Add call to ZSTD's ZSTD_decompressDCtx(). In this use case, the caller
can upper bound the decompressed size, which will be the SquashFS data
block (or metadata block) size, so there is no need to use streaming
API. Add ZSTD's worskpace to squashfs_ctxt structure.

Signed-off-by: Joao Marcos Costa &lt;joaomarcos.costa@bootlin.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add call to ZSTD's ZSTD_decompressDCtx(). In this use case, the caller
can upper bound the decompressed size, which will be the SquashFS data
block (or metadata block) size, so there is no need to use streaming
API. Add ZSTD's worskpace to squashfs_ctxt structure.

Signed-off-by: Joao Marcos Costa &lt;joaomarcos.costa@bootlin.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/squashfs: replace sqfs_decompress() parameter</title>
<updated>2020-08-24T18:11:31+00:00</updated>
<author>
<name>Joao Marcos Costa</name>
<email>joaomarcos.costa@bootlin.com</email>
</author>
<published>2020-08-18T15:17:22+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=cdc114415cb9b326545aaaf6226ed3622e057067'/>
<id>cdc114415cb9b326545aaaf6226ed3622e057067</id>
<content type='text'>
Replace 'u16 comp_type' by a reference to squashfs_ctxt structure.

Signed-off-by: Joao Marcos Costa &lt;joaomarcos.costa@bootlin.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace 'u16 comp_type' by a reference to squashfs_ctxt structure.

Signed-off-by: Joao Marcos Costa &lt;joaomarcos.costa@bootlin.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/squashfs: Add init and clean-up functions to decompression</title>
<updated>2020-08-24T18:11:31+00:00</updated>
<author>
<name>Joao Marcos Costa</name>
<email>joaomarcos.costa@bootlin.com</email>
</author>
<published>2020-08-18T15:17:21+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=10f7cf5f12a8721d6c985d4de11dac4d19e0e47e'/>
<id>10f7cf5f12a8721d6c985d4de11dac4d19e0e47e</id>
<content type='text'>
Add sqfs_decompressor_init() and sqfs_decompressor_cleanup(). These
functions are called respectively in sqfs_probe() and sqfs_close(). For
now, only ZSTD requires an initialization logic. ZSTD support will be
added in a follow-up commit.

Move squashfs_ctxt definition to sqfs_filesystem.h. This structure is
passed to sqfs_decompressor_init() and sqfs_decompressor_cleanup(), so
it can no longer be local to sqfs.c.

Signed-off-by: Joao Marcos Costa &lt;joaomarcos.costa@bootlin.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add sqfs_decompressor_init() and sqfs_decompressor_cleanup(). These
functions are called respectively in sqfs_probe() and sqfs_close(). For
now, only ZSTD requires an initialization logic. ZSTD support will be
added in a follow-up commit.

Move squashfs_ctxt definition to sqfs_filesystem.h. This structure is
passed to sqfs_decompressor_init() and sqfs_decompressor_cleanup(), so
it can no longer be local to sqfs.c.

Signed-off-by: Joao Marcos Costa &lt;joaomarcos.costa@bootlin.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/squashfs: add support for zlib decompression</title>
<updated>2020-08-08T02:31:32+00:00</updated>
<author>
<name>Joao Marcos Costa</name>
<email>joaomarcos.costa@bootlin.com</email>
</author>
<published>2020-07-30T13:33:50+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3634b35089df7e6edfe034c26e4243dc708b6382'/>
<id>3634b35089df7e6edfe034c26e4243dc708b6382</id>
<content type='text'>
Add call to zlib's 'uncompress' function. Add function to display the
right error message depending on the decompression's return value.

Signed-off-by: Joao Marcos Costa &lt;joaomarcos.costa@bootlin.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add call to zlib's 'uncompress' function. Add function to display the
right error message depending on the decompression's return value.

Signed-off-by: Joao Marcos Costa &lt;joaomarcos.costa@bootlin.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/squashfs: new filesystem</title>
<updated>2020-08-08T02:31:32+00:00</updated>
<author>
<name>Joao Marcos Costa</name>
<email>joaomarcos.costa@bootlin.com</email>
</author>
<published>2020-07-30T13:33:47+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c51006130370b48b7eb5a93ada745385aa27f6bf'/>
<id>c51006130370b48b7eb5a93ada745385aa27f6bf</id>
<content type='text'>
Add support for SquashFS filesystem. Right now, it does not support
compression but support for zlib will be added in a follow-up commit.

Signed-off-by: Joao Marcos Costa &lt;joaomarcos.costa@bootlin.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add support for SquashFS filesystem. Right now, it does not support
compression but support for zlib will be added in a follow-up commit.

Signed-off-by: Joao Marcos Costa &lt;joaomarcos.costa@bootlin.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
