]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic/isoimage-isohybrid.py: use glob to find initramfs location
authorIoan-Adrian Ratiu <adrian.ratiu@ni.com>
Fri, 1 Apr 2016 14:31:19 +0000 (17:31 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 3 Apr 2016 14:51:08 +0000 (15:51 +0100)
Some filenames can omit 'initramfs', or use other names. This makes
detection more flexible by using only the image name, machine arch and
image type in a glob wildcard.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/wic/plugins/source/isoimage-isohybrid.py

index 31dc9b6ce68267e06616825bed62d928cedbec59..de99ad849559dd4ef74884b8e3d23c96385a4d42 100644 (file)
@@ -23,6 +23,7 @@
 import os
 import re
 import shutil
+import glob
 
 from wic import msger
 from wic.pluginbase import SourcePlugin
@@ -150,8 +151,7 @@ class IsoImagePlugin(SourcePlugin):
             if not machine_arch:
                 msger.error("Couldn't find MACHINE_ARCH, exiting.\n")
 
-            initrd = "%s/%s-initramfs-%s.%s" \
-                    % (initrd_dir, image_name, machine_arch, image_type)
+            initrd = glob.glob('%s/%s*%s.%s' % (initrd_dir, image_name, machine_arch, image_type))[0]
 
         if not os.path.exists(initrd):
             # Create initrd from rootfs directory