udev: update hotplug block scripts for QubesDB

Some initial work was done, but apparently not complete and buggy.
This commit is contained in:
Marek Marczykowski-Górecki 2014-12-11 06:06:57 +01:00
parent f7325b3e9e
commit b4f48c1770
2 changed files with 5 additions and 3 deletions

View File

@ -63,8 +63,8 @@ fi
# The last one is meant to trigger watches
qubesdb-write \
"$QDB_KEY/desc" "$DESC" \
"$XS_KEY/size" "$SIZE" \
"$XS_KEY/mode" "$MODE" \
"$QDB_KEY/size" "$SIZE" \
"$QDB_KEY/mode" "$MODE" \
/qubes-block-devices ''
echo QUBES_EXPOSED=1

View File

@ -2,7 +2,9 @@
NAME=${DEVNAME#/dev/}
QDB_KEY="/qubes-block-devices/$NAME"
qubesdb-rm "$XS_KEY"
# Trailing slash is intentional - it will remove whole directory, instead of
# single base entry
qubesdb-rm "$QDB_KEY/"
qubesdb-write /qubes-block-devices ''
# If device was connected to some VM - detach it