* [PATCH] squashfs-tools: Allow COMP_DEFAULT to be changed easily at build time
@ 2020-09-11 10:56 pemorrow
2020-09-11 11:47 ` [OE-core] " Ross Burton
0 siblings, 1 reply; 3+ messages in thread
From: pemorrow @ 2020-09-11 10:56 UTC (permalink / raw)
To: openembedded-core
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 | 8 +++++
2 files changed, 42 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.
+
+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..3c816cb 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,13 @@ 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,"
+python () {
+ # Change the default compression algorithm if requested.
+ comp_default = d.getVar('SQUASHFS_TOOLS_COMP_DEFAULT')
+ if comp_default != None:
+ d.appendVar('EXTRA_OEMAKE', ' COMP_DEFAULT=%s' % comp_default)
+}
+
do_compile() {
oe_runmake all
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [OE-core] [PATCH] squashfs-tools: Allow COMP_DEFAULT to be changed easily at build time
2020-09-11 10:56 [PATCH] squashfs-tools: Allow COMP_DEFAULT to be changed easily at build time pemorrow
@ 2020-09-11 11:47 ` Ross Burton
2020-09-11 17:13 ` Peter Morrow
0 siblings, 1 reply; 3+ messages in thread
From: Ross Burton @ 2020-09-11 11:47 UTC (permalink / raw)
To: Peter Morrow; +Cc: OE-core
> +python () {
> + # Change the default compression algorithm if requested.
> + comp_default = d.getVar('SQUASHFS_TOOLS_COMP_DEFAULT')
> + if comp_default != None:
> + d.appendVar('EXTRA_OEMAKE', ' COMP_DEFAULT=%s' % comp_default)
> +}
> +
This is overcomplicated. Just do:
SQUASHFS_TOOLS_COMP_DEFAULT ?= "gzip"
EXTRA_OEMAKE += "COMP_DEFAULT=${SQUASHFS_TOOLS_COMP_DEFAULT}"
This way the default is documented in the recipe, and we can change
the default easily too.
Ross
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [OE-core] [PATCH] squashfs-tools: Allow COMP_DEFAULT to be changed easily at build time
2020-09-11 11:47 ` [OE-core] " Ross Burton
@ 2020-09-11 17:13 ` Peter Morrow
0 siblings, 0 replies; 3+ messages in thread
From: Peter Morrow @ 2020-09-11 17:13 UTC (permalink / raw)
To: Ross Burton; +Cc: OE-core
On Fri, Sep 11, 2020 at 12:47:44PM +0100, Ross Burton wrote:
> > +python () {
> > + # Change the default compression algorithm if requested.
> > + comp_default = d.getVar('SQUASHFS_TOOLS_COMP_DEFAULT')
> > + if comp_default != None:
> > + d.appendVar('EXTRA_OEMAKE', ' COMP_DEFAULT=%s' % comp_default)
> > +}
> > +
>
> This is overcomplicated. Just do:
>
> SQUASHFS_TOOLS_COMP_DEFAULT ?= "gzip"
> EXTRA_OEMAKE += "COMP_DEFAULT=${SQUASHFS_TOOLS_COMP_DEFAULT}"
>
> This way the default is documented in the recipe, and we can change
> the default easily too.
ACK. V2 coming.
Thanks,
Peter.
>
> Ross
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-09-11 17:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-11 10:56 [PATCH] squashfs-tools: Allow COMP_DEFAULT to be changed easily at build time pemorrow
2020-09-11 11:47 ` [OE-core] " Ross Burton
2020-09-11 17:13 ` Peter Morrow
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.