Skip to contentSkip to conversation

kbuild, deb-pkg: pass options to dpkg-deb via KBUILD_DEBOPTS

PATCH New Romain Francoise 1 participant 1 message Mar 11, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild, deb-pkg: pass options to dpkg-deb via KBUILD_DEBOPTS

Call dpkg-deb directly instead of using the dpkg front-end, and pass it any options found in the new KBUILD_DEBOPTS variable. With "-Zxz", this allows compressing packages with xz instead of gzip, which provides very significant space savings (x86-64 allmodconfig):

                                gzip    xz
    linux-firmware-image.deb    1.2M    903K
    linux-headers.deb           7.3M    5.1M
    linux-image.deb             197M    118M
    linux-libc-dev.deb          855K    653K
---
 Documentation/kbuild/kbuild.txt |    6 ++++++
 scripts/package/builddeb        |    2 +-
 2 files changed, 7 insertions(+), 1 deletions(-)
 mode change 100644 => 100755 scripts/package/builddeb
Documentation/kbuild/kbuild.txt +6 -0
index 68e32bb..63897fb 100644
@@ -81,6 +81,12 @@ the UTS_MACHINE variable, and on some architectures also the kernel config.
 The value of KBUILD_DEBARCH is assumed (not checked) to be a valid Debian
 architecture.
 
+KBUILD_DEBOPTS
+--------------------------------------------------
+For the deb-pkg target, allows passing options to dpkg-deb. For example,
+setting this variable to "-Zxz" will result in xz-compressed packages
+(instead of the default gzip).
+
 ARCH
 --------------------------------------------------
 Set ARCH to the architecture to be built.
scripts/package/builddeb +1 -1
old mode 100644
new mode 100755
index 3c6c0b1..f44f0a8
@@ -63,7 +63,7 @@ create_package() {
 
 	# Create the package
 	dpkg-gencontrol -isp $forcearch -p$pname -P"$pdir"
-	dpkg --build "$pdir" ..
+	dpkg-deb $KBUILD_DEBOPTS --build "$pdir" ..
 }
 
 # Some variables and settings used throughout the script
Signature · 1 line
1.7.9.1