diff mbox series

[kirkstone,v2] meta-arago-distro: Add recipe for jailhouse image and update kernel and u-boot repo for jailhouse build.

Message ID 20230606140237.178008-1-p-bhagat@ti.com
State Superseded
Delegated to: Ryan Eatmon
Headers show
Series [kirkstone,v2] meta-arago-distro: Add recipe for jailhouse image and update kernel and u-boot repo for jailhouse build. | expand

Commit Message

Paresh Bhagat June 6, 2023, 2:02 p.m. UTC
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 <p-bhagat@ti.com>
---
 .../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

Comments

Denys Dmytriyenko June 6, 2023, 10:30 p.m. UTC | #1
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 <p-bhagat@ti.com>
> ---
>  .../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?


> diff --git a/meta-arago-distro/recipes-core/images/tisdk-jailhouse-image.bb b/meta-arago-distro/recipes-core/images/tisdk-jailhouse-image.bb
> new file mode 100644
> index 00000000..af880d30
> --- /dev/null
> +++ b/meta-arago-distro/recipes-core/images/tisdk-jailhouse-image.bb
> @@ -0,0 +1,14 @@
> +# Produces wic image for jailhouse
> +
> +require recipes-core/images/tisdk-default-image.bb
> +
> +COMPATIBLE_MACHINE = "am62xx-evm"
> +
> +IMAGE_INSTALL:append:am62xx-evm = " jailhouse"
> +
> +# Package overlay for jailhouse
> +KERNEL_DEVICETREE:append:am62xx-evm = " ti/k3-am625-base-board-jailhouse.dtbo"
> +
> +export IMAGE_BASENAME = "tisdk-jailhouse-image"
> +
> +WIC_CREATE_EXTRA_ARGS:append = " --no-fstab-update"
> -- 
> 2.34.1
Paresh Bhagat June 7, 2023, 9:11 a.m. UTC | #2
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 <p-bhagat@ti.com>
>> ---
>>   .../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.

Thanks

>> diff --git a/meta-arago-distro/recipes-core/images/tisdk-jailhouse-image.bb b/meta-arago-distro/recipes-core/images/tisdk-jailhouse-image.bb
>> new file mode 100644
>> index 00000000..af880d30
>> --- /dev/null
>> +++ b/meta-arago-distro/recipes-core/images/tisdk-jailhouse-image.bb
>> @@ -0,0 +1,14 @@
>> +# Produces wic image for jailhouse
>> +
>> +require recipes-core/images/tisdk-default-image.bb
>> +
>> +COMPATIBLE_MACHINE = "am62xx-evm"
>> +
>> +IMAGE_INSTALL:append:am62xx-evm = " jailhouse"
>> +
>> +# Package overlay for jailhouse
>> +KERNEL_DEVICETREE:append:am62xx-evm = " ti/k3-am625-base-board-jailhouse.dtbo"
>> +
>> +export IMAGE_BASENAME = "tisdk-jailhouse-image"
>> +
>> +WIC_CREATE_EXTRA_ARGS:append = " --no-fstab-update"
>> -- 
>> 2.34.1
Denys Dmytriyenko June 8, 2023, 9:46 p.m. UTC | #3
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 <p-bhagat@ti.com>
> >>---
> >>  .../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?
diff mbox series

Patch

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)}"
diff --git a/meta-arago-distro/recipes-core/images/tisdk-jailhouse-image.bb b/meta-arago-distro/recipes-core/images/tisdk-jailhouse-image.bb
new file mode 100644
index 00000000..af880d30
--- /dev/null
+++ b/meta-arago-distro/recipes-core/images/tisdk-jailhouse-image.bb
@@ -0,0 +1,14 @@ 
+# Produces wic image for jailhouse
+
+require recipes-core/images/tisdk-default-image.bb
+
+COMPATIBLE_MACHINE = "am62xx-evm"
+
+IMAGE_INSTALL:append:am62xx-evm = " jailhouse"
+
+# Package overlay for jailhouse
+KERNEL_DEVICETREE:append:am62xx-evm = " ti/k3-am625-base-board-jailhouse.dtbo"
+
+export IMAGE_BASENAME = "tisdk-jailhouse-image"
+
+WIC_CREATE_EXTRA_ARGS:append = " --no-fstab-update"