diff options
author | Tom Zanussi <tom.zanussi@linux.intel.com> | 2014-10-29 17:04:23 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-10-30 13:03:41 +0000 |
commit | 42d0334aa8bf59937262f957f2ea04abc271138b (patch) | |
tree | 1b8b5b948c3b711eb9bd666e1e25c2a03b86d917 /scripts/lib/image | |
parent | 38400617febd61a1594969c86a6f1712a9d80516 (diff) | |
download | poky-42d0334aa8bf59937262f957f2ea04abc271138b.tar.gz |
wic: Remove special-case bootimg_dir
The first iterations of wic very shortsightedly catered to two
specific use-cases and added special-purpose params for those cases so
that they could be directly given their corresponding boot artifacts.
(hdddir and staging_data_dir).
As more use-cases are added, it becomes rather obvious that such a
scheme doens't scale, and additionally causes confusion for plugin
writers.
This removes those special cases and states explicitly in the help
text that plugins are responsible for locating their own boot
artifacts.
(From OE-Core rev: 6ba3eb5ff7c47aee6b3419fb3a348a634fe74ac9)
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/image')
-rw-r--r-- | scripts/lib/image/engine.py | 37 | ||||
-rw-r--r-- | scripts/lib/image/help.py | 2 |
2 files changed, 10 insertions, 29 deletions
diff --git a/scripts/lib/image/engine.py b/scripts/lib/image/engine.py index f1df8b4db8..e794545e94 100644 --- a/scripts/lib/image/engine.py +++ b/scripts/lib/image/engine.py | |||
@@ -67,7 +67,7 @@ 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 = native_sysroot = "" |
71 | 71 | ||
72 | for line in bitbake_env_lines.split('\n'): | 72 | for line in bitbake_env_lines.split('\n'): |
73 | if (get_line_val(line, "IMAGE_ROOTFS")): | 73 | if (get_line_val(line, "IMAGE_ROOTFS")): |
@@ -76,17 +76,11 @@ def find_artifacts(image_name): | |||
76 | if (get_line_val(line, "STAGING_KERNEL_DIR")): | 76 | if (get_line_val(line, "STAGING_KERNEL_DIR")): |
77 | kernel_dir = get_line_val(line, "STAGING_KERNEL_DIR") | 77 | kernel_dir = get_line_val(line, "STAGING_KERNEL_DIR") |
78 | continue | 78 | continue |
79 | if (get_line_val(line, "HDDDIR")): | ||
80 | hdddir = get_line_val(line, "HDDDIR") | ||
81 | continue | ||
82 | if (get_line_val(line, "STAGING_DATADIR")): | ||
83 | staging_data_dir = get_line_val(line, "STAGING_DATADIR") | ||
84 | continue | ||
85 | if (get_line_val(line, "STAGING_DIR_NATIVE")): | 79 | if (get_line_val(line, "STAGING_DIR_NATIVE")): |
86 | native_sysroot = get_line_val(line, "STAGING_DIR_NATIVE") | 80 | native_sysroot = get_line_val(line, "STAGING_DIR_NATIVE") |
87 | continue | 81 | continue |
88 | 82 | ||
89 | return (rootfs_dir, kernel_dir, hdddir, staging_data_dir, native_sysroot) | 83 | return (rootfs_dir, kernel_dir, bootimg_dir, native_sysroot) |
90 | 84 | ||
91 | 85 | ||
92 | CANNED_IMAGE_DIR = "lib/image/canned-wks" # relative to scripts | 86 | CANNED_IMAGE_DIR = "lib/image/canned-wks" # relative to scripts |
@@ -185,18 +179,15 @@ def list_source_plugins(): | |||
185 | 179 | ||
186 | 180 | ||
187 | def wic_create(args, wks_file, rootfs_dir, bootimg_dir, kernel_dir, | 181 | def wic_create(args, wks_file, rootfs_dir, bootimg_dir, kernel_dir, |
188 | native_sysroot, hdddir, staging_data_dir, scripts_path, | 182 | native_sysroot, scripts_path, image_output_dir, debug, |
189 | image_output_dir, debug, properties_file, properties=None): | 183 | properties_file, properties=None): |
190 | """ | 184 | """Create image |
191 | Create image | ||
192 | 185 | ||
193 | wks_file - user-defined OE kickstart file | 186 | wks_file - user-defined OE kickstart file |
194 | rootfs_dir - absolute path to the build's /rootfs dir | 187 | rootfs_dir - absolute path to the build's /rootfs dir |
195 | bootimg_dir - absolute path to the build's boot artifacts directory | 188 | bootimg_dir - absolute path to the build's boot artifacts directory |
196 | kernel_dir - absolute path to the build's kernel directory | 189 | kernel_dir - absolute path to the build's kernel directory |
197 | native_sysroot - absolute path to the build's native sysroots dir | 190 | native_sysroot - absolute path to the build's native sysroots dir |
198 | hdddir - absolute path to the build's HDDDIR dir | ||
199 | staging_data_dir - absolute path to the build's STAGING_DATA_DIR dir | ||
200 | scripts_path - absolute path to /scripts dir | 191 | scripts_path - absolute path to /scripts dir |
201 | image_output_dir - dirname to create for image | 192 | image_output_dir - dirname to create for image |
202 | properties_file - use values from this file if nonempty i.e no prompting | 193 | properties_file - use values from this file if nonempty i.e no prompting |
@@ -211,22 +202,14 @@ def wic_create(args, wks_file, rootfs_dir, bootimg_dir, kernel_dir, | |||
211 | rootfs_dir: IMAGE_ROOTFS | 202 | rootfs_dir: IMAGE_ROOTFS |
212 | kernel_dir: STAGING_KERNEL_DIR | 203 | kernel_dir: STAGING_KERNEL_DIR |
213 | native_sysroot: STAGING_DIR_NATIVE | 204 | native_sysroot: STAGING_DIR_NATIVE |
214 | hdddir: HDDDIR | ||
215 | staging_data_dir: STAGING_DATA_DIR | ||
216 | 205 | ||
217 | In the above case, bootimg_dir remains unset and the image | 206 | In the above case, bootimg_dir remains unset and the |
218 | creation code determines which of the passed-in directories to | 207 | plugin-specific image creation code is responsible for finding the |
219 | use. | 208 | bootimg artifacts. |
220 | 209 | ||
221 | In the case where the values are passed in explicitly i.e 'wic -e' | 210 | In the case where the values are passed in explicitly i.e 'wic -e' |
222 | is not used but rather the individual 'wic' options are used to | 211 | is not used but rather the individual 'wic' options are used to |
223 | explicitly specify these values, hdddir and staging_data_dir will | 212 | explicitly specify these values. |
224 | be unset, but bootimg_dir must be explicit i.e. explicitly set to | ||
225 | either hdddir or staging_data_dir, depending on the image being | ||
226 | generated. The other values (rootfs_dir, kernel_dir, and | ||
227 | native_sysroot) correspond to the same values found above via | ||
228 | 'bitbake -e'). | ||
229 | |||
230 | """ | 213 | """ |
231 | try: | 214 | try: |
232 | oe_builddir = os.environ["BUILDDIR"] | 215 | oe_builddir = os.environ["BUILDDIR"] |
@@ -242,8 +225,6 @@ def wic_create(args, wks_file, rootfs_dir, bootimg_dir, kernel_dir, | |||
242 | direct_args.insert(0, bootimg_dir) | 225 | direct_args.insert(0, bootimg_dir) |
243 | direct_args.insert(0, kernel_dir) | 226 | direct_args.insert(0, kernel_dir) |
244 | direct_args.insert(0, native_sysroot) | 227 | direct_args.insert(0, native_sysroot) |
245 | direct_args.insert(0, hdddir) | ||
246 | direct_args.insert(0, staging_data_dir) | ||
247 | direct_args.insert(0, "direct") | 228 | direct_args.insert(0, "direct") |
248 | 229 | ||
249 | if debug: | 230 | if debug: |
diff --git a/scripts/lib/image/help.py b/scripts/lib/image/help.py index 0963532218..6b74f57662 100644 --- a/scripts/lib/image/help.py +++ b/scripts/lib/image/help.py | |||
@@ -189,7 +189,7 @@ DESCRIPTION | |||
189 | -r: IMAGE_ROOTFS | 189 | -r: IMAGE_ROOTFS |
190 | -k: STAGING_KERNEL_DIR | 190 | -k: STAGING_KERNEL_DIR |
191 | -n: STAGING_DIR_NATIVE | 191 | -n: STAGING_DIR_NATIVE |
192 | -b: HDDDIR and STAGING_DATA_DIR (handlers decide which to use) | 192 | -b: empty (plugin-specific handlers must determine this) |
193 | 193 | ||
194 | If 'wic -e' is not used, the user needs to select the appropriate | 194 | If 'wic -e' is not used, the user needs to select the appropriate |
195 | value for -b (as well as -r, -k, and -n). | 195 | value for -b (as well as -r, -k, and -n). |