All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andre McCurdy" <armccurdy@gmail.com>
To: Peter Morrow <pemorrow@linux.microsoft.com>
Cc: OE Core mailing list <openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [PATCH v2] squashfs-tools: Allow COMP_DEFAULT to be changed easily at build time
Date: Fri, 11 Sep 2020 10:33:04 -0700	[thread overview]
Message-ID: <CAJ86T=UPhup8G+e6yt2X9=smV9Y3oMQ=kvZB0K_ivp5ZwKDDCg@mail.gmail.com> (raw)
In-Reply-To: <1599844862-15857-1-git-send-email-pemorrow@linux.microsoft.com>

On Fri, Sep 11, 2020 at 10:21 AM Peter Morrow
<pemorrow@linux.microsoft.com> wrote:
>
> The default compression algorithm is gzip, this patch allows the default
> to be changed via a bbappend file by setting SQUASHFS_TOOLS_COMP_DEFAULT
> to a valid compression algorithm.
>
> Signed-off-by: Peter Morrow <pemorrow@linux.microsoft.com>
> ---
>  ...ols-Allow-COMP_DEFAULT-to-be-overridden-v.patch | 34 ++++++++++++++++++++++
>  .../squashfs-tools/squashfs-tools_git.bb           |  4 +++
>  2 files changed, 38 insertions(+)
>  create mode 100644 meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch
>
> diff --git a/meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch b/meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch
> new file mode 100644
> index 0000000..5f12c42
> --- /dev/null
> +++ b/meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch
> @@ -0,0 +1,34 @@
> +From d2d9b517696f5950597f5b60ae8fdade5b7c14a9 Mon Sep 17 00:00:00 2001
> +From: Peter Morrow <pemorrow@linux.microsoft.com>
> +Date: Fri, 4 Sep 2020 15:43:15 +0100
> +Subject: [PATCH] squashfs-tools: Allow COMP_DEFAULT to be overridden via make
> + cmdline
> +
> +Currently the only way to modify the default compression algorithm is to
> +modify the Makefile. It is useful to be able to set the default compression
> +algorithm via the make command line since otherwise a build time search
> +replace operation needs to be performed on the Makefile.

That's not how Makefiles normally work. Options set via the command
line over-ride variables set with = in the Makefile.

Does setting your chosen value for COMP_DEFAULT on the make command
line really not work?

> +Upstream-Status: Submitted [https://github.com/plougher/squashfs-tools/pull/93 ]
> +
> +Signed-off-by: Peter Morrow <pemorrow@linux.microsoft.com>
> +---
> + squashfs-tools/Makefile | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/squashfs-tools/Makefile b/squashfs-tools/Makefile
> +index aee4b96..7425605 100644
> +--- a/squashfs-tools/Makefile
> ++++ b/squashfs-tools/Makefile
> +@@ -85,7 +85,7 @@ GZIP_SUPPORT = 1
> + # in Mksquashfs.  Obviously the compression algorithm must have been
> + # selected to be built
> + #
> +-COMP_DEFAULT = gzip
> ++COMP_DEFAULT ?= gzip
> +
> +
> + ###############################################
> +--
> +2.20.1
> +
> diff --git a/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb b/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
> index b06951d..df025d4 100644
> --- a/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
> +++ b/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
> @@ -9,6 +9,7 @@ PV = "4.4"
>  SRCREV = "52eb4c279cd283ed9802dd1ceb686560b22ffb67"
>  SRC_URI = "git://github.com/plougher/squashfs-tools.git;protocol=https \
>             file://0001-squashfs-tools-fix-build-failure-against-gcc-10.patch;striplevel=2 \
> +           file://0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch;striplevel=2 \
>  "
>
>  S = "${WORKDIR}/git/squashfs-tools"
> @@ -25,6 +26,9 @@ PACKAGECONFIG[xattr] = "XATTR_SUPPORT=1,XATTR_SUPPORT=0,attr"
>  PACKAGECONFIG[zstd] = "ZSTD_SUPPORT=1,ZSTD_SUPPORT=0,zstd"
>  PACKAGECONFIG[reproducible] = "REPRODUCIBLE_DEFAULT=1,REPRODUCIBLE_DEFAULT=0,"
>
> +SQUASHFS_TOOLS_COMP_DEFAULT ?= "gzip"
> +EXTRA_OEMAKE += "COMP_DEFAULT=${SQUASHFS_TOOLS_COMP_DEFAULT}"

Note that this will force the recipe's default value even if upstream
squashfs-tools changes. Not a problem now as the two are the same, but
something which will need to be checked each time squashfs-tools is
updated.

>  do_compile() {
>         oe_runmake all
>  }
> --
> 1.8.3.1
>
> 

  reply	other threads:[~2020-09-11 17:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11 17:21 [PATCH v2] squashfs-tools: Allow COMP_DEFAULT to be changed easily at build time Peter Morrow
2020-09-11 17:33 ` Andre McCurdy [this message]
2020-09-12  5:04   ` [OE-core] " Khem Raj
2020-09-12  6:36     ` Andre McCurdy
2020-09-12  7:37       ` Khem Raj
2020-09-14  9:17         ` Peter Morrow
2020-09-14  9:56     ` Peter Morrow

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='CAJ86T=UPhup8G+e6yt2X9=smV9Y3oMQ=kvZB0K_ivp5ZwKDDCg@mail.gmail.com' \
    --to=armccurdy@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=pemorrow@linux.microsoft.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.