X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=grml2usb;h=7b17c72547050a2f1f2ab1acc84fd4c3dc8905a6;hb=270b5d9cc9578d49b9a318453c7ae39501b2ffc8;hp=b3e25dfad146095d119e25fa3ecc12ef1040688a;hpb=35feaad92af2e631460f44204f2a9b88c40d7468;p=grml2usb.git diff --git a/grml2usb b/grml2usb index b3e25df..7b17c72 100755 --- a/grml2usb +++ b/grml2usb @@ -768,19 +768,24 @@ def copy_system_files(grml_flavour, iso_mount, target): else: exec_rsync(filesystem_module, squashfs_target + 'filesystem.module') - kernel = search_file('vmlinuz', iso_mount) - if kernel is None: - # compat for releases < 2011.12 - kernel = search_file('linux26', iso_mount) + cleaned_flavour = re.sub(r'[,._-]', '', grml_flavour) - if kernel is None: - logging.critical("Fatal: kernel not found") - raise CriticalException("error locating kernel file") + if os.path.isdir(iso_mount + '/boot/' + cleaned_flavour): + exec_rsync(iso_mount + '/boot/' + cleaned_flavour, target + '/boot') + else: + kernel = search_file('vmlinuz', iso_mount) + if kernel is None: + # compat for releases < 2011.12 + kernel = search_file('linux26', iso_mount) + + if kernel is None: + logging.critical("Fatal: kernel not found") + raise CriticalException("error locating kernel file") - source = os.path.dirname(kernel) + '/' - dest = target + '/' + os.path.dirname(kernel).replace(iso_mount,'') + '/' - execute(mkdir, dest) - exec_rsync(source, dest) + source = os.path.dirname(kernel) + '/' + dest = target + '/' + os.path.dirname(kernel).replace(iso_mount,'') + '/' + execute(mkdir, dest) + exec_rsync(source, dest) def update_grml_versions(iso_mount, target): @@ -1116,7 +1121,7 @@ def handle_grub_config(grml_flavour, device, target): for regex in options.removeoption: remove_regexes.append(re.compile(regex)) - for filename in glob.glob(grub_target + '*.cfg'): + for filename in glob.glob(grub_target + grml_flavour + '*.cfg'): for line in fileinput.input(filename, inplace=1): line = line.rstrip("\r\n") if option_re.search(line): @@ -1531,7 +1536,8 @@ def handle_compat_warning(device): @device: device that should be checked""" # make sure we can replace old grml2usb script and warn user when using old way of life: - if device.startswith("/mnt/external") or device.startswith("/mnt/usb") and not options.force: + if device.startswith("/media/external") or device.startswith("/media/usb") or \ + device.startswith("/mnt/external") or device.startswith("/mnt/usb") and not options.force: print "Warning: the semantics of grml2usb has changed." print "Instead of using grml2usb /path/to/iso %s you might" % device print "want to use grml2usb /path/to/iso /dev/... instead." @@ -1635,7 +1641,7 @@ def main(): 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):