From a97871b397adfdf201705621266d4dc242ab9cfd Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 7 May 2009 10:48:47 -0700 Subject: [PATCH] IGN:Allow remapping of LUNS in usbmb driver to support devices that don't use lun0 for the main memory --- src/calibre/devices/usbms/device.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/calibre/devices/usbms/device.py b/src/calibre/devices/usbms/device.py index f84af1853b..9f6b3cbd34 100644 --- a/src/calibre/devices/usbms/device.py +++ b/src/calibre/devices/usbms/device.py @@ -40,7 +40,7 @@ class Device(_Device): %(BCD_start)s - + %(main_memory)s %(deviceclass)s @@ -54,7 +54,7 @@ class Device(_Device): %(BCD_start)s - + %(storage_card)s %(deviceclass)s @@ -65,6 +65,7 @@ class Device(_Device): ''' FDI_BCD_TEMPLATE = '' + FDI_LUNS = {'lun0':0, 'lun1':1, 'lun2':2} def __init__(self, key='-1', log_packets=False, report_progress=None) : @@ -85,6 +86,8 @@ class Device(_Device): storage_card=cls.STORAGE_CARD_VOLUME_LABEL, ) + fdi_base_values.update(cls.FDI_LUNS) + if cls.BCD is None: fdi_base_values['BCD_start'] = '' fdi_base_values['BCD_end'] = '' @@ -303,7 +306,7 @@ class Device(_Device): try: self.open_linux() except DeviceError: - time.sleep(3) + time.sleep(7) self.open_linux() if iswindows: try: