projects
/
grml2usb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Mention /lib/live/mount/medium for new live path + adjust ISO versions
[grml2usb.git]
/
grml2usb
diff --git
a/grml2usb
b/grml2usb
index
16b53cd
..
3ca38a5
100755
(executable)
--- a/
grml2usb
+++ b/
grml2usb
@@
-60,10
+60,10
@@
def grub_option(option, opt, value, opt_parser):
setattr(opt_parser.values, 'syslinux', False)
# cmdline parsing
setattr(opt_parser.values, 'syslinux', False)
# cmdline parsing
-USAGE = "Usage: %prog [options] <[ISO[s] | /li
ve/image
]> </dev/sdX#>\n\
+USAGE = "Usage: %prog [options] <[ISO[s] | /li
b/live/mount/medium
]> </dev/sdX#>\n\
\n\
\n\
-%prog installs
g
rml ISO[s] to an USB device to be able to boot from it.\n\
-Make sure you have at least one
grml ISO or a running grml system (/live/image
),\n\
+%prog installs
G
rml ISO[s] to an USB device to be able to boot from it.\n\
+Make sure you have at least one
Grml ISO or a running Grml system (/lib/live/mount/medium
),\n\
grub or syslinux and root access.\n\
\n\
Run %prog --help for usage hints, further information via: man grml2usb"
grub or syslinux and root access.\n\
\n\
Run %prog --help for usage hints, further information via: man grml2usb"
@@
-312,7
+312,12
@@
def check_uid_root():
def check_boot_flag(device):
def check_boot_flag(device):
- with open(device, 'r') as image:
+ if device[-1:].isdigit():
+ boot_dev = re.match(r'(.*?)\d*$', device).group(1)
+ else:
+ boot_dev = device
+
+ with open(boot_dev, 'r') as image:
data = image.read(512)
bootcode = data[440:]
if bootcode[6] == '\x80':
data = image.read(512)
bootcode = data[440:]
if bootcode[6] == '\x80':
@@
-320,7
+325,7
@@
def check_boot_flag(device):
else:
logging.debug("bootflag is NOT enabled")
raise VerifyException("Device %s does not have the bootflag set. "
else:
logging.debug("bootflag is NOT enabled")
raise VerifyException("Device %s does not have the bootflag set. "
- "Please enable it to be able to boot." %
device
)
+ "Please enable it to be able to boot." %
boot_dev
)
def mkfs_fat16(device):
def mkfs_fat16(device):
@@
-1126,7
+1131,7
@@
def identify_grml_flavour(mountpath):
version_files = search_file('grml-version', mountpath, lst_return=True)
if not version_files:
version_files = search_file('grml-version', mountpath, lst_return=True)
if not version_files:
- if mountpath.startswith("/li
ve/image
"):
+ if mountpath.startswith("/li
b/live/mount/medium
"):
logging.critical("Error: could not find grml-version file.")
logging.critical("Looks like your system is running from RAM but required files are not available.")
logging.critical("Please either boot without toram=... or use boot option toram instead of toram=...")
logging.critical("Error: could not find grml-version file.")
logging.critical("Looks like your system is running from RAM but required files are not available.")
logging.critical("Please either boot without toram=... or use boot option toram instead of toram=...")
@@
-1480,7
+1485,7
@@
def install(image, device):
def install_grml(mountpoint, device):
"""Main logic for copying files of the currently running grml system.
def install_grml(mountpoint, device):
"""Main logic for copying files of the currently running grml system.
- @mountpoin
: directory where currently running live system resides (usually /live/image
)
+ @mountpoin
t: directory where currently running live system resides (usually /lib/live/mount/medium
)
@device: partition where the specified ISO should be installed to"""
device_mountpoint = device
@device: partition where the specified ISO should be installed to"""
device_mountpoint = device