aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageia.org>2020-01-31 09:19:09 +0100
committerPapoteur <papoteur@mageia.org>2020-01-31 09:21:26 +0100
commit5fe71c7c2c4ff561f0a05c9178fe1a2e7707f0a8 (patch)
tree711f2a22b251e8a7bd475109666b4e6266ec7b41 /lib
parentb8d08a76ce939aba0c576543f0e41da2486e54d9 (diff)
downloadisodumper-5fe71c7c2c4ff561f0a05c9178fe1a2e7707f0a8.tar
isodumper-5fe71c7c2c4ff561f0a05c9178fe1a2e7707f0a8.tar.gz
isodumper-5fe71c7c2c4ff561f0a05c9178fe1a2e7707f0a8.tar.bz2
isodumper-5fe71c7c2c4ff561f0a05c9178fe1a2e7707f0a8.tar.xz
isodumper-5fe71c7c2c4ff561f0a05c9178fe1a2e7707f0a8.zip
Fix detection of SD cards
The device name is for example mmcblk2. Previously, it was considered that name ending with a number was a partition. Now, we don't consider a device only if it has 'org.freedesktop.UDisks2.Partition' interface.
Diffstat (limited to 'lib')
-rwxr-xr-xlib/isodumper.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/isodumper.py b/lib/isodumper.py
index 5b1801f..4db8e4e 100755
--- a/lib/isodumper.py
+++ b/lib/isodumper.py
@@ -81,12 +81,12 @@ class UDisks2(object):
list=[]
for block in blocks:
- if not block['path'][-1].isdigit():
+ if not (self.SERVICE + '.Partition' in objects[block['path']]): # we skip partition blocks
for dev in devs:
- if dev['path'] == objects[block['path']][self.BLOCK]['Drive']:
+ if dev['path'] == objects[block['path']][self.BLOCK]['Drive']: # we look for device which is referenced in Drive attribute of the current block
dev_obj =objects[dev['path']][self.DRIVE]
if (dev_obj['ConnectionBus'] == 'usb' or dev_obj['ConnectionBus'] == 'sdio') and \
- (dev_obj['Removable'] == 1 or dev_obj['MediaRemovable'] == 1 ):
+ (dev_obj['Removable'] == 1 or dev_obj['MediaRemovable'] == 1 ): # we keep only blocks where device ConnectionBus is sdio or usb
item=[]
vend = dev_obj['Vendor']
if vend == "":