68 lines
1.7 KiB
Bash
Executable File
68 lines
1.7 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
tmpf=`mktemp`
|
|
domu='qdvp'
|
|
|
|
## === List
|
|
echo 'qvm-usb -l'
|
|
qvm-usb -l | sort > $tmpf
|
|
|
|
cat <<'END' | diff -bu - $tmpf
|
|
dom0:2-1 046a:0021 046a_0021
|
|
dom0:2-2 045e:0745 Microsoft_Microsoft®_Nano_Transceiver_v1.0
|
|
dom0:7-1 07d1:3c0a Ralink_11n_Adapter_1.0
|
|
dom0:7-5 0781:5530 SanDisk_Cruzer_1942531DB09038A6
|
|
END
|
|
|
|
## === Attach
|
|
echo 'qvm-usb -a'
|
|
qvm-usb -a $domu dom0:7-5 | diff -bu /dev/null -
|
|
#echo 'pvusb-script/usb-attach.py'
|
|
#sudo /home/abb/pvusb-scripts/usb-attach.py 7-5 3 1
|
|
|
|
## === List again
|
|
echo 'qvm-usb -l'
|
|
qvm-usb -l | sort > $tmpf
|
|
|
|
# FIXME
|
|
cat <<'END' | diff -bu - $tmpf
|
|
dom0:2-1 046a:0021 046a_0021
|
|
dom0:2-2 045e:0745 Microsoft_Microsoft®_Nano_Transceiver_v1.0
|
|
dom0:7-1 07d1:3c0a Ralink_11n_Adapter_1.0
|
|
dom0:7-5 0781:5530 SanDisk_Cruzer_1942531DB09038A6
|
|
END
|
|
|
|
read -p 'Press ENTER to continue'
|
|
|
|
## === Use: try ls
|
|
echo 'qvm-run $domu ls /dev/sda'
|
|
qvm-run -p $domu 'ls /dev/sda' > $tmpf
|
|
cat <<'END' | diff -bu - $tmpf
|
|
/dev/sda
|
|
END
|
|
|
|
## === Use: try fdisk
|
|
echo 'qvm-run $domu fdisk'
|
|
qvm-run -p $domu 'su - root -c "fdisk -l /dev/sda"' > $tmpf
|
|
|
|
cat <<'END' | diff -bu - $tmpf
|
|
|
|
Disk /dev/sda: 4022 MB, 4022337024 bytes
|
|
124 heads, 62 sectors/track, 1021 cylinders, total 7856127 sectors
|
|
Units = sectors of 1 * 512 = 512 bytes
|
|
Sector size (logical/physical): 512 bytes / 512 bytes
|
|
I/O size (minimum/optimal): 512 bytes / 512 bytes
|
|
Disk identifier: 0x3963a77b
|
|
|
|
Device Boot Start End Blocks Id System
|
|
/dev/sda1 * 62 7849447 3924693 c W95 FAT32 (LBA)
|
|
END
|
|
|
|
## === Detach
|
|
#echo 'qvm-usb -d'
|
|
#qvm-usb -d $domu:7-5 | diff -bu /dev/null -
|
|
echo 'pvusb-script/usb-detach.py'
|
|
sudo /home/abb/pvusb-scripts/usb-detach.py 7-5 4 1
|
|
|
|
rm $tmpf
|