UBUNTU: Add postinit and postrm scripts to the extras package
authorTim Gardner <tim.gardner@canonical.com>
Fri, 28 Oct 2011 17:35:00 +0000 (11:35 -0600)
committerLeann Ogasawara <leann.ogasawara@canonical.com>
Mon, 2 Apr 2012 20:12:47 +0000 (13:12 -0700)
BugLink: http://bugs.launchpad.net/bugs/882120

Lack of postinit and postrm packaging scripts prevents proper
module registration via depmod.

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>

debian/control-scripts/postinst.extra [new file with mode: 0644]
debian/control-scripts/postrm.extra [new file with mode: 0644]
debian/rules.d/2-binary-arch.mk

diff --git a/debian/control-scripts/postinst.extra b/debian/control-scripts/postinst.extra
new file mode 100644 (file)
index 0000000..a370b4c
--- /dev/null
@@ -0,0 +1,8 @@
+#!/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
new file mode 100644 (file)
index 0000000..0adcc62
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+case "$1" in
+  remove|purge)
+    depmod -a -F /boot/System.map-@@KVER@@ @@KVER@@
+    update-initramfs -u -k @@KVER@@
+    ;;
+esac
index dec5adc..1b26a39 100644 (file)
@@ -118,6 +118,15 @@ endif
               $(DROOT)/control-scripts/$$script > $(pkgdir)/DEBIAN/$$script;   \
          chmod 755 $(pkgdir)/DEBIAN/$$script;                                  \
        done
+       # Install the postinit/postrm scripts in the extras package.
+       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; \
+                       chmod 755 $(pkgdir_ex)/DEBIAN/$$script;                 \
+               done;                                                           \
+       fi
 
        # Install the full changelog.
 ifeq ($(do_doc_package),true)