dom0+vm/usb: make original device name available

This commit is contained in:
Alexandre Bezroutchko 2012-10-24 22:02:55 +02:00
parent 65e068f68a
commit 47e9f5536d

View File

@ -13,13 +13,15 @@
[ "$DEVTYPE" != "usb_device" ] && exit 0
# xenstore doesn't allow dot in key name
NAME=`basename ${DEVPATH} | tr . _`
NAME=`basename ${DEVPATH}`
XSNAME=`echo ${NAME} | tr . _`
# FIXME: For some devices (my Cherry keyboard) ID_SERIAL does not
# contain proper human-readable name, should find better method to
# build devide description.
#DESC=`python -c "dev='%d-%d' % (int('${BUSNUM}'.lstrip('0')), (int('${DEVNUM}'.lstrip('0'))-1)); from xen.util import vusb_util; print vusb_util.get_usbdevice_info(dev);"`
DESC="${ID_VENDOR_ID}:${ID_MODEL_ID} ${ID_SERIAL}"
XS_KEY="qubes-usb-devices/$NAME"
XS_KEY="qubes-usb-devices/${XSNAME}"
xenstore-write "$XS_KEY/desc" "$DESC"