From: Ioan-Adrian Ratiu Date: Fri, 1 Apr 2016 14:31:19 +0000 (+0300) Subject: wic/isoimage-isohybrid.py: use glob to find initramfs location X-Git-Tag: 2016-4~173 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=ca516f5907a661606c35e1ca5c2ece9fc79c77ea;p=openembedded-core.git wic/isoimage-isohybrid.py: use glob to find initramfs location 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 Signed-off-by: Richard Purdie --- diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py index 31dc9b6ce6..de99ad8495 100644 --- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py +++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py @@ -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