Patchwork [1/1] UBUNTU: [Config] linux-image-extras needs full postinst

login
register
mail settings
Submitter Andy Whitcroft
Date May 30, 2012, 12:23 p.m.
Message ID <1338380580-24178-2-git-send-email-apw@canonical.com>
Download mbox | patch
Permalink /patch/161957/
State New
Headers show

Comments

Andy Whitcroft - May 30, 2012, 12:23 p.m.
Currently after installing the linux-image-extras package we attempt to
rebuild the module lists (via depmod) which succeeds, and then rebuild the
initramfs which does not.  We call update-initramfs but this does not works
from a kernel postinst, we end up indicating that we would like to trigger
a delayed initramfs build but do not actually then go on to trigger it
(which is positive as it would likely build the wrong initramfs anyhow).

When we install the extras package we may well need to perform whatever
processing we perform when the original kernel is installed.  Use the
same post installation/post remove hooks.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 debian/control-scripts/postinst.extra |    8 --------
 debian/control-scripts/postrm.extra   |    8 --------
 debian/rules.d/2-binary-arch.mk       |    5 +++--
 3 files changed, 3 insertions(+), 18 deletions(-)
 delete mode 100644 debian/control-scripts/postinst.extra
 delete mode 100644 debian/control-scripts/postrm.extra
Tim Gardner - May 30, 2012, 1:34 p.m.

Patch

diff --git a/debian/control-scripts/postinst.extra b/debian/control-scripts/postinst.extra
deleted file mode 100644
index a370b4c..0000000
--- a/debian/control-scripts/postinst.extra
+++ /dev/null
@@ -1,8 +0,0 @@ 
-#!/bin/sh
-
-case "$1" in
-  configure)
-    depmod -a -F /boot/System.map-@@KVER@@ @@KVER@@
-    update-initramfs -u -k @@KVER@@
-    ;;
-esac
diff --git a/debian/control-scripts/postrm.extra b/debian/control-scripts/postrm.extra
deleted file mode 100644
index 0adcc62..0000000
--- a/debian/control-scripts/postrm.extra
+++ /dev/null
@@ -1,8 +0,0 @@ 
-#!/bin/sh
-
-case "$1" in
-  remove|purge)
-    depmod -a -F /boot/System.map-@@KVER@@ @@KVER@@
-    update-initramfs -u -k @@KVER@@
-    ;;
-esac
diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
index ad8c812..a2555ee 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -127,8 +127,9 @@  endif
 	if [ -f $(DEBIAN)/control.d/$(target_flavour).inclusion-list ] ; then	\
 		install -d $(pkgdir_ex)/DEBIAN;					\
 		for script in postinst postrm ; do				\
-			sed -e 's/@@KVER@@/$(release)-$(abinum)-$(target_flavour)/g' \
-				debian/control-scripts/$$script.extra > $(pkgdir_ex)/DEBIAN/$$script; \
+			sed -e 's/=V/$(abi_release)-$*/g' -e 's/=K/$(install_file)/g'		\
+			    -e 's/=L/$(loader)/g'         -e 's@=B@$(build_arch)@g'		\
+			    debian/control-scripts/$$script > $(pkgdir_ex)/DEBIAN/$$script; \
 			chmod 755 $(pkgdir_ex)/DEBIAN/$$script;			\
 		done;								\
 	fi