diff options
author | Brian A. Lloyd <brian.lloyd@familyhonor.net> | 2013-01-24 14:57:38 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-01-25 14:12:36 +0000 |
commit | ffff37f8f911af44eb18dabb053605fb6badcd1f (patch) | |
tree | d06b659f446cf365ea7296047d66d871f330e302 /scripts/lib/bsp/kernel.py | |
parent | 2f1aba504c592b5983d09e84cba71f86e8cea02a (diff) | |
download | poky-ffff37f8f911af44eb18dabb053605fb6badcd1f.tar.gz |
yocto-bsp: qualify user files with machine name
The bblayer abstraction makes it where multiple layers can be
configured and used at the same time. Some layers make changes to
support a specific machine, and should not have any affect when other
machines are in use.
For linux-yocto, all bsps are created with a user-config.cfg and
user-config.cfg and user-patches.scc. This means that those files
will be pulled from the first location found, which might correspond
to files customized for a different machine.
Instead of using the names user-config.cfg and user-patches.scc, I
propose a machine specific name be used such as
{{=machine}}user-patches.scc and {{=machine}}user-config.cfg. This
would necessitate that all references changed to these new names,
which would affect the yocto-bsp and yocto-kernel scripts.
With this change, it would be possible to have multiple machine BSPs
searched at the same time and to select which to build against by
using a command like MACHINE=qmeux86 bitbake core-image-sato to
override the default.
Note many of the standard BSPs do not seem to suffer this problem as
they do not use the common files user-config.cfg and user-patches.scc
that the yocto-* scripts depend upon.
Additions by Tom Zanussi:
- renamed user-config.cfg to {{=machine}}-user-config.cfg everywhere
- renamed user-patches.scc to {{=machine}}-user-patches.scc everywhere
- added the user-config/patches SRC_URI items to the qemu -rt kernel recipes
- fixed conflicts due to the new open_user_file() helper function
- updated user filename conflicts caused by directory renaming
- updated custom kernel files to match
Fixes [YOCTO #3731]
(From meta-yocto rev: c20bef60aa8d52971fb061d4b8d473ad19c03180)
Signed-off-by: Brian A. Lloyd <brian.lloyd@familyhonor.net>
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/bsp/kernel.py')
-rw-r--r-- | scripts/lib/bsp/kernel.py | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/scripts/lib/bsp/kernel.py b/scripts/lib/bsp/kernel.py index 5935e667bc..dabb9cf3f0 100644 --- a/scripts/lib/bsp/kernel.py +++ b/scripts/lib/bsp/kernel.py | |||
@@ -160,11 +160,11 @@ def open_user_file(scripts_path, machine, userfile, mode): | |||
160 | def read_config_items(scripts_path, machine): | 160 | def read_config_items(scripts_path, machine): |
161 | """ | 161 | """ |
162 | Find and return a list of config items (CONFIG_XXX) in a machine's | 162 | Find and return a list of config items (CONFIG_XXX) in a machine's |
163 | user-defined config fragment [user-config.cfg]. | 163 | user-defined config fragment [${machine}-user-config.cfg]. |
164 | """ | 164 | """ |
165 | config_items = [] | 165 | config_items = [] |
166 | 166 | ||
167 | f = open_user_file(scripts_path, machine, "user-config.cfg", "r") | 167 | f = open_user_file(scripts_path, machine, machine+"-user-config.cfg", "r") |
168 | lines = f.readlines() | 168 | lines = f.readlines() |
169 | for line in lines: | 169 | for line in lines: |
170 | s = line.strip() | 170 | s = line.strip() |
@@ -178,9 +178,9 @@ def read_config_items(scripts_path, machine): | |||
178 | def write_config_items(scripts_path, machine, config_items): | 178 | def write_config_items(scripts_path, machine, config_items): |
179 | """ | 179 | """ |
180 | Write (replace) the list of config items (CONFIG_XXX) in a | 180 | Write (replace) the list of config items (CONFIG_XXX) in a |
181 | machine's user-defined config fragment [user-config.cfg]. | 181 | machine's user-defined config fragment [${machine}=user-config.cfg]. |
182 | """ | 182 | """ |
183 | f = open_user_file(scripts_path, machine, "user-config.cfg", "w") | 183 | f = open_user_file(scripts_path, machine, machine+"-user-config.cfg", "w") |
184 | for item in config_items: | 184 | for item in config_items: |
185 | f.write(item + "\n") | 185 | f.write(item + "\n") |
186 | f.close() | 186 | f.close() |
@@ -191,7 +191,7 @@ def write_config_items(scripts_path, machine, config_items): | |||
191 | def yocto_kernel_config_list(scripts_path, machine): | 191 | def yocto_kernel_config_list(scripts_path, machine): |
192 | """ | 192 | """ |
193 | Display the list of config items (CONFIG_XXX) in a machine's | 193 | Display the list of config items (CONFIG_XXX) in a machine's |
194 | user-defined config fragment [user-config.cfg]. | 194 | user-defined config fragment [${machine}-user-config.cfg]. |
195 | """ | 195 | """ |
196 | config_items = read_config_items(scripts_path, machine) | 196 | config_items = read_config_items(scripts_path, machine) |
197 | 197 | ||
@@ -202,7 +202,7 @@ def yocto_kernel_config_list(scripts_path, machine): | |||
202 | def yocto_kernel_config_rm(scripts_path, machine): | 202 | def yocto_kernel_config_rm(scripts_path, machine): |
203 | """ | 203 | """ |
204 | Display the list of config items (CONFIG_XXX) in a machine's | 204 | Display the list of config items (CONFIG_XXX) in a machine's |
205 | user-defined config fragment [user-config.cfg], prompt the user | 205 | user-defined config fragment [${machine}-user-config.cfg], prompt the user |
206 | for one or more to remove, and remove them. | 206 | for one or more to remove, and remove them. |
207 | """ | 207 | """ |
208 | config_items = read_config_items(scripts_path, machine) | 208 | config_items = read_config_items(scripts_path, machine) |
@@ -235,7 +235,7 @@ def yocto_kernel_config_rm(scripts_path, machine): | |||
235 | def yocto_kernel_config_add(scripts_path, machine, config_items): | 235 | def yocto_kernel_config_add(scripts_path, machine, config_items): |
236 | """ | 236 | """ |
237 | Add one or more config items (CONFIG_XXX) to a machine's | 237 | Add one or more config items (CONFIG_XXX) to a machine's |
238 | user-defined config fragment [user-config.cfg]. | 238 | user-defined config fragment [${machine}-user-config.cfg]. |
239 | """ | 239 | """ |
240 | new_items = [] | 240 | new_items = [] |
241 | 241 | ||
@@ -304,11 +304,11 @@ def find_filesdir(scripts_path, machine): | |||
304 | def read_patch_items(scripts_path, machine): | 304 | def read_patch_items(scripts_path, machine): |
305 | """ | 305 | """ |
306 | Find and return a list of patch items in a machine's user-defined | 306 | Find and return a list of patch items in a machine's user-defined |
307 | patch list [user-patches.scc]. | 307 | patch list [${machine}-user-patches.scc]. |
308 | """ | 308 | """ |
309 | patch_items = [] | 309 | patch_items = [] |
310 | 310 | ||
311 | f = open_user_file(scripts_path, machine, "user-patches.scc", "r") | 311 | f = open_user_file(scripts_path, machine, machine+"-user-patches.scc", "r") |
312 | lines = f.readlines() | 312 | lines = f.readlines() |
313 | for line in lines: | 313 | for line in lines: |
314 | s = line.strip() | 314 | s = line.strip() |
@@ -325,9 +325,9 @@ def read_patch_items(scripts_path, machine): | |||
325 | def write_patch_items(scripts_path, machine, patch_items): | 325 | def write_patch_items(scripts_path, machine, patch_items): |
326 | """ | 326 | """ |
327 | Write (replace) the list of patches in a machine's user-defined | 327 | Write (replace) the list of patches in a machine's user-defined |
328 | patch list [user-patches.scc]. | 328 | patch list [${machine}-user-patches.scc]. |
329 | """ | 329 | """ |
330 | f = open_user_file(scripts_path, machine, "user-patches.scc", "w") | 330 | f = open_user_file(scripts_path, machine, machine+"-user-patches.scc", "w") |
331 | for item in patch_items: | 331 | for item in patch_items: |
332 | f.write("patch " + item + "\n") | 332 | f.write("patch " + item + "\n") |
333 | f.close() | 333 | f.close() |
@@ -338,7 +338,7 @@ def write_patch_items(scripts_path, machine, patch_items): | |||
338 | def yocto_kernel_patch_list(scripts_path, machine): | 338 | def yocto_kernel_patch_list(scripts_path, machine): |
339 | """ | 339 | """ |
340 | Display the list of patches in a machine's user-defined patch list | 340 | Display the list of patches in a machine's user-defined patch list |
341 | [user-patches.scc]. | 341 | [${machine}-user-patches.scc]. |
342 | """ | 342 | """ |
343 | patches = read_patch_items(scripts_path, machine) | 343 | patches = read_patch_items(scripts_path, machine) |
344 | 344 | ||
@@ -349,7 +349,7 @@ def yocto_kernel_patch_list(scripts_path, machine): | |||
349 | def yocto_kernel_patch_rm(scripts_path, machine): | 349 | def yocto_kernel_patch_rm(scripts_path, machine): |
350 | """ | 350 | """ |
351 | Remove one or more patches from a machine's user-defined patch | 351 | Remove one or more patches from a machine's user-defined patch |
352 | list [user-patches.scc]. | 352 | list [${machine}-user-patches.scc]. |
353 | """ | 353 | """ |
354 | patches = read_patch_items(scripts_path, machine) | 354 | patches = read_patch_items(scripts_path, machine) |
355 | 355 | ||
@@ -390,7 +390,7 @@ def yocto_kernel_patch_rm(scripts_path, machine): | |||
390 | def yocto_kernel_patch_add(scripts_path, machine, patches): | 390 | def yocto_kernel_patch_add(scripts_path, machine, patches): |
391 | """ | 391 | """ |
392 | Add one or more patches to a machine's user-defined patch list | 392 | Add one or more patches to a machine's user-defined patch list |
393 | [user-patches.scc]. | 393 | [${machine}-user-patches.scc]. |
394 | """ | 394 | """ |
395 | existing_patches = read_patch_items(scripts_path, machine) | 395 | existing_patches = read_patch_items(scripts_path, machine) |
396 | 396 | ||