* Mention the Debian package in the error message (thanks to
Lothar Speil for the bugreport).
* Mention grml-repository in the docs.
+ * Support older kernel versions in check for removable usb device.
+ (Thanks to Ralf Gross for the report and relevant information.)
- -- Michael Prokop <mika@grml.org> Thu, 12 Mar 2009 23:10:02 +0100
+ -- Michael Prokop <mika@grml.org> Tue, 24 Mar 2009 17:40:08 +0100
grml2usb (0.9.2) unstable; urgency=low
"""
usbdevice = re.match(r'/dev/(.*?)\d*$', device).group(1)
- usbdevice = os.path.realpath('/sys/class/block/' + usbdevice + '/removable')
- if os.path.isfile(usbdevice):
- is_usb = open(usbdevice).readline()
- if is_usb == "1":
+ # newer systems:
+ usbdev = os.path.realpath('/sys/class/block/' + usbdevice + '/removable')
+ if not os.path.isfile(usbdev):
+ # Ubuntu with kernel 2.6.24 for example:
+ usbdev = os.path.realpath('/sys/block/' + usbdevice + '/removable')
+
+ if os.path.isfile(usbdev):
+ is_usb = open(usbdev).readline()
+ if is_usb.find("1"):
return 0
- else:
- return 1
+
+ return 1
def check_for_fat(partition):