Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] fs: squashfs: Add config option to pass mksquashfs cmdln paramters.
Date: Sun, 14 Jun 2020 09:57:25 +0200	[thread overview]
Message-ID: <20200614075725.GD2346@scaer> (raw)
In-Reply-To: <20200612133249.4127906-1-heiko@sntech.de>

Heiko, All,

On 2020-06-12 15:32 +0200, Heiko Stuebner spake thusly:
> From: Christoph Muellner <christoph.muellner@theobroma-systems.com>
> 
> This can be use to specify additional command line argument to
> mksquashfs (e.g. -nopad). The implementation is inspired by
> a similar mechanism for ext file system images.

What kind of options do you expect to need to pass?

Usually, I'd prefer we have common options directly mapped to entries in
the menuconfig, and keep this kind of "pass-through" options for more
exotic options.

For example, if we are looking at the compression options, I'd like we
add a config option like

    config BR2_TARGET_ROOTFS_SQUASHFS_EXTRA_COMPRESS
        bool "high-compression"
        depends on !BR2_TARGET_ROOTFS_SQUASHFS4_LZMA # No option
        help
          Say 'y' to compress even further, at the expense of
          compression time.

          For example:
            - for gzip, this enables all the -Xstrategy
            - for lz4, this enables -Xhc
            - for lzo, this enables -Xcompression-level 9
            - for xz, this chooses appropriate -Xbcj filters
            - for zstd, this enables -Xcompression-level 22

And maybe a few other such options, eventually adding the
BR2_TARGET_ROOTFS_SQUASHFS_MKFS_OPTIONS for corner-cases only.

> Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
> Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
> ---
>  fs/squashfs/Config.in   | 11 +++++++++++
>  fs/squashfs/squashfs.mk |  8 +++++++-
>  2 files changed, 18 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/squashfs/Config.in b/fs/squashfs/Config.in
> index dde2097cb7..789b2cd24a 100644
> --- a/fs/squashfs/Config.in
> +++ b/fs/squashfs/Config.in
> @@ -5,6 +5,16 @@ config BR2_TARGET_ROOTFS_SQUASHFS
>  
>  if BR2_TARGET_ROOTFS_SQUASHFS
>  
> +config BR2_TARGET_ROOTFS_SQUASHFS_MKFS_OPTIONS
> +	string "additional mksquashfs options"
> +	default ""
> +	help
> +	  Specify a space-separated list of mksquashfs options, including
> +	  any squashfs filesystem features.
> +
> +	  For more information about the mke2fs options, see the manual

s/mke2fs/mksquashfs/

> +	  page mksquashfs(1).
> +
>  choice
>  	prompt "Compression algorithm"
>  	default BR2_TARGET_ROOTFS_SQUASHFS4_GZIP
> @@ -31,4 +41,5 @@ config BR2_TARGET_ROOTFS_SQUASHFS4_ZSTD
>  	bool "zstd"
>  
>  endchoice
> +
>  endif
> diff --git a/fs/squashfs/squashfs.mk b/fs/squashfs/squashfs.mk
> index 34ab048603..4bc6b338b0 100644
> --- a/fs/squashfs/squashfs.mk
> +++ b/fs/squashfs/squashfs.mk
> @@ -6,7 +6,13 @@
>  
>  ROOTFS_SQUASHFS_DEPENDENCIES = host-squashfs
>  
> -ROOTFS_SQUASHFS_ARGS = -noappend -processors $(PARALLEL_JOBS)
> +SQUASHFS_MKFS_OPTS = $(call qstrip,$(BR2_TARGET_ROOTFS_SQUASHFS_MKFS_OPTIONS))

Keep the vairalbes prefixed with ROOTFS_ here, to avoid clashing with
the package namespace: SQUASHFS_MKFS_OPTS by name would be a variable of
the "squashfs" package.

> +ROOTFS_SQUASHFS_ARGS = \
> +	-noappend \
> +	-processors \
> +	$(PARALLEL_JOBS) \

$(PARALLEL_JOBS) is a parameter to the --processor option, so it should
be on the same line.

However, I don;t think you need to introduce an intermediate variable:

    ROOTFS_SQUASHFS_ARGS = \
        -noappend \
        -processors $(PARALLEL_JOBS) \
        $(call qstrip,$(BR2_TARGET_ROOTFS_SQUASHFS_MKFS_OPTIONS))

Regards,
Yann E. MORIN.

> +	$(SQUASHFS_MKFS_OPTS)
>  
>  ifeq ($(BR2_TARGET_ROOTFS_SQUASHFS4_LZ4),y)
>  ROOTFS_SQUASHFS_ARGS += -comp lz4 -Xhc
> -- 
> 2.26.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2020-06-14  7:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-12 13:32 [Buildroot] [PATCH] fs: squashfs: Add config option to pass mksquashfs cmdln paramters Heiko Stuebner
2020-06-14  7:57 ` Yann E. MORIN [this message]
2020-06-14 10:20   ` Heiko Stübner
2020-06-14 10:37     ` Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200614075725.GD2346@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox