On Wed, Jun 07, 2023 at 02:41:10PM +0530, Paresh Bhagat wrote:
> Hi Denys,
> 
> On 07/06/23 04:00, Denys Dmytriyenko wrote:
> >On Tue, Jun 06, 2023 at 07:32:37PM +0530, Paresh Bhagat via 
> >lists.yoctoproject.org wrote:
> >>Add a recipe to build and package jailhouse image for am62xx-evm. new image 
> >>will
> >>be named as tisdk-jailhouse-image. jailhouse recipe will also package 
> >>overlay
> >>used for jailhouse.
> >>
> >>Add functionality to change kernel and u-boot source via MACHINE_FEATURES 
> >>for
> >>jailhouse. so if MACHINE_FEATURES:append = " jailhouse" is added to 
> >>local.conf
> >>different recipe for kernel (linux-ti-extras) and u-boot (u-boot-ti-extras) 
> >>will
> >>be used.
> >>
> >>So for jailhouse build for am62xx-evm user will have to add
> >>MACHINE_FEATURES:append = " jailhouse" to local.conf and then start a 
> >>jailhouse
> >>build with MACHINE=am62xx-evm bitbake -k tisdk-jailhouse-image.
> >>
> >>Signed-off-by: Paresh Bhagat <[email protected]>
> >>---
> >>  .../conf/distro/include/arago-prefs.inc            |  7 +++++++
> >>  .../recipes-core/images/tisdk-jailhouse-image.bb   | 14 ++++++++++++++
> >>  2 files changed, 21 insertions(+)
> >>  create mode 100644 
> >> meta-arago-distro/recipes-core/images/tisdk-jailhouse-image.bb
> >>
> >>diff --git a/meta-arago-distro/conf/distro/include/arago-prefs.inc 
> >>b/meta-arago-distro/conf/distro/include/arago-prefs.inc
> >>index 34c3c539..40269b56 100644
> >>--- a/meta-arago-distro/conf/distro/include/arago-prefs.inc
> >>+++ b/meta-arago-distro/conf/distro/include/arago-prefs.inc
> >>@@ -19,3 +19,10 @@ PREFERRED_PROVIDER_wpa-supplicant = "wpa-supplicant"
> >>  #PREFERRED_PROVIDER_wpa-supplicant:ti33x = "wpa-supplicant-wl18xx"
> >>  #PREFERRED_PROVIDER_wpa-supplicant:ti43x = "wpa-supplicant-wl18xx"
> >>  #PREFERRED_PROVIDER_wpa-supplicant:omap-a15 = "wpa-supplicant-wl18xx"
> >>+
> >>+# change kernel when jailhouse image is build
> >>+PREFERRED_PROVIDER_virtual/kernel = 
> >>"${@bb.utils.contains('MACHINE_FEATURES','jailhouse','linux-ti-extras','linux-ti-staging',d)}"
> >>+
> >>+#Change uboot source when jailhouse image is build
> >>+PREFERRED_PROVIDER_virtual/bootloader = 
> >>"${@bb.utils.contains('MACHINE_FEATURES','jailhouse','u-boot-ti-extras','u-boot-ti-staging',d)}"
> >>+PREFERRED_PROVIDER_u-boot = 
> >>"${@bb.utils.contains('MACHINE_FEATURES','jailhouse','u-boot-ti-extras','u-boot-ti-staging',d)}"
> >This would conflict with all the other places PREFERRED_PROVIDERs are being
> >set. In other words, if "jailhouse" in MACHINE_FEATURES is not set, you are
> >forcing everyone into "ti-staging" trees, which is not always the case!
> >What about "bb.org" trees, or "next", or "mainline" or any downstream ones?
> 
> based on your review, i tried changing PREFERRED_PROVIDERs in
> tisdk-jailhouse-image.bb using:
> 
> if 'jailhouse' in d.getVar('MACHINE_FEATURES',True).split():
>     d.setVar('PREFERRED_PROVIDER_virtual/kernel', 'linux-ti-extras')
>     d.setVar('PREFERRED_PROVIDER_virtual/bootloader', 'u-boot-ti-extras')
>     d.setVar('PREFERRED_PROVIDER_u-boot', 'u-boot-ti-extras')
> 
> i added above code to do_configure:append() . also tried adding
> above code inside a custom function "do_change_provider()" and used
> "addtask do_change_provider" inside tisdk-jailhouse-image recipe.
> but either the build failed or the preferred_providers didn't
> change. can you help with this or suggest any alternate method we
> can use? We want to change preferred_providers if MACHINE_FEATURES
> has jailhouse and not have a conflict with other places as you
> mentioned.

As PREFERRED_PROVIDER has a global scope, changing it in a recipe will have 
only recipe-local scope and won't affect its value anywhere else. It must be 
set during initial configuration step in one of the .conf files or .inc files 
that are included form .conf - local.conf, <machine>.conf, <distro>.conf, etc.

Specifically to your change - yes, arago-prefs.inc is such a file that gets 
included from arago.conf, but you shouldn't try to handle "else" part of the 
conditional to avoid overwriting unrelated cases. Maybe even check that the 
initial value points to "ti-staging" before modifying it.

And moreover, would it be easier to just handle this case and switch BRANCH or 
SRC_URI inside the existing "ti-staging" recipes, as discussed on meta-ti list?

-- 
Denys


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#14562): 
https://lists.yoctoproject.org/g/meta-arago/message/14562
Mute This Topic: https://lists.yoctoproject.org/mt/99363698/21656
Group Owner: [email protected]
Unsubscribe: 
https://lists.yoctoproject.org/g/meta-arago/leave/10763299/21656/89520264/xyzzy 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to