From a7ce81df2f6e513a7e364c443759733c778b5c1f Mon Sep 17 00:00:00 2001 From: "Brian A. Lloyd" Date: Mon, 21 Jan 2013 15:14:22 -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 Fixes [YOCTO #3731] (From meta-yocto rev: b148d800773f3c2e6edeb4f05850b0291a8bb7d5) 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 d4bdc4c250..7c14761f3c 100644 --- a/scripts/lib/bsp/kernel.py +++ b/scripts/lib/bsp/kernel.py @@ -136,12 +136,12 @@ def gen_choices_str(choices): 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 = [] layer = find_bsp_layer(scripts_path, machine) - cfg = os.path.join(layer, "recipes-kernel/linux/files/user-config.cfg") + cfg = os.path.join(layer, "recipes-kernel/linux/files/"+machine+"-user-config.cfg") f = open(cfg, "r") lines = f.readlines() @@ -157,10 +157,10 @@ 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]. """ layer = find_bsp_layer(scripts_path, machine) - cfg = os.path.join(layer, "recipes-kernel/linux/files/user-config.cfg") + cfg = os.path.join(layer, "recipes-kernel/linux/files/"+machine+"-user-config.cfg") f = open(cfg, "w") for item in config_items: @@ -173,7 +173,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) @@ -196,7 +196,7 @@ def map_choice(choice_str, array): 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) @@ -229,7 +229,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 = [] @@ -373,12 +373,12 @@ def find_patches(src_uri): 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 = [] layer = find_bsp_layer(scripts_path, machine) - patches = os.path.join(layer, "recipes-kernel/linux/files/user-patches.scc") + patches = os.path.join(layer, "recipes-kernel/linux/files/"+machine+"-user-patches.scc") f = open(patches, "r") lines = f.readlines() @@ -397,11 +397,11 @@ 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]. """ layer = find_bsp_layer(scripts_path, machine) - patches = os.path.join(layer, "recipes-kernel/linux/files/user-patches.scc") + patches = os.path.join(layer, "recipes-kernel/linux/files/"+machine+"-user-patches.scc") f = open(patches, "w") for item in patch_items: @@ -417,7 +417,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]. """ (start_line, end_line, src_uri) = find_bsp_kernel_src_uri(scripts_path, machine) patches = find_patches(src_uri) @@ -429,7 +429,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]. """ (start_line, end_line, src_uri) = find_bsp_kernel_src_uri(scripts_path, machine) patches = find_patches(src_uri) @@ -470,7 +470,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]. """ (start_line, end_line, src_uri) = find_bsp_kernel_src_uri(scripts_path, machine) src_uri_patches = find_patches(src_uri) -- cgit v1.2.3-54-g00ecf