mbox series

[v3,0/5] Add support for the SquashFS filesystem

Message ID 20200721092259.26916-1-joaomarcos.costa@bootlin.com
Headers show
Series Add support for the SquashFS filesystem | expand

Message

Joao Marcos Costa July 21, 2020, 9:22 a.m. UTC
Hello!

This series adds support for the SquashFS filesystem. For now, zlib is the
only supported compression type. This is my first contribution to U-Boot as
well as to a major Open Source project.

Changes in v3:
	- Replace CONFIG_IS_ENABLED by IS_ENABLED in fs/fs.c
Changes in v2:
	- Replace sqfs_ls() by U-Boot's fs_ls_generic()
	- Add info. to MAINTAINERS
	- Fix build failures
	- Fix style problems

Best regards,
Joao Marcos Costa

Joao Marcos Costa (5):
  fs/squashfs: new filesystem
  fs/squashfs: add filesystem commands
  include/u-boot, lib/zlib: add sources for zlib decompression
  fs/squashfs: add support for zlib decompression
  fs/fs.c: add symbolic link case to fs_ls_generic()

 MAINTAINERS                     |    7 +
 cmd/Kconfig                     |    6 +
 cmd/Makefile                    |    1 +
 cmd/sqfs.c                      |   42 +
 common/spl/Kconfig              |    9 +
 fs/Kconfig                      |    2 +
 fs/Makefile                     |    2 +
 fs/fs.c                         |   18 +
 fs/squashfs/Kconfig             |   10 +
 fs/squashfs/Makefile            |    7 +
 fs/squashfs/sqfs.c              | 1521 +++++++++++++++++++++++++++++++
 fs/squashfs/sqfs_decompressor.c |   53 ++
 fs/squashfs/sqfs_decompressor.h |   58 ++
 fs/squashfs/sqfs_dir.c          |  107 +++
 fs/squashfs/sqfs_filesystem.h   |  300 ++++++
 fs/squashfs/sqfs_inode.c        |  142 +++
 fs/squashfs/sqfs_utils.h        |   49 +
 include/fs.h                    |    1 +
 include/squashfs.h              |   25 +
 include/u-boot/zlib.h           |   32 +
 lib/zlib/uncompr.c              |   97 ++
 lib/zlib/zlib.c                 |    1 +
 22 files changed, 2490 insertions(+)
 create mode 100644 cmd/sqfs.c
 create mode 100644 fs/squashfs/Kconfig
 create mode 100644 fs/squashfs/Makefile
 create mode 100644 fs/squashfs/sqfs.c
 create mode 100644 fs/squashfs/sqfs_decompressor.c
 create mode 100644 fs/squashfs/sqfs_decompressor.h
 create mode 100644 fs/squashfs/sqfs_dir.c
 create mode 100644 fs/squashfs/sqfs_filesystem.h
 create mode 100644 fs/squashfs/sqfs_inode.c
 create mode 100644 fs/squashfs/sqfs_utils.h
 create mode 100644 include/squashfs.h
 create mode 100644 lib/zlib/uncompr.c

Comments

Joao Marcos Costa July 29, 2020, 12:54 p.m. UTC | #1
On Tue, 21 Jul 2020 11:22:54 +0200
Joao Marcos Costa <joaomarcos.costa@bootlin.com> wrote:

> Hello!
> 
> This series adds support for the SquashFS filesystem. For now, zlib
> is the only supported compression type. This is my first contribution
> to U-Boot as well as to a major Open Source project.
> 
> Changes in v3:
> 	- Replace CONFIG_IS_ENABLED by IS_ENABLED in fs/fs.c
> Changes in v2:
> 	- Replace sqfs_ls() by U-Boot's fs_ls_generic()
> 	- Add info. to MAINTAINERS
> 	- Fix build failures
> 	- Fix style problems
> 
> Best regards,
> Joao Marcos Costa
> 
> Joao Marcos Costa (5):
>   fs/squashfs: new filesystem
>   fs/squashfs: add filesystem commands
>   include/u-boot, lib/zlib: add sources for zlib decompression
>   fs/squashfs: add support for zlib decompression
>   fs/fs.c: add symbolic link case to fs_ls_generic()
> 
>  MAINTAINERS                     |    7 +
>  cmd/Kconfig                     |    6 +
>  cmd/Makefile                    |    1 +
>  cmd/sqfs.c                      |   42 +
>  common/spl/Kconfig              |    9 +
>  fs/Kconfig                      |    2 +
>  fs/Makefile                     |    2 +
>  fs/fs.c                         |   18 +
>  fs/squashfs/Kconfig             |   10 +
>  fs/squashfs/Makefile            |    7 +
>  fs/squashfs/sqfs.c              | 1521
> +++++++++++++++++++++++++++++++ fs/squashfs/sqfs_decompressor.c |
> 53 ++ fs/squashfs/sqfs_decompressor.h |   58 ++
>  fs/squashfs/sqfs_dir.c          |  107 +++
>  fs/squashfs/sqfs_filesystem.h   |  300 ++++++
>  fs/squashfs/sqfs_inode.c        |  142 +++
>  fs/squashfs/sqfs_utils.h        |   49 +
>  include/fs.h                    |    1 +
>  include/squashfs.h              |   25 +
>  include/u-boot/zlib.h           |   32 +
>  lib/zlib/uncompr.c              |   97 ++
>  lib/zlib/zlib.c                 |    1 +
>  22 files changed, 2490 insertions(+)
>  create mode 100644 cmd/sqfs.c
>  create mode 100644 fs/squashfs/Kconfig
>  create mode 100644 fs/squashfs/Makefile
>  create mode 100644 fs/squashfs/sqfs.c
>  create mode 100644 fs/squashfs/sqfs_decompressor.c
>  create mode 100644 fs/squashfs/sqfs_decompressor.h
>  create mode 100644 fs/squashfs/sqfs_dir.c
>  create mode 100644 fs/squashfs/sqfs_filesystem.h
>  create mode 100644 fs/squashfs/sqfs_inode.c
>  create mode 100644 fs/squashfs/sqfs_utils.h
>  create mode 100644 include/squashfs.h
>  create mode 100644 lib/zlib/uncompr.c
> 

Hello again, 

I am currently writing tests for the SquashFS support. I wrote two
Python scripts to test 'ls' and 'load' commands, but I need a SquashFS
image to do so, and I would like to know what is the better approach
for this:
- Add a compiled SquashFS image into the same directory as the tests,
i.e.: test/py/tests/test_fs/test_squashfs. This is a +-7MB sized binary
file.
- Use the scripts to generate an image, with mksquashfs. However,
mksquashfs becomes a dependency.

Best regards,
Joao Marcos
Tom Rini July 29, 2020, 3:21 p.m. UTC | #2
On Wed, Jul 29, 2020 at 02:54:56PM +0200, Joao Marcos Costa wrote:
> On Tue, 21 Jul 2020 11:22:54 +0200
> Joao Marcos Costa <joaomarcos.costa@bootlin.com> wrote:
> 
> > Hello!
> > 
> > This series adds support for the SquashFS filesystem. For now, zlib
> > is the only supported compression type. This is my first contribution
> > to U-Boot as well as to a major Open Source project.
> > 
> > Changes in v3:
> > 	- Replace CONFIG_IS_ENABLED by IS_ENABLED in fs/fs.c
> > Changes in v2:
> > 	- Replace sqfs_ls() by U-Boot's fs_ls_generic()
> > 	- Add info. to MAINTAINERS
> > 	- Fix build failures
> > 	- Fix style problems
> > 
> > Best regards,
> > Joao Marcos Costa
> > 
> > Joao Marcos Costa (5):
> >   fs/squashfs: new filesystem
> >   fs/squashfs: add filesystem commands
> >   include/u-boot, lib/zlib: add sources for zlib decompression
> >   fs/squashfs: add support for zlib decompression
> >   fs/fs.c: add symbolic link case to fs_ls_generic()
> > 
> >  MAINTAINERS                     |    7 +
> >  cmd/Kconfig                     |    6 +
> >  cmd/Makefile                    |    1 +
> >  cmd/sqfs.c                      |   42 +
> >  common/spl/Kconfig              |    9 +
> >  fs/Kconfig                      |    2 +
> >  fs/Makefile                     |    2 +
> >  fs/fs.c                         |   18 +
> >  fs/squashfs/Kconfig             |   10 +
> >  fs/squashfs/Makefile            |    7 +
> >  fs/squashfs/sqfs.c              | 1521
> > +++++++++++++++++++++++++++++++ fs/squashfs/sqfs_decompressor.c |
> > 53 ++ fs/squashfs/sqfs_decompressor.h |   58 ++
> >  fs/squashfs/sqfs_dir.c          |  107 +++
> >  fs/squashfs/sqfs_filesystem.h   |  300 ++++++
> >  fs/squashfs/sqfs_inode.c        |  142 +++
> >  fs/squashfs/sqfs_utils.h        |   49 +
> >  include/fs.h                    |    1 +
> >  include/squashfs.h              |   25 +
> >  include/u-boot/zlib.h           |   32 +
> >  lib/zlib/uncompr.c              |   97 ++
> >  lib/zlib/zlib.c                 |    1 +
> >  22 files changed, 2490 insertions(+)
> >  create mode 100644 cmd/sqfs.c
> >  create mode 100644 fs/squashfs/Kconfig
> >  create mode 100644 fs/squashfs/Makefile
> >  create mode 100644 fs/squashfs/sqfs.c
> >  create mode 100644 fs/squashfs/sqfs_decompressor.c
> >  create mode 100644 fs/squashfs/sqfs_decompressor.h
> >  create mode 100644 fs/squashfs/sqfs_dir.c
> >  create mode 100644 fs/squashfs/sqfs_filesystem.h
> >  create mode 100644 fs/squashfs/sqfs_inode.c
> >  create mode 100644 fs/squashfs/sqfs_utils.h
> >  create mode 100644 include/squashfs.h
> >  create mode 100644 lib/zlib/uncompr.c
> > 
> 
> Hello again, 
> 
> I am currently writing tests for the SquashFS support. I wrote two
> Python scripts to test 'ls' and 'load' commands, but I need a SquashFS
> image to do so, and I would like to know what is the better approach
> for this:
> - Add a compiled SquashFS image into the same directory as the tests,
> i.e.: test/py/tests/test_fs/test_squashfs. This is a +-7MB sized binary
> file.
> - Use the scripts to generate an image, with mksquashfs. However,
> mksquashfs becomes a dependency.

We should dynamically make the images, just like ext* and fat.  The
tests should skip when the required tools aren't found, in the same
manner we do for other fs tests.  Thanks!
Joao Marcos Costa July 29, 2020, 4:02 p.m. UTC | #3
On Wed, 29 Jul 2020 11:21:26 -0400
Tom Rini <trini@konsulko.com> wrote:

> On Wed, Jul 29, 2020 at 02:54:56PM +0200, Joao Marcos Costa wrote:
> > On Tue, 21 Jul 2020 11:22:54 +0200
> > Joao Marcos Costa <joaomarcos.costa@bootlin.com> wrote:
> >   
> > > Hello!
> > > 
> > > This series adds support for the SquashFS filesystem. For now,
> > > zlib is the only supported compression type. This is my first
> > > contribution to U-Boot as well as to a major Open Source project.
> > > 
> > > Changes in v3:
> > > 	- Replace CONFIG_IS_ENABLED by IS_ENABLED in fs/fs.c
> > > Changes in v2:
> > > 	- Replace sqfs_ls() by U-Boot's fs_ls_generic()
> > > 	- Add info. to MAINTAINERS
> > > 	- Fix build failures
> > > 	- Fix style problems
> > > 
> > > Best regards,
> > > Joao Marcos Costa
> > > 
> > > Joao Marcos Costa (5):
> > >   fs/squashfs: new filesystem
> > >   fs/squashfs: add filesystem commands
> > >   include/u-boot, lib/zlib: add sources for zlib decompression
> > >   fs/squashfs: add support for zlib decompression
> > >   fs/fs.c: add symbolic link case to fs_ls_generic()
> > > 
> > >  MAINTAINERS                     |    7 +
> > >  cmd/Kconfig                     |    6 +
> > >  cmd/Makefile                    |    1 +
> > >  cmd/sqfs.c                      |   42 +
> > >  common/spl/Kconfig              |    9 +
> > >  fs/Kconfig                      |    2 +
> > >  fs/Makefile                     |    2 +
> > >  fs/fs.c                         |   18 +
> > >  fs/squashfs/Kconfig             |   10 +
> > >  fs/squashfs/Makefile            |    7 +
> > >  fs/squashfs/sqfs.c              | 1521
> > > +++++++++++++++++++++++++++++++ fs/squashfs/sqfs_decompressor.c |
> > > 53 ++ fs/squashfs/sqfs_decompressor.h |   58 ++
> > >  fs/squashfs/sqfs_dir.c          |  107 +++
> > >  fs/squashfs/sqfs_filesystem.h   |  300 ++++++
> > >  fs/squashfs/sqfs_inode.c        |  142 +++
> > >  fs/squashfs/sqfs_utils.h        |   49 +
> > >  include/fs.h                    |    1 +
> > >  include/squashfs.h              |   25 +
> > >  include/u-boot/zlib.h           |   32 +
> > >  lib/zlib/uncompr.c              |   97 ++
> > >  lib/zlib/zlib.c                 |    1 +
> > >  22 files changed, 2490 insertions(+)
> > >  create mode 100644 cmd/sqfs.c
> > >  create mode 100644 fs/squashfs/Kconfig
> > >  create mode 100644 fs/squashfs/Makefile
> > >  create mode 100644 fs/squashfs/sqfs.c
> > >  create mode 100644 fs/squashfs/sqfs_decompressor.c
> > >  create mode 100644 fs/squashfs/sqfs_decompressor.h
> > >  create mode 100644 fs/squashfs/sqfs_dir.c
> > >  create mode 100644 fs/squashfs/sqfs_filesystem.h
> > >  create mode 100644 fs/squashfs/sqfs_inode.c
> > >  create mode 100644 fs/squashfs/sqfs_utils.h
> > >  create mode 100644 include/squashfs.h
> > >  create mode 100644 lib/zlib/uncompr.c
> > >   
> > 
> > Hello again, 
> > 
> > I am currently writing tests for the SquashFS support. I wrote two
> > Python scripts to test 'ls' and 'load' commands, but I need a
> > SquashFS image to do so, and I would like to know what is the
> > better approach for this:
> > - Add a compiled SquashFS image into the same directory as the
> > tests, i.e.: test/py/tests/test_fs/test_squashfs. This is a +-7MB
> > sized binary file.
> > - Use the scripts to generate an image, with mksquashfs. However,
> > mksquashfs becomes a dependency.  
> 
> We should dynamically make the images, just like ext* and fat.  The
> tests should skip when the required tools aren't found, in the same
> manner we do for other fs tests.  Thanks!
> 

Ok, thank you!

Best regards,
Joao Marcos