postrm is in bilibop-udev 0.5.0.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #!/bin/sh
set -e
case "${1}" in
purge|remove)
# Trigger uevents for external, physical block devices owned by
# 'disk' group.
if [ -f /etc/udev/udev.conf ]; then
. /etc/udev/udev.conf
fi
udev_root="${udev_root:-/dev}"
udev_root="${udev_root%/}"
if [ -d /sys/block -a -c ${udev_root}/null ] &&
invoke-rc.d udev status >${udev_root}/null 2>&1; then
opt=
for dev in $(ls /sys/block | grep -Ev '^(loop|dm-)'); do
udevadm info --attribute-walk --name ${dev} |
grep -Eq '^[[:blank:]]*SUBSYSTEMS=="(usb|firewire|memstick|mmc)"' || continue
ls -l ${udev_root}/${dev} |
grep -Eq '^([^[:blank:]]+[[:blank:]]+){3}disk\s' || continue
opt="${opt} --sysname-match=${dev}*"
done
[ -z "${opt}" ] ||
udevadm trigger ${opt}
fi
;;
esac
:
# vim: et ts=4 sts=4 sw=4
|