diff -ur linux-3.13.0.org/debian/control-scripts/extra-post linux-3.13.0/debian/control-scripts/extra-post --- linux-3.13.0.org/debian/control-scripts/extra-post 2015-11-09 09:10:16.000000000 +1300 +++ linux-3.13.0/debian/control-scripts/extra-post 2015-11-09 09:16:54.475056854 +1300 @@ -2,13 +2,17 @@ set -e case "$0::$1" in -*.postinst::configure|*.postrm::remove) - 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 - ;; + *.postinst::configure) partsdirs="/etc/kernel/postinst.d /etc/kernel/postinst.d/=V";; + *.postrm::remove) partsdirs="/etc/kernel/postrm.d /etc/kernel/postrm.d/=V";; + *) exit 0;; esac + +depmod -a -F /boot/System.map-=V =V || true + +for dir in ${partsdirs} +do + if [ -d "$dir" ]; then + run-parts --verbose --exit-on-error --arg="=V" --arg="/boot/=K-=V" "$dir" + fi +done +