Commit 9296830a authored by Andy Whitcroft's avatar Andy Whitcroft Committed by Tim Gardner

UBUNTU: [Debian] linux-image-extra is additive to linux-image

linux-image-extra is special, it is only additive to linux-image, this
means really cannot use the standard kernel postinst/postrm for this
package.  As it also depends on linux-image we know that linux-image will
have been installed before it, and will be removed after it.  On change
(installation/update/removal) of linux-image-extra we want to run the
kernel postinst to rebuilt the initramfs and update the bootloader
as necessary.  To this end switch to package specific postinst/postrm
which trigger the /etc/kernel/postinst.d hooks.  We need to do it this
way to get the specially parameterised incantations of update-initramfs,
to ensure we trigger the correct build rather than mearly dpkg triggering
a rebuild of the running kernel.

BugLink: http://bugs.launchpad.net/bugs/1375310Signed-off-by: default avatarAndy Whitcroft <apw@canonical.com>
parent a967c615
#!/bin/sh
set -e
case "$0::$1" in
*.postinst::configure|*.postrm::remove|*.postrm::purge)
depmod -a -F /boot/System.map-=V =V || true
for dir in "/etc/kernel/postinst.d" "/etc/kernel/postinst.d/=V"
do
if [ -d "$dir" ]; then
run-parts --verbose --exit-on-error --arg="=V" --arg="/boot/=K-=V" "$dir"
fi
done
;;
esac
...@@ -174,7 +174,7 @@ ifeq ($(do_extras_package),true) ...@@ -174,7 +174,7 @@ ifeq ($(do_extras_package),true)
for script in postinst postrm ; do \ for script in postinst postrm ; do \
sed -e 's/=V/$(abi_release)-$*/g' -e 's/=K/$(instfile)/g' \ sed -e 's/=V/$(abi_release)-$*/g' -e 's/=K/$(instfile)/g' \
-e 's/=L/$(loader)/g' -e 's@=B@$(build_arch)@g' \ -e 's/=L/$(loader)/g' -e 's@=B@$(build_arch)@g' \
debian/control-scripts/$$script > $(pkgdir_ex)/DEBIAN/$$script; \ debian/control-scripts/extra-post > $(pkgdir_ex)/DEBIAN/$$script; \
chmod 755 $(pkgdir_ex)/DEBIAN/$$script; \ chmod 755 $(pkgdir_ex)/DEBIAN/$$script; \
done; \ done; \
fi fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment