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>
import os
import re
import shutil
+import glob
from wic import msger
from wic.pluginbase import 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