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 <b...@decadent.org.uk>
---
 debian/control | 2 +-
 debian/rules   | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

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

Attachment: signature.asc
Description: Digital signature

Reply via email to