From ffff37f8f911af44eb18dabb053605fb6badcd1f Mon Sep 17 00:00:00 2001 From: "Brian A. Lloyd" Date: Thu, 24 Jan 2013 14:57:38 -0600 Subject: 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 Signed-off-by: Tom Zanussi Signed-off-by: Richard Purdie --- scripts/lib/bsp/kernel.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'scripts/lib/bsp/kernel.py') 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): def read_config_items(scripts_path, machine): """ Find and return a list of config items (CONFIG_XXX) in a machine's - user-defined config fragment [user-config.cfg]. + user-defined config fragment [${machine}-user-config.cfg]. """ config_items = [] - f = open_user_file(scripts_path, machine, "user-config.cfg", "r") + f = open_user_file(scripts_path, machine, machine+"-user-config.cfg", "r") lines = f.readlines() for line in lines: s = line.strip() @@ -178,9 +178,9 @@ def read_config_items(scripts_path, machine): def write_config_items(scripts_path, machine, config_items): """ Write (replace) the list of config items (CONFIG_XXX) in a - machine's user-defined config fragment [user-config.cfg]. + machine's user-defined config fragment [${machine}=user-config.cfg]. """ - f = open_user_file(scripts_path, machine, "user-config.cfg", "w") + f = open_user_file(scripts_path, machine, machine+"-user-config.cfg", "w") for item in config_items: f.write(item + "\n") f.close() @@ -191,7 +191,7 @@ def write_config_items(scripts_path, machine, config_items): def yocto_kernel_config_list(scripts_path, machine): """ Display the list of config items (CONFIG_XXX) in a machine's - user-defined config fragment [user-config.cfg]. + user-defined config fragment [${machine}-user-config.cfg]. """ config_items = read_config_items(scripts_path, machine) @@ -202,7 +202,7 @@ def yocto_kernel_config_list(scripts_path, machine): def yocto_kernel_config_rm(scripts_path, machine): """ Display the list of config items (CONFIG_XXX) in a machine's - user-defined config fragment [user-config.cfg], prompt the user + user-defined config fragment [${machine}-user-config.cfg], prompt the user for one or more to remove, and remove them. """ config_items = read_config_items(scripts_path, machine) @@ -235,7 +235,7 @@ def yocto_kernel_config_rm(scripts_path, machine): def yocto_kernel_config_add(scripts_path, machine, config_items): """ Add one or more config items (CONFIG_XXX) to a machine's - user-defined config fragment [user-config.cfg]. + user-defined config fragment [${machine}-user-config.cfg]. """ new_items = [] @@ -304,11 +304,11 @@ def find_filesdir(scripts_path, machine): def read_patch_items(scripts_path, machine): """ Find and return a list of patch items in a machine's user-defined - patch list [user-patches.scc]. + patch list [${machine}-user-patches.scc]. """ patch_items = [] - f = open_user_file(scripts_path, machine, "user-patches.scc", "r") + f = open_user_file(scripts_path, machine, machine+"-user-patches.scc", "r") lines = f.readlines() for line in lines: s = line.strip() @@ -325,9 +325,9 @@ def read_patch_items(scripts_path, machine): def write_patch_items(scripts_path, machine, patch_items): """ Write (replace) the list of patches in a machine's user-defined - patch list [user-patches.scc]. + patch list [${machine}-user-patches.scc]. """ - f = open_user_file(scripts_path, machine, "user-patches.scc", "w") + f = open_user_file(scripts_path, machine, machine+"-user-patches.scc", "w") for item in patch_items: f.write("patch " + item + "\n") f.close() @@ -338,7 +338,7 @@ def write_patch_items(scripts_path, machine, patch_items): def yocto_kernel_patch_list(scripts_path, machine): """ Display the list of patches in a machine's user-defined patch list - [user-patches.scc]. + [${machine}-user-patches.scc]. """ patches = read_patch_items(scripts_path, machine) @@ -349,7 +349,7 @@ def yocto_kernel_patch_list(scripts_path, machine): def yocto_kernel_patch_rm(scripts_path, machine): """ Remove one or more patches from a machine's user-defined patch - list [user-patches.scc]. + list [${machine}-user-patches.scc]. """ patches = read_patch_items(scripts_path, machine) @@ -390,7 +390,7 @@ def yocto_kernel_patch_rm(scripts_path, machine): def yocto_kernel_patch_add(scripts_path, machine, patches): """ Add one or more patches to a machine's user-defined patch list - [user-patches.scc]. + [${machine}-user-patches.scc]. """ existing_patches = read_patch_items(scripts_path, machine) -- cgit v1.2.3-54-g00ecf