[trusty][PATCH] UBUNTU: [Debian] Don't depend on initramfs-tools

Marcelo Henrique Cerri marcelo.cerri at canonical.com
Tue Aug 8 19:16:04 UTC 2017


BugLink: http://bugs.launchpad.net/bugs/1700972

Allow images to be created without the need of an initrd and also allow
users to run without an initrd if they want to.

Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri at canonical.com>
---
 debian.master/control.d/flavour-control.stub | 4 ++--
 debian/control-scripts/postinst              | 2 +-
 debian/control-scripts/postrm                | 2 ++
 debian/control-scripts/preinst               | 2 ++
 debian/control-scripts/prerm                 | 1 +
 5 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/debian.master/control.d/flavour-control.stub b/debian.master/control.d/flavour-control.stub
index 3ecf4102d38e..31db80382da3 100644
--- a/debian.master/control.d/flavour-control.stub
+++ b/debian.master/control.d/flavour-control.stub
@@ -27,9 +27,9 @@ Section: kernel
 Priority: optional
 Pre-Depends: dpkg (>= 1.10.24)
 Provides: linux-image, linux-image-3.0, fuse-module, =PROVIDES=
-Depends: ${misc:Depends}, ${shlibs:Depends}, initramfs-tools (>= 0.36ubuntu6), module-init-tools (>= 3.3-pre11-4ubuntu3)
+Depends: ${misc:Depends}, ${shlibs:Depends}, module-init-tools (>= 3.3-pre11-4ubuntu3)
 Conflicts: hotplug (<< 0.0.20040105-1)
-Recommends: BOOTLOADER
+Recommends: BOOTLOADER, initramfs-tools (>= 0.36ubuntu6)
 Suggests: fdutils, SRCPKGNAME-doc-PKGVER | SRCPKGNAME-source-PKGVER, SRCPKGNAME-tools, linux-headers-PKGVER-ABINUM-FLAVOUR
 Description: Linux kernel image for version PKGVER on DESC
  This package contains the Linux kernel image for version PKGVER on
diff --git a/debian/control-scripts/postinst b/debian/control-scripts/postinst
index c4fc23f680c3..f8c884a96e81 100644
--- a/debian/control-scripts/postinst
+++ b/debian/control-scripts/postinst
@@ -142,7 +142,7 @@ if (-r "$CONF_LOC" && -f "$CONF_LOC"  ) {
   }
 }
 
-
+$initrd = '' if (! -x "$ramdisk");
 
 # For some versions of kernel-package, we had this warning in the
 # postinst, but the rules did not really interpolate the value in.
diff --git a/debian/control-scripts/postrm b/debian/control-scripts/postrm
index 227e351fc59b..9879178e2147 100644
--- a/debian/control-scripts/postrm
+++ b/debian/control-scripts/postrm
@@ -156,6 +156,8 @@ if (-r "$CONF_LOC" && -f "$CONF_LOC"  ) {
   }
 }
 
+$initrd = '' if (! -x "$ramdisk");
+
 if ($link_in_boot) {
   $image_dest = "/$image_dir/";
   $image_dest =~ s|^/*|/|o;
diff --git a/debian/control-scripts/preinst b/debian/control-scripts/preinst
index 972377609fce..4c70e36b9631 100644
--- a/debian/control-scripts/preinst
+++ b/debian/control-scripts/preinst
@@ -161,6 +161,8 @@ if (-r "$CONF_LOC" && -f "$CONF_LOC"  ) {
   }
 }
 
+$initrd = '' if (! -x "$ramdisk");
+
 $ENV{KERNEL_ARCH}=$kernel_arch if $kernel_arch;
 
 # About to upgrade this package from version $2 TO THIS VERSION.
diff --git a/debian/control-scripts/prerm b/debian/control-scripts/prerm
index 07e41461d3ab..755247f8e35e 100644
--- a/debian/control-scripts/prerm
+++ b/debian/control-scripts/prerm
@@ -163,6 +163,7 @@ if (-r "$CONF_LOC" && -f "$CONF_LOC"  ) {
   }
 }
 
+$initrd = '' if (! -x "$ramdisk");
 
 $ENV{KERNEL_ARCH}=$kernel_arch if $kernel_arch;
 
-- 
2.7.4





More information about the kernel-team mailing list