2024-10-29 05:12:06 +03:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
2024-10-23 12:12:30 +03:00
|
|
|
|
2024-10-29 05:12:06 +03:00
|
|
|
version='@abiname@@localversion@'
|
|
|
|
image_path="/boot/@image-stem@-${version}"
|
2024-10-23 12:12:30 +03:00
|
|
|
|
2024-10-29 05:12:06 +03:00
|
|
|
rm -f "/lib/modules/${version}/.fresh-install"
|
2024-10-23 12:12:30 +03:00
|
|
|
|
2024-10-29 05:12:06 +03:00
|
|
|
if [ "$1" != upgrade ] && command -v linux-update-symlinks >/dev/null ; then
|
|
|
|
linux-update-symlinks remove "${version}" "${image_path}"
|
2024-10-23 12:12:30 +03:00
|
|
|
fi
|
|
|
|
|
2024-10-29 05:12:06 +03:00
|
|
|
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
|
2024-10-23 12:12:30 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$1" = purge ]; then
|
2024-10-29 05:12:06 +03:00
|
|
|
for extra_file in \
|
|
|
|
'modules.*.bin' \
|
|
|
|
modules.alias \
|
|
|
|
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
|
2024-10-23 12:12:30 +03:00
|
|
|
done
|
2024-10-29 05:12:06 +03:00
|
|
|
rmdir "/lib/modules/${version}" || true
|
2024-10-23 12:12:30 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
exit 0
|