diff options
Diffstat (limited to 'scripts/lib/wic/plugins/source/isoimage-isohybrid.py')
-rw-r--r-- | scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py index a637ce5025..b54a2290d8 100644 --- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py +++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py | |||
@@ -249,6 +249,7 @@ class IsoImagePlugin(SourcePlugin): | |||
249 | part.rootfs_dir = rootfs_dir | 249 | part.rootfs_dir = rootfs_dir |
250 | 250 | ||
251 | # Prepare rootfs.img | 251 | # Prepare rootfs.img |
252 | hdd_dir = get_bitbake_var("DEPLOY_DIR_IMAGE") | ||
252 | img_iso_dir = get_bitbake_var("ISODIR") | 253 | img_iso_dir = get_bitbake_var("ISODIR") |
253 | rootfs_img = "%s/rootfs.img" % img_iso_dir | 254 | rootfs_img = "%s/rootfs.img" % img_iso_dir |
254 | if not os.path.isfile(rootfs_img): | 255 | if not os.path.isfile(rootfs_img): |
@@ -278,10 +279,19 @@ class IsoImagePlugin(SourcePlugin): | |||
278 | if os.path.isfile(part.source_file): | 279 | if os.path.isfile(part.source_file): |
279 | os.remove(part.source_file) | 280 | os.remove(part.source_file) |
280 | 281 | ||
281 | # Prepare initial ramdisk | 282 | # Support using a different initrd other than default |
282 | initrd = "%s/initrd" % img_iso_dir | 283 | if source_params.get('initrd'): |
283 | if not os.path.isfile(initrd): | 284 | initrd = source_params['initrd'] |
284 | initrd = cls._build_initramfs_path(rootfs_dir, cr_workdir) | 285 | if not hdd_dir: |
286 | msger.error("Couldn't find DEPLOY_DIR_IMAGE, exiting\n") | ||
287 | cp_cmd = "cp %s/%s %s" % (hdd_dir, initrd, cr_workdir) | ||
288 | else: | ||
289 | # Prepare initial ramdisk | ||
290 | initrd = "%s/initrd" % hdd_dir | ||
291 | if not os.path.isfile(initrd): | ||
292 | initrd = "%s/initrd" % img_iso_dir | ||
293 | if not os.path.isfile(initrd): | ||
294 | initrd = cls._build_initramfs_path(rootfs_dir, cr_workdir) | ||
285 | 295 | ||
286 | install_cmd = "install -m 0644 %s %s/initrd" \ | 296 | install_cmd = "install -m 0644 %s %s/initrd" \ |
287 | % (initrd, isodir) | 297 | % (initrd, isodir) |