2013-03-20 05:27:32 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
NAME=${DEVNAME#/dev/}
|
2013-06-07 03:21:41 +00:00
|
|
|
QDB_KEY="/qubes-block-devices/$NAME"
|
2017-09-12 02:25:34 +00:00
|
|
|
# Trailing slash is intentional - it will remove the whole directory, instead of
|
|
|
|
# a single base entry
|
2014-12-11 05:06:57 +00:00
|
|
|
qubesdb-rm "$QDB_KEY/"
|
2013-06-07 03:21:41 +00:00
|
|
|
qubesdb-write /qubes-block-devices ''
|
2013-03-20 05:27:32 +00:00
|
|
|
|
2017-09-12 02:25:34 +00:00
|
|
|
if [ -r /var/run/qubes/block-slave-cache-$NAME ]; then
|
|
|
|
# update info about underlying devices of device-mapper (if any);
|
|
|
|
for dev in $(cat /var/run/qubes/block-slave-cache-$NAME); do
|
|
|
|
udevadm trigger /sys/class/block/$dev
|
2013-03-20 05:27:32 +00:00
|
|
|
done
|
2017-09-12 02:25:34 +00:00
|
|
|
rm -f /var/run/qubes/block-slave-cache-$NAME
|
|
|
|
fi
|