diff options
| author | Maciej Borzecki <maciej.borzecki@open-rnd.pl> | 2014-09-22 13:35:16 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-09-23 20:35:56 +0100 |
| commit | 7ce1dc13f91df70e8a2f420e7c3eba51cbc4bd48 (patch) | |
| tree | b9eeab64eeb01e3fd7985b19876a4009db713d0b | |
| parent | 48ff3fa3a50add60ff69a0067d189adcfa356bd6 (diff) | |
| download | poky-7ce1dc13f91df70e8a2f420e7c3eba51cbc4bd48.tar.gz | |
wic: set bootimg_dir when using image-name artifacts
Running wic with -e to use artifacts from a named image, bootimg_dir was
always passed as empty string to partition source plugins. The patch
sets bootimg_dir to current value of DEPLOY_DIR_IMAGE, as bootloader
artifacts end up in that location as well.
(From OE-Core rev: d7f69e6f0932a927b6ce289fb47ba575d7aaa1c8)
Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl>
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | scripts/lib/image/engine.py | 9 | ||||
| -rwxr-xr-x | scripts/wic | 7 |
2 files changed, 11 insertions, 5 deletions
diff --git a/scripts/lib/image/engine.py b/scripts/lib/image/engine.py index f1df8b4db8..3813fec609 100644 --- a/scripts/lib/image/engine.py +++ b/scripts/lib/image/engine.py | |||
| @@ -67,7 +67,8 @@ def find_artifacts(image_name): | |||
| 67 | """ | 67 | """ |
| 68 | bitbake_env_lines = get_bitbake_env_lines() | 68 | bitbake_env_lines = get_bitbake_env_lines() |
| 69 | 69 | ||
| 70 | rootfs_dir = kernel_dir = hdddir = staging_data_dir = native_sysroot = "" | 70 | rootfs_dir = kernel_dir = bootimg_dir = "" |
| 71 | hdddir = staging_data_dir = native_sysroot = "" | ||
| 71 | 72 | ||
| 72 | for line in bitbake_env_lines.split('\n'): | 73 | for line in bitbake_env_lines.split('\n'): |
| 73 | if (get_line_val(line, "IMAGE_ROOTFS")): | 74 | if (get_line_val(line, "IMAGE_ROOTFS")): |
| @@ -85,8 +86,12 @@ def find_artifacts(image_name): | |||
| 85 | if (get_line_val(line, "STAGING_DIR_NATIVE")): | 86 | if (get_line_val(line, "STAGING_DIR_NATIVE")): |
| 86 | native_sysroot = get_line_val(line, "STAGING_DIR_NATIVE") | 87 | native_sysroot = get_line_val(line, "STAGING_DIR_NATIVE") |
| 87 | continue | 88 | continue |
| 89 | if (get_line_val(line, "DEPLOY_DIR_IMAGE")): | ||
| 90 | bootimg_dir = get_line_val(line, "DEPLOY_DIR_IMAGE") | ||
| 91 | continue | ||
| 88 | 92 | ||
| 89 | return (rootfs_dir, kernel_dir, hdddir, staging_data_dir, native_sysroot) | 93 | return (rootfs_dir, kernel_dir, bootimg_dir, hdddir, staging_data_dir, \ |
| 94 | native_sysroot) | ||
| 90 | 95 | ||
| 91 | 96 | ||
| 92 | CANNED_IMAGE_DIR = "lib/image/canned-wks" # relative to scripts | 97 | CANNED_IMAGE_DIR = "lib/image/canned-wks" # relative to scripts |
diff --git a/scripts/wic b/scripts/wic index 15cc9b31ef..731481007c 100755 --- a/scripts/wic +++ b/scripts/wic | |||
| @@ -134,8 +134,8 @@ def wic_create_subcommand(args, usage_str): | |||
| 134 | bootimg_dir = staging_data_dir = hdddir = "" | 134 | bootimg_dir = staging_data_dir = hdddir = "" |
| 135 | 135 | ||
| 136 | if options.image_name: | 136 | if options.image_name: |
| 137 | (rootfs_dir, kernel_dir, hdddir, staging_data_dir, native_sysroot) = \ | 137 | (rootfs_dir, kernel_dir, bootimg_dir, hdddir, \ |
| 138 | find_artifacts(options.image_name) | 138 | staging_data_dir, native_sysroot) = find_artifacts(options.image_name) |
| 139 | 139 | ||
| 140 | wks_file = args[0] | 140 | wks_file = args[0] |
| 141 | 141 | ||
| @@ -172,7 +172,8 @@ def wic_create_subcommand(args, usage_str): | |||
| 172 | not_found = not_found_dir = "" | 172 | not_found = not_found_dir = "" |
| 173 | if not os.path.isdir(rootfs_dir): | 173 | if not os.path.isdir(rootfs_dir): |
| 174 | (not_found, not_found_dir) = ("rootfs-dir", rootfs_dir) | 174 | (not_found, not_found_dir) = ("rootfs-dir", rootfs_dir) |
| 175 | elif not os.path.isdir(hdddir) and not os.path.isdir(staging_data_dir): | 175 | elif not os.path.isdir(bootimg_dir) and not os.path.isdir(hdddir) \ |
| 176 | and not os.path.isdir(staging_data_dir): | ||
| 176 | (not_found, not_found_dir) = ("bootimg-dir", bootimg_dir) | 177 | (not_found, not_found_dir) = ("bootimg-dir", bootimg_dir) |
| 177 | elif not os.path.isdir(kernel_dir): | 178 | elif not os.path.isdir(kernel_dir): |
| 178 | (not_found, not_found_dir) = ("kernel-dir", kernel_dir) | 179 | (not_found, not_found_dir) = ("kernel-dir", kernel_dir) |
