summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2016-01-20 19:45:36 +0000
committerBen Hutchings <ben@decadent.org.uk>2016-01-20 20:52:53 +0000
commit913a861175d65a5423f4de47c4a033b94485ec28 (patch)
treec56fea5fbc833dea69345e0de2285b201927d50d
parent3084929076627b9388b123a06ecaebc469c8cb27 (diff)
debian/control: Recommend the right busybox packages for the target distribution
Ubuntu's busybox and busybox-static are no use in an initramfs, so instead of listing all variants of busybox, check for Ubuntu derivatives at build time. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--debian/control2
-rwxr-xr-xdebian/rules9
2 files changed, 10 insertions, 1 deletions
diff --git a/debian/control b/debian/control
index f31dd05..9263e1c 100644
--- a/debian/control
+++ b/debian/control
@@ -24,7 +24,7 @@ Description: generic modular initramfs generator (automation)
Package: initramfs-tools-core
Architecture: all
Multi-Arch: foreign
-Recommends: busybox (>= 1:1.01-3) | busybox-initramfs | busybox-static
+Recommends: ${busybox:Recommends}
Depends: klibc-utils (>= 2.0.4-7~), cpio, kmod | module-init-tools, udev, ${misc:Depends}
Suggests: bash-completion
Breaks: initramfs-tools (<< 0.121~)
diff --git a/debian/rules b/debian/rules
index e6e920c..ea2ff3b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,3 +2,12 @@
%:
dh --with bash-completion $@
+
+# On Debian we can use either busybox or busybox-static, but on Ubuntu
+# and derivatives only busybox-initramfs will work.
+BUSYBOX_PACKAGES := $(shell if dpkg-vendor --derives-from ubuntu; then echo busybox-initramfs; else echo busybox busybox-static; fi)
+BUSYBOX_MIN_VERSION := 1:1.01-3
+
+override_dh_gencontrol:
+ echo >> debian/initramfs-tools-core.substvars "busybox:Recommends=$(wordlist 2,100,$(BUSYBOX_PACKAGES:%=| % (>= $(BUSYBOX_MIN_VERSION))))"
+ dh_gencontrol