Add support for new kernel/initrd filenames
authorChristian Hofstaedtler <ch@grml.org>
Mon, 19 Dec 2011 16:56:55 +0000 (17:56 +0100)
committerChristian Hofstaedtler <ch@grml.org>
Mon, 19 Dec 2011 16:56:55 +0000 (17:56 +0100)
grml2usb

index ea6ae82..70fbfe1 100755 (executable)
--- a/grml2usb
+++ b/grml2usb
@@ -952,19 +952,19 @@ def copy_system_files(grml_flavour, iso_mount, target):
     if os.path.isdir(iso_mount + '/boot/release'):
         prefix = release_path + '/'
 
     if os.path.isdir(iso_mount + '/boot/release'):
         prefix = release_path + '/'
 
-    kernel = search_file(prefix + 'linux26', iso_mount)
+    kernel = search_file(prefix + 'vmlinuz', iso_mount)
+    initrd = search_file(prefix + 'initrd.img', iso_mount)
     if kernel is None:
     if kernel is None:
-        logging.critical("Fatal kernel not found")
-        raise CriticalException("error locating kernel file")
-    else:
-        exec_rsync(kernel, release_target + '/linux26')
+        # compat for releases < 2011.12
+        kernel = search_file(prefix + 'linux26', iso_mount)
+        initrd = search_file(prefix + 'initrd.gz', iso_mount)
 
 
-    initrd = search_file(prefix + 'initrd.gz', iso_mount)
-    if initrd is None:
-        logging.critical("Fatal: initrd not found")
-        raise CriticalException("error locating initrd file")
-    else:
-        exec_rsync(initrd, release_target + '/initrd.gz')
+    if kernel is None or initrd is None:
+        logging.critical("Fatal: kernel or initrd not found")
+        raise CriticalException("error locating kernel or initrd file")
+
+    exec_rsync(kernel, release_target + '/')
+    exec_rsync(initrd, release_target + '/')
 
 
 def update_grml_versions(iso_mount, target):
 
 
 def update_grml_versions(iso_mount, target):