wic: Look for image artifacts in a common location

Rather than have each image type look for artifacts in image-specific
locations, move towards having them look for artifacts in a common
location, in this case DEPLOY_DIR_IMAGE

Use the existing deploy.bbclass to have the bootloaders put their binaries
in DEPLOY_DIR_IMAGE and then wic will find them and place them in the image

(From OE-Core rev: 1c8acea91e775b1b6f8b25e774aaba3e790fc59b)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Tom Zanussi
2016-07-12 16:50:03 -05:00
committed by Richard Purdie
parent 62310b3726
commit 66d08e0fda
3 changed files with 45 additions and 16 deletions

View File

@@ -249,6 +249,7 @@ class IsoImagePlugin(SourcePlugin):
part.rootfs_dir = rootfs_dir
# Prepare rootfs.img
hdd_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
img_iso_dir = get_bitbake_var("ISODIR")
rootfs_img = "%s/rootfs.img" % img_iso_dir
if not os.path.isfile(rootfs_img):
@@ -278,10 +279,19 @@ class IsoImagePlugin(SourcePlugin):
if os.path.isfile(part.source_file):
os.remove(part.source_file)
# Prepare initial ramdisk
initrd = "%s/initrd" % img_iso_dir
if not os.path.isfile(initrd):
initrd = cls._build_initramfs_path(rootfs_dir, cr_workdir)
# Support using a different initrd other than default
if source_params.get('initrd'):
initrd = source_params['initrd']
if not hdd_dir:
msger.error("Couldn't find DEPLOY_DIR_IMAGE, exiting\n")
cp_cmd = "cp %s/%s %s" % (hdd_dir, initrd, cr_workdir)
else:
# Prepare initial ramdisk
initrd = "%s/initrd" % hdd_dir
if not os.path.isfile(initrd):
initrd = "%s/initrd" % img_iso_dir
if not os.path.isfile(initrd):
initrd = cls._build_initramfs_path(rootfs_dir, cr_workdir)
install_cmd = "install -m 0644 %s %s/initrd" \
% (initrd, isodir)