[PATCH] UBUNTU: Add postinit and postrm scripts to the extras package

Andy Whitcroft apw at canonical.com
Sun Oct 30 08:43:47 UTC 2011


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 at 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 at canonical.com>

-apw




More information about the kernel-team mailing list