Make sure we don't fail in device check when using /dev/disk-by-label/*
authorMichael Prokop <mika@grml.org>
Thu, 5 Jan 2012 13:52:55 +0000 (14:52 +0100)
committerMichael Prokop <mika@grml.org>
Thu, 5 Jan 2012 13:52:55 +0000 (14:52 +0100)
Quoting Bernhard on IRC:

| i usually use ~by-label/<mysticksname> as device names, so that
| I don't mix up any /dev/sd?? devices and I just realized that
| when i do this (of course I can use ~bylabel/<mysticksname>(:A)
| in the future) grml2usb does neither recognize that my device is
| already mounted (not much of a problem with current kernel
| apparently), but the "superdisk" check which just looks for a
| digit in the last char of the device string, fails as well

Thanks: Bernhard Tittelbach for bugreport and patch

grml2usb

index b3e25df..13baf0e 100755 (executable)
--- a/grml2usb
+++ b/grml2usb
@@ -1635,7 +1635,7 @@ def main():
     check_programs()
 
     # specified arguments
     check_programs()
 
     # specified arguments
-    device = args[len(args) - 1]
+    device = os.path.realpath(args[len(args) - 1])
     isos = args[0:len(args) - 1]
 
     if not os.path.isdir(device):
     isos = args[0:len(args) - 1]
 
     if not os.path.isdir(device):