X-Git-Url: https://git.grml.org/?p=grml2usb.git;a=blobdiff_plain;f=grml2usb;h=3e9475e06214d3b05d19037ba1aef7ef6aca4e09;hp=a7e273a0fa9ad263878e6004745379e4cb7c1357;hb=afcc7b22dfdecb49ca05ac4cb8758cd98889ef4f;hpb=0c7f61de1f31ba80833bede85849aa34073660c6 diff --git a/grml2usb b/grml2usb index a7e273a..3e9475e 100755 --- a/grml2usb +++ b/grml2usb @@ -894,13 +894,18 @@ def check_for_usbdevice(device): """ 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): @@ -1104,6 +1109,7 @@ def copy_bootloader_files(iso_mount, target): if not os.path.isfile("/usr/share/grml2usb/grub/splash.xpm.gz"): logging.critical("Error: /usr/share/grml2usb/grub/splash.xpm.gz can not be read.") + logging.critical("Please make sure you've the grml2usb Debian package installed!") raise else: logging.debug("cp /usr/share/grml2usb/grub/splash.xpm.gz %s" % grub_target + 'splash.xpm.gz')