Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtualized USB failing pyudev check #110

Closed
brycepg opened this issue Mar 28, 2017 · 7 comments
Closed

Virtualized USB failing pyudev check #110

brycepg opened this issue Mar 28, 2017 · 7 comments

Comments

@brycepg
Copy link

brycepg commented Mar 28, 2017

Hello,

I'm using Qubes, a Xen distribution which runs Linux paravirtual VMs. I've passed through a my usb device with multibootusb installed however multibootusb would not even detect it unless I changed some code.

The device is this initalized as a '/dev/xvdi', which means it's a "xen virtual disk" letter i. Unfortunately, this device never gets found because it fails the check at scripts/usb.py:109. Specifically the device.get('ID_BUS') returns None instead of "usb" or "scsi". I got the device to work by changing the line to:

if device.get('DEVTYPE') == "partition" and 'xvdi' in device.sys_path:

Obiously this is a hack. But multibootusb now detects the drive, and I can boot the drive in QEMU. If I do not add the 'xvdi' in device.sys_path, then multibootusb chokes later down the line when getting device details.

Here's some other info for this device:

device.driver also returns None
device.sys_path returns "/sys/devices/cvd-51840/block/xvdi/xvdi1"
device.device_type returns "Parition"
device.subsystem returns "block"
stat.S_ISBLK(os.stat("/dev/xvdi1").st_mode) returns True

System:

sudo lspci -vvv returns nothing.

I'm not sure how to fix this. If you have any suggestions I'd be willing to try.

@alindt
Copy link
Contributor

alindt commented Apr 18, 2017

@brycepg, can you checkout the devel brach and test with both "All drives" checked and unchecked?

@brycepg
Copy link
Author

brycepg commented Apr 19, 2017

@alindt

Unfortunately Multibootusb still says that no drives were found both with the All drives checkbox unchecked / checked. device.get("ID_BUS") returns None for my USB, and that's why the check is failing for the 'All drives' option at scripts/usb.py:104

@alindt
Copy link
Contributor

alindt commented Apr 19, 2017

@brycepg, please post the output of the following:

$ udevadm info -q all --root /dev/xvdi;  udevadm info -q all --root /dev/xvdi1

@brycepg
Copy link
Author

brycepg commented Apr 19, 2017

=== pyudev version: 0.21.0 ===

=== /dev/xvdi ===

('DEVNAME', '/dev/xvdi')
('DEVPATH', '/devices/vbd-51840/block/xvdi')
('DEVTYPE', 'disk')
('ID_PART_TABLE_TYPE', 'dos')
('ID_PART_TABLE_UUID', '00091a83')
('MAJOR', '202')
('MINOR', '128')
('SUBSYSTEM', 'block')
('TAGS', ':systemd:')
('USEC_INITIALIZED', '31349554277')

=== /dev/xvdi1 ===

('DEVLINKS', '/dev/disk/by-uuid/50C7-CF89')
('DEVNAME', '/dev/xvdi1')
('DEVPATH', '/devices/vbd-51840/block/xvdi/xvdi1')
('DEVTYPE', 'partition')
('ID_FS_TYPE', 'vfat')
('ID_FS_USAGE', 'filesystem')
('ID_FS_UUID', '50C7-CF89')
('ID_FS_UUID_ENC', '50C7-CF89')
('ID_FS_VERSION', 'FAT32')
('ID_PART_ENTRY_DISK', '202:128')
('ID_PART_ENTRY_FLAGS', '0x80')
('ID_PART_ENTRY_NUMBER', '1')
('ID_PART_ENTRY_OFFSET', '2048')
('ID_PART_ENTRY_SCHEME', 'dos')
('ID_PART_ENTRY_SIZE', '122550272')
('ID_PART_ENTRY_TYPE', '0xb')
('ID_PART_ENTRY_UUID', '00091a83-01')
('ID_PART_TABLE_TYPE', 'dos')
('ID_PART_TABLE_UUID', '00091a83')
('MAJOR', '202')
('MINOR', '129')
('SUBSYSTEM', 'block')
('TAGS', ':systemd:')
('USEC_INITIALIZED', '31349607585')

alindt added a commit to alindt/multibootusb that referenced this issue Apr 19, 2017
Don't rely on ID_BUS udev item when checking "All devices".
Should fix mbusb#110
@alindt
Copy link
Contributor

alindt commented Apr 19, 2017

@brycepg, please check the devel branch after this pull request gets merged

@brycepg
Copy link
Author

brycepg commented Apr 20, 2017

Thanks @alindt, the fix works great.

@alindt
Copy link
Contributor

alindt commented Apr 20, 2017

fixed in a150156

alindt referenced this issue Apr 20, 2017
linux: rethink device detection logic
@mbusb mbusb closed this as completed in 42f97f3 Apr 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants