Patchwork UBUNTU: Add postinit and postrm scripts to the extras package

login
register
mail settings
Submitter Tim Gardner
Date Oct. 28, 2011, 6:53 p.m.
Message ID <1319827988-19956-2-git-send-email-tim.gardner@canonical.com>
Download mbox | patch
Permalink /patch/122481/
State New
Headers show

Comments

Tim Gardner - Oct. 28, 2011, 6:53 p.m.
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 |    8 ++++++++
 debian/control-scripts/postrm.extra   |    8 ++++++++
 debian/rules.d/2-binary-arch.mk       |    9 +++++++++
 3 files changed, 25 insertions(+), 0 deletions(-)
 create mode 100644 debian/control-scripts/postinst.extra
 create mode 100644 debian/control-scripts/postrm.extra
Leann Ogasawara - Oct. 28, 2011, 7:22 p.m.
On Fri, 2011-10-28 at 12:53 -0600, Tim Gardner wrote:
> 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>

Acked-by: Leann Ogasawara <leann.ogasawara@canonical.com>

> ---
>  debian/control-scripts/postinst.extra |    8 ++++++++
>  debian/control-scripts/postrm.extra   |    8 ++++++++
>  debian/rules.d/2-binary-arch.mk       |    9 +++++++++
>  3 files changed, 25 insertions(+), 0 deletions(-)
>  create mode 100644 debian/control-scripts/postinst.extra
>  create mode 100644 debian/control-scripts/postrm.extra
> 
> diff --git a/debian/control-scripts/postinst.extra b/debian/control-scripts/postinst.extra
> new file mode 100644
> index 0000000..a370b4c
> --- /dev/null
> +++ b/debian/control-scripts/postinst.extra
> @@ -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
> index 0000000..0adcc62
> --- /dev/null
> +++ b/debian/control-scripts/postrm.extra
> @@ -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
> diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
> index dec5adc..1b26a39 100644
> --- a/debian/rules.d/2-binary-arch.mk
> +++ b/debian/rules.d/2-binary-arch.mk
> @@ -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)
> -- 
> 1.7.0.4
> 
>
Andy Whitcroft - Oct. 30, 2011, 8:43 a.m.
On Fri, Oct 28, 2011 at 12:53:08PM -0600, Tim Gardner wrote:
> 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 |    8 ++++++++
>  debian/control-scripts/postrm.extra   |    8 ++++++++
>  debian/rules.d/2-binary-arch.mk       |    9 +++++++++
>  3 files changed, 25 insertions(+), 0 deletions(-)
>  create mode 100644 debian/control-scripts/postinst.extra
>  create mode 100644 debian/control-scripts/postrm.extra
> 
> diff --git a/debian/control-scripts/postinst.extra b/debian/control-scripts/postinst.extra
> new file mode 100644
> index 0000000..a370b4c
> --- /dev/null
> +++ b/debian/control-scripts/postinst.extra
> @@ -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
> index 0000000..0adcc62
> --- /dev/null
> +++ b/debian/control-scripts/postrm.extra
> @@ -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
> diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
> index dec5adc..1b26a39 100644
> --- a/debian/rules.d/2-binary-arch.mk
> +++ b/debian/rules.d/2-binary-arch.mk
> @@ -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)

Doh, yep that looks about right to me.

Acked-by: Andy Whitcroft <apw@canonical.com>

-apw

Patch

diff --git a/debian/control-scripts/postinst.extra b/debian/control-scripts/postinst.extra
new file mode 100644
index 0000000..a370b4c
--- /dev/null
+++ b/debian/control-scripts/postinst.extra
@@ -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
index 0000000..0adcc62
--- /dev/null
+++ b/debian/control-scripts/postrm.extra
@@ -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
diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
index dec5adc..1b26a39 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -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)