diff --git a/debian/changelog b/debian/changelog index 86d8a7046..cf5c624bc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,8 @@ linux-2.6 (2.6.32-11) UNRELEASED; urgency=low cause the system to hang (Closes: #559578) * eeepc-laptop: Disable wireless hotplug on 1005HA, 1201N and 1005PE since it disconnects the wrong device (Closes: #573607) + * linux-headers-*: Support postinst hooks in /etc/kernel/header_postinst.d, + thanks to Michael Gilbert (Closes: #569724) [ maximilian attems] * [alpha, hppa] Disable oprofile as tracing code is unsupported here. diff --git a/debian/rules.real b/debian/rules.real index 2111baabc..fba569d9e 100644 --- a/debian/rules.real +++ b/debian/rules.real @@ -264,6 +264,12 @@ endif ln -s /usr/src/$(PACKAGE_NAME) $(PACKAGE_DIR)/lib/modules/$(REAL_VERSION)/build ln -s /usr/src/$(PACKAGE_NAME_COMMON) $(PACKAGE_DIR)/lib/modules/$(REAL_VERSION)/source + install -d $(PACKAGE_DIR)/DEBIAN + sed -e 's/=V/$(REAL_VERSION)/g' \ + debian/templates/temp.headers.plain/postinst \ + > $(PACKAGE_DIR)/DEBIAN/postinst + chmod 755 $(PACKAGE_DIR)/DEBIAN/postinst + +$(MAKE_SELF) install-base install-libc-dev_$(ARCH): PACKAGE_NAME = linux-libc-dev diff --git a/debian/templates/temp.headers.plain/postinst b/debian/templates/temp.headers.plain/postinst new file mode 100644 index 000000000..8c214bcd1 --- /dev/null +++ b/debian/templates/temp.headers.plain/postinst @@ -0,0 +1,26 @@ +#!/usr/bin/perl +# Author: Michael Gilbert +# Origin: Stripped down version of the linux-headers postinst from Ubuntu's +# 2.6.32-14-generic kernel, which was itself derived from a +# Debian linux-image postinst script. + +$|=1; +my $version = "=V"; + +if (-d "/etc/kernel/header_postinst.d") { + print STDERR "Examining /etc/kernel/header_postinst.d.\n"; + system ("run-parts --verbose --exit-on-error --arg=$version " . + "/etc/kernel/header_postinst.d") && + die "Failed to process /etc/kernel/header_postinst.d"; +} + +if (-d "/etc/kernel/header_postinst.d/$version") { + print STDERR "Examining /etc/kernel/header_postinst.d/$version.\n"; + system ("run-parts --verbose --exit-on-error --arg=$version " . + "/etc/kernel/header_postinst.d/$version") && + die "Failed to process /etc/kernel/header_postinst.d/$version"; +} + +exit 0; + +__END__