Skip to contentSkip to conversation

Makefile: Force gzip and xz on module install

PATCH In review Jason A. Donenfeld 2 participants 3 messages Jul 7, 2015 – Jul 22, 2015 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: Force gzip and xz on module install

Running make modules_install ordinarily will overwrite existing modules. This is the desired behavior, and is how pretty much every other make install target works.

However, if CONFIG_MODULE_COMPRESS is enabled, modules are passed through gzip and xz which then do the file writing. Both gzip and xz will error out if the file already exists, unless -f is passed.

This patch adds -f so that the behavior is uniform.

---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -2
index 6c6f146..5d2ec1c 100644
@@ -849,10 +849,10 @@ export mod_strip_cmd
 mod_compress_cmd = true
 ifdef CONFIG_MODULE_COMPRESS
   ifdef CONFIG_MODULE_COMPRESS_GZIP
-    mod_compress_cmd = gzip -n
+    mod_compress_cmd = gzip -n -f
   endif # CONFIG_MODULE_COMPRESS_GZIP
   ifdef CONFIG_MODULE_COMPRESS_XZ
-    mod_compress_cmd = xz
+    mod_compress_cmd = xz -f
   endif # CONFIG_MODULE_COMPRESS_XZ
 endif # CONFIG_MODULE_COMPRESS
 export mod_compress_cmd
Signature · 1 line
2.4.2
#1 lore raw

Bump? This should be trivial to merge, and it fixes a really annoying bug for module development.

Quoted 35 lines · Jason A. Donenfeld

Running make modules_install ordinarily will overwrite existing modules. This is the desired behavior, and is how pretty much every other make install target works.

However, if CONFIG_MODULE_COMPRESS is enabled, modules are passed through gzip and xz which then do the file writing. Both gzip and xz will error out if the file already exists, unless -f is passed.

This patch adds -f so that the behavior is uniform.

---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -3
index 6c6f146..5d2ec1c 100644
@@ -849,10 +849,10 @@ export mod_strip_cmd
 mod_compress_cmd = true
 ifdef CONFIG_MODULE_COMPRESS
   ifdef CONFIG_MODULE_COMPRESS_GZIP
-    mod_compress_cmd = gzip -n
+    mod_compress_cmd = gzip -n -f
   endif # CONFIG_MODULE_COMPRESS_GZIP
   ifdef CONFIG_MODULE_COMPRESS_XZ
-    mod_compress_cmd = xz
+    mod_compress_cmd = xz -f
   endif # CONFIG_MODULE_COMPRESS_XZ
 endif # CONFIG_MODULE_COMPRESS
 export mod_compress_cmd
--

2.4.2

#2 lore raw
In reply to Jason A. Donenfeld

Dne 7.7.2015 v 20:26 Jason A. Donenfeld napsal(a):

Quoted 11 lines

Running make modules_install ordinarily will overwrite existing modules. This is the desired behavior, and is how pretty much every other make install target works.

However, if CONFIG_MODULE_COMPRESS is enabled, modules are passed through gzip and xz which then do the file writing. Both gzip and xz will error out if the file already exists, unless -f is passed.

This patch adds -f so that the behavior is uniform.

Applied to kbuild.git#rc-fixes.

Michal