Is it possible to acces single bb file for two machine configurations ?in yocto setup?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is it possible to acces single bb file for two machine configurations ?in yocto setup?

4,993 Views
veeranjaneyulug
Contributor III

Hi all,

we are using yocto setup.But we one doubt is it possible to access two machine configurations from single u-boot source bb file ?

machine1 and machine2 configure in sources/meta-fsl-bsp-release/imx/meta-fsl-arm/conf/machine/machine1.conf

like that i gave two machine configurations but i added both machine related patches in u-boot source bb file.

But with out commenting both patch files how can I access one machine patch file in bb file .in bb file

$ vi sources/meta-fsl-bsp-release/imx/meta-fsl-arm/recipes-bsp/u-boot/u-boot-imx_2014.04.bb

From above bb file is it possible to access two different machine configurations by setting machine name

we added the below two lines in above u-boot bb file .

do_patch_prepend(){

if [ "$MACHINE" = "imx6_zcam" ]; then

        SRC_URI +="file://0001-imx6_zcam_uboot_customization.patch"

elif [ "$MACHINE" = "imx6_zcam_custom" ]; then

        SRC_URI +="file://0002-imx6_zcam_custom_uboot_customization.patch"

else

        echo""

fi

}

Then export build directory

$source setenvironment -b build

$vi conf/local.conf

In the above file we gave MACHINE ??=machine1   selected

===========================

Then extract u-boot source

$bitbake u-boot -c unapck -f

====================

Then apply patch

$bitbake u-boot -c patch -f

========================

But patch was not applied .so any body have any idea of that .

$bitbake u-boot -c compile/build -f

i gave its not compiling giving patch was not extract .

Thanks & Regards

veeranjaneyulu

Labels (5)
9 Replies

3,117 Views
pranavmadhu
Contributor IV

Hi,

try this

do_pre_configure() {

    patch -p1 < ${WORKDIR}/<your patchfile name>

}

add the task pre_configure before do_configure, but after after do_patch, also dont give .patch extension to patch file

3,116 Views
veeranjaneyulug
Contributor III

Hi Pranav Madhu

Thanks for your reply reply.

But i tried no use .its not extracting .I gave normal syntax patch added like SRC_URI+=<"file://patchname">.Its working but i want gave two patch files at the same time  for different machine configuration patch files.Is it possible to give ?

Thanks & Regards

veeranjaneyulu

0 Kudos

3,117 Views
pranavmadhu
Contributor IV

Hi Veeranjaneyulu,

Sorry I'm not sure about it, try to give the do_pre_configure in if-else condition.

3,117 Views
veeranjaneyulug
Contributor III

Its ok pranav .

Any way thanks for your reply.

0 Kudos

3,117 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello Veeranjaneyulu,

It should be theoretically possible to do this, although I haven’t personally tired it. It seems odd that you’re not seeing the patch being applied. Have you tried using MACHINE ??=’machine1‘ on the configuration file and then performing a clean to the recipe to force it to build it from scratch? It may be possible that Bitbake already has the file so does not need to run the tasks again.

Please let us know of your findings!

Regards,

0 Kudos

3,117 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello Veeranjaneyulu,

On a second thought, I think the syntax should be like the following to use the value of MACHINE on the logic argument of the function. Perhaps this may help.

if [ "${MACHINE}" = "imx6_zcam" ]; then

        SRC_URI +="file://0001-imx6_zcam_uboot_customization.patch"

elif [ "${MACHINE}" = "imx6_zcam_custom" ]; then

        SRC_URI +="file://0002-imx6_zcam_custom_uboot_customization.patch"

0 Kudos

3,117 Views
veeranjaneyulug
Contributor III

Thanks for your reply.

I tried like that syntax also but patch was not extracted ,it means in source directory we cant able to get patch related extracted source .Thats we got custom config error issue.

Then compile by using bitbake .Its giving below error .ie reason patch extracting issue.I gave individual buildings .Those builds are compiling and building.

WARNING: /home/vishwa/workspace/checkout_mar16/coderepo1/sources/meta-fsl-bsp-release/imx/meta-fsl-arm/recipes-bsp/u-boot/u-boot-imx_2014.04.bb.do_patch is tainted from a forced run

WARNING: /home/vishwa/workspace/checkout_mar16/coderepo1/sources/meta-fsl-bsp-release/imx/meta-fsl-arm/recipes-bsp/u-boot/u-boot-imx_2014.04.bb.do_compile is tainted from a forced run

NOTE: Executing SetScene Tasks

NOTE: Executing RunQueue Tasks

ERROR: Function failed: do_compile (log file is located at /home/vishwa/workspace/checkout_mar16/coderepo1/build/tmp/work/imx6_zcam-poky-linux-gnueabi/u-boot-imx/2014.04-r0/temp/log.do_compile.5847)

ERROR: Logfile of failure stored in: /home/vishwa/workspace/checkout_mar16/coderepo1/build/tmp/work/imx6_zcam-poky-linux-gnueabi/u-boot-imx/2014.04-r0/temp/log.do_compile.5847

Log data follows:

| DEBUG: Executing shell function do_compile

| NOTE: make -j 4 CROSS_COMPILE=arm-poky-linux-gnueabi- CC=arm-poky-linux-gnueabi-gcc  --sysroot=/home/vishwa/workspace/checkout_mar16/coderepo1/build/tmp/sysroots/imx6_zcam imx6_zcam_config

| make: *** No rule to make target `imx6_zcam_config'.  Stop.

| make: *** [imx6_zcam_config] Error 1

| ERROR: oe_runmake failed

| WARNING: exit code 1 from a shell command.

| ERROR: Function failed: do_compile (log file is located at /home/vishwa/workspace/checkout_mar16/coderepo1/build/tmp/work/imx6_zcam-poky-linux-gnueabi/u-boot-imx/2014.04-r0/temp/log.do_compile.5847)

ERROR: Task 4 (/home/vishwa/workspace/checkout_mar16/coderepo1/sources/meta-fsl-bsp-release/imx/meta-fsl-arm/recipes-bsp/u-boot/u-boot-imx_2014.04.bb, do_compile) failed with exit code '1'

NOTE: Tasks Summary: Attempted 242 tasks of which 240 didn't need to be rerun and 1 failed.

Summary: 1 task failed:

  /home/vishwa/workspace/checkout_mar16/coderepo1/sources/meta-fsl-bsp-release/imx/meta-fsl-arm/recipes-bsp/u-boot/u-boot-imx_2014.04.bb, do_compile

Summary: There were 2 WARNING messages shown.

Summary: There was 1 ERROR message shown, returning a non-zero exit code.

0 Kudos

3,117 Views
veeranjaneyulug
Contributor III

In U-boot source Make file i customized as per my requirement .ie working but my requirement is how to access from one bb file two different machine patch files .

1,436 Views
meeras
Contributor I

Hi @veeranjaneyulug did you resolve your issue? I am stuck at the same point. I want to apply same patch for 2 different machines in single .bbappend file

0 Kudos