#!/bin/sh set -e version='@abiname@@localversion@' image_path="/boot/@image-stem@-${version}" rm -f "/lib/modules/${version}/.fresh-install" if [ "$1" != upgrade ] && command -v linux-update-symlinks >/dev/null ; then linux-update-symlinks remove "${version}" "${image_path}" fi if [ -d /etc/kernel/postrm.d ] ; then DEB_MAINT_PARAMS="$*" \ run-parts --report --exit-on-error \ "--arg=${version}" \ "--arg=${image_path}" \ /etc/kernel/postrm.d fi if [ "$1" = purge ]; then for extra_file in \ 'modules.*.bin' \ modules.alias \ modules.builtin.ranges \ modules.ccwmap \ modules.dep \ modules.devname \ modules.generic_string \ modules.ieee1394map \ modules.inputmap \ modules.isapnpmap \ modules.ofmap \ modules.parportmap \ modules.pcimap \ modules.pnpbiosmap \ modules.seriomap \ modules.softdep \ modules.symbols \ modules.usbmap \ modules.weakdep \ ; do case "${extra_file}" in *\** | *\?* ) find "/lib/modules/${version}/" -mindepth 1 -maxdepth 1 -name "${extra_file}" -exec rm -f {} + ;; * ) rm -f "/lib/modules/${version}/${extra_file}" ;; esac done rmdir "/lib/modules/${version}" || true fi exit 0