Skip to contentSkip to conversation

squashfs-tools: Allow COMP_DEFAULT to be changed easily at build time

PATCH Superseded Peter Morrow 3 participants 7 messages Sep 11, 2020 – Sep 14, 2020

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 squashfs-tools: Allow COMP_DEFAULT to be changed easily at build time

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.

---
 ...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
meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch new file +34 -0
new file mode 100644
index 0000000..5f12c42
@@ -0,0 +1,34 @@
+From d2d9b517696f5950597f5b60ae8fdade5b7c14a9 Mon Sep 17 00:00:00 2001
+From: Peter Morrow <[email protected]>
+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 <[email protected]>
+---
+ 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
+
meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb +4 -0
index b06951d..df025d4 100644
@@ -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}"
+
 do_compile() {
 	oe_runmake all
 }
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 18 lines · Peter Morrow

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.

---
 ...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
meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch new file +0 -0
new file mode 100644
index 0000000..5f12c42

meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch line 10

Quoted 10 lines
meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch new file +10 -0
@@ -0,0 +1,34 @@
+From d2d9b517696f5950597f5b60ae8fdade5b7c14a9 Mon Sep 17 00:00:00 2001
+From: Peter Morrow <[email protected]>
+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?

Quoted 36 lines
meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch new file +23 -0
+Upstream-Status: Submitted [https://github.com/plougher/squashfs-tools/pull/93 ]
+
+Signed-off-by: Peter Morrow <[email protected]>
+---
+ 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
+
meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb +1 -0
index b06951d..df025d4 100644
@@ -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"

meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb PACKAGECONFIG[xattr] = "XATTR_SUPPORT=1,XATTR_SUPPORT=0,attr" · line 30

Quoted 5 lines
meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb +2 -0
@@ -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.

Quoted 7 lines
meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb +0 -1
 do_compile() {
        oe_runmake all
 }
--

1.8.3.1

#2 lore raw
Quoted 34 lines · Andre McCurdy
Quoted 18 lines · Peter Morrow

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.

---
 ...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
meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch new file +0 -0
new file mode 100644
index 0000000..5f12c42

meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch line 10

Quoted 10 lines
meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch new file +10 -0
@@ -0,0 +1,34 @@
+From d2d9b517696f5950597f5b60ae8fdade5b7c14a9 Mon Sep 17 00:00:00 2001
+From: Peter Morrow <[email protected]>
+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.

Quoted 2 lines

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

that works if make is invoked with -e option, We do not use make -e with bare makefile based recipes.

Quoted 57 lines
Quoted 37 lines
meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch new file +23 -0
+Upstream-Status: Submitted [https://github.com/plougher/squashfs-tools/pull/93 ]
+
+Signed-off-by: Peter Morrow <[email protected]>
+---
+ 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
+
meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb +1 -0
index b06951d..df025d4 100644
@@ -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"

meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb PACKAGECONFIG[xattr] = "XATTR_SUPPORT=1,XATTR_SUPPORT=0,attr" · line 30

Quoted 5 lines
meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb +2 -0
@@ -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.

Quoted 9 lines
meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb +0 -1
 do_compile() {
        oe_runmake all
 }
--

1.8.3.1

#3 lore raw
Quoted 38 lines · Khem Raj
Quoted 34 lines · Andre McCurdy
Quoted 18 lines · Peter Morrow

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.

---
 ...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
meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch new file +0 -0
new file mode 100644
index 0000000..5f12c42

meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch line 10

Quoted 10 lines
meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch new file +10 -0
@@ -0,0 +1,34 @@
+From d2d9b517696f5950597f5b60ae8fdade5b7c14a9 Mon Sep 17 00:00:00 2001
+From: Peter Morrow <[email protected]>
+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.

Quoted 5 lines
Quoted 2 lines

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

that works if make is invoked with -e option, We do not use make -e with bare makefile based recipes.

The -e option is related to environment variables. It's not relevant for this discussion - which is about setting options via the make command line.

Quoted 56 lines
Quoted 56 lines
Quoted 36 lines
meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch new file +23 -0
+Upstream-Status: Submitted [https://github.com/plougher/squashfs-tools/pull/93 ]
+
+Signed-off-by: Peter Morrow <[email protected]>
+---
+ 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
+
meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb +1 -0
index b06951d..df025d4 100644
@@ -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"

meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb PACKAGECONFIG[xattr] = "XATTR_SUPPORT=1,XATTR_SUPPORT=0,attr" · line 30

Quoted 5 lines
meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb +2 -0
@@ -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.

Quoted 9 lines
meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb +0 -1
 do_compile() {
        oe_runmake all
 }
--

1.8.3.1

#4 lore raw
Quoted 43 lines · Andre McCurdy
Quoted 41 lines · Khem Raj
Quoted 36 lines · Andre McCurdy
Quoted 18 lines · Peter Morrow

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.

---
 ...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
meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch new file +0 -0
new file mode 100644
index 0000000..5f12c42

meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch line 10

Quoted 10 lines
meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch new file +10 -0
@@ -0,0 +1,34 @@
+From d2d9b517696f5950597f5b60ae8fdade5b7c14a9 Mon Sep 17 00:00:00 2001
+From: Peter Morrow <[email protected]>
+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?

Quoted 7 lines
Quoted 2 lines

that works if make is invoked with -e option, We do not use make -e with bare makefile based recipes.

The -e option is related to environment variables. It's not relevant for this discussion - which is about setting options via the make command line.

I somehow oversaw the fact its being passed as make variable on cmdline and not becoming
an export. so you are right, I think we don't need the patch perhaps setting it via EXTRA_OEMAKE
should suffice

Quoted 56 lines
Quoted 56 lines
Quoted 56 lines
Quoted 36 lines
meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch new file +23 -0
+Upstream-Status: Submitted [https://github.com/plougher/squashfs-tools/pull/93 ]
+
+Signed-off-by: Peter Morrow <[email protected]>
+---
+ 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
+
meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb +1 -0
index b06951d..df025d4 100644
@@ -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"

meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb PACKAGECONFIG[xattr] = "XATTR_SUPPORT=1,XATTR_SUPPORT=0,attr" · line 30

Quoted 5 lines
meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb +2 -0
@@ -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.

Quoted 9 lines
meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb +0 -1
 do_compile() {
        oe_runmake all
 }
--

1.8.3.1

#5 lore raw
Quoted 52 lines · Khem Raj
Quoted 43 lines · Andre McCurdy
Quoted 41 lines · Khem Raj
Quoted 36 lines · Andre McCurdy
Quoted 18 lines · Peter Morrow

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.

---
 ...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
meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch new file +0 -0
new file mode 100644
index 0000000..5f12c42

meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch line 10

Quoted 10 lines
meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch new file +10 -0
@@ -0,0 +1,34 @@
+From d2d9b517696f5950597f5b60ae8fdade5b7c14a9 Mon Sep 17 00:00:00 2001
+From: Peter Morrow <[email protected]>
+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?

Quoted 7 lines
Quoted 2 lines

that works if make is invoked with -e option, We do not use make -e with bare makefile based recipes.

The -e option is related to environment variables. It's not relevant for this discussion - which is about setting options via the make command line.

Quoted 5 lines

I somehow oversaw the fact its being passed as make variable on cmdline and not becoming
an export. so you are right, I think we don't need the patch perhaps setting it via EXTRA_OEMAKE
should suffice

Yes, not sure what I was thinking. I've tested again without the squashfs-tools patch and setting via EXTRA_OEMAKE works as expected.

Thanks,
Peter.

Quoted 59 lines
Quoted 57 lines
Quoted 57 lines
Quoted 57 lines
Quoted 37 lines
meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch new file +23 -0
+Upstream-Status: Submitted [https://github.com/plougher/squashfs-tools/pull/93 ]
+
+Signed-off-by: Peter Morrow <[email protected]>
+---
+ 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
+
meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb +1 -0
index b06951d..df025d4 100644
@@ -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"

meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb PACKAGECONFIG[xattr] = "XATTR_SUPPORT=1,XATTR_SUPPORT=0,attr" · line 30

Quoted 5 lines
meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb +2 -0
@@ -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.

Quoted 9 lines
meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb +0 -1
 do_compile() {
        oe_runmake all
 }
--

1.8.3.1

#6 lore raw
In reply to Khem Raj
Quoted 37 lines · Khem Raj
Quoted 34 lines · Andre McCurdy
Quoted 18 lines · Peter Morrow

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.

---
 ...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
meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch new file +0 -0
new file mode 100644
index 0000000..5f12c42

meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch line 10

Quoted 10 lines
meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch new file +10 -0
@@ -0,0 +1,34 @@
+From d2d9b517696f5950597f5b60ae8fdade5b7c14a9 Mon Sep 17 00:00:00 2001
+From: Peter Morrow <[email protected]>
+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.

Quoted 53 lines
Quoted 2 lines

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

that works if make is invoked with -e option, We do not use make -e with bare makefile based recipes.

Quoted 47 lines
Quoted 37 lines
meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch new file +23 -0
+Upstream-Status: Submitted [https://github.com/plougher/squashfs-tools/pull/93 ]
+
+Signed-off-by: Peter Morrow <[email protected]>
+---
+ 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
+
meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb +1 -0
index b06951d..df025d4 100644
@@ -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"

meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb PACKAGECONFIG[xattr] = "XATTR_SUPPORT=1,XATTR_SUPPORT=0,attr" · line 30

Quoted 5 lines
meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb +2 -0
@@ -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.

Yep, good point. I covered this in V1, though have not covered it in V3. I'm happy to add something to cover this in a V4 if you'd like?

Thanks,
Peter.

Quoted 13 lines
Quoted 10 lines
Quoted 10 lines
meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb +0 -1
 do_compile() {
        oe_runmake all
 }
--

1.8.3.1

pub 1024D/919D3314 2009-08-28 Khem Raj <[email protected]> sub 4096g/7CF5958F 2009-08-28