Yocto S32G add a new layer , how to add it to image

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

Yocto S32G add a new layer , how to add it to image

Jump to solution
2,211 Views
Ada_Lovelace
Contributor IV

Hi, All

I build the board s32g274ardb2, it  can make the image. Now I want to add new layer to project, so I  setup the new layaer meta-mylayer, I create the .bb .c and makefile.

Then I add the meta-mylayer path to  bblayers.conf.

Then  I  build fsl-image-auto, I test  it ,  the code about the layer does not work.

I search the question,  I need to add the layer to the image. I do not find hello.ko ,so I think it needs some steps, what should I do to add the layer to image?

I upload the meta-mylayer and build configuration.

 

Ada_Lovelace_0-1682327699440.png

Ada_Lovelace_1-1682327842357.png

 

 

0 Kudos
Reply
1 Solution
2,012 Views
Ada_Lovelace
Contributor IV

Hi,

I add my-mod into the fsl-image-auto.bb ,it works.

Ada_Lovelace_0-1683333783891.png

And it has  IMAGE_INSTALL += "openssl-misc  in it.

Ada_Lovelace_1-1683333836860.png

 

View solution in original post

0 Kudos
Reply
9 Replies
2,193 Views
nxf92355
NXP Employee
NXP Employee

Hi Ada Ma

Hope you are doing well.

I think this is yocto related. You can use external Linux Kernel Module for same. Please refer this link

https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/Incorporating-Out-of-Tree-Modules-in-YOC...

Hope this will help you

 

Thanks & Regards

Tushar

 

0 Kudos
Reply
2,181 Views
Ada_Lovelace
Contributor IV

HI, Tushar

I reference the link,and change the file:  .bb and local.conf, but it has problems.

I add IMAGE_INSTALL_append = "hello" to local.conf, the bitbake image, it reports errors.

I upload the .c .bb makefie and local.conf, please help me how to make it work.

Ada_Lovelace_0-1682411953949.png

Ada_Lovelace_1-1682412117839.png

 

0 Kudos
Reply
2,174 Views
nxf92355
NXP Employee
NXP Employee

Hi Ada Ma

I think in newer versions for yocto,  syntax may be changed. You can try

IMAGE_INSTALL:append instead of IMAGE_INSTALL_append

 

for more information for syntax please see your yocto version. i mean Honister , Hardknott , Gatesgarth , Dunfell , Zeus or else

if you dont know how to see, use below

vim $POKY-DIR/meta-poky/conf/distro/poky.conf

You will get info like:

DISTRO = "poky"
DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
DISTRO_VERSION = "2.7.2"
DISTRO_CODENAME = "warrior"
SDK_VENDOR = "-pokysdk"
SDK_VERSION = "${@d.getVar('DISTRO_VERSION').replace('snapshot-${DATE}', 'snapshot')}"
.....
.....

 and then search in yocto project reference manual of that version. you can find proper syntax

 

Regards ,

Tushar 

0 Kudos
Reply
2,140 Views
Ada_Lovelace
Contributor IV

Hi,Tushar 

I IMAGE_INSTALL:append instead of IMAGE_INSTALL_append , it also has errors.

Ada_Lovelace_0-1682469809878.pngAda_Lovelace_1-1682469848886.png

 

0 Kudos
Reply
2,130 Views
nxf92355
NXP Employee
NXP Employee

Hi Ada

Now you are getting error is different issue, it may not depend on I IMAGE_INSTALL:append.I am again saying this is yocto related issue. we recommends you to go with yocto community.

I have followed same link which i have shared with you. and i getting success to yocto build.and hello.ko is also built. below is my steps which i have followed

bitbake-layers create-layer ../sources/meta-mylayer
bitbake-layers add-layer ../sources/meta-mylayer
cd ../sources/meta-mylayer/
rm -rf recipes-example/
mkdir recipes-pmu
cd recipes-pmu/
cp -fvR ../../../sources/poky/meta-skeleton/recipes-kernel/hello-mod .
cd hello-mod/
mv hello-mod/ my-mod/
cd my-mod/
mv hello-mod_0.1.bb my-mod_0.1.bb
vi ../../../build_s32g274ardb2/conf/local.conf    ( Added IMAGE_INSTALL_append = " my-mod")
bitbake fsl-image-auto

yocto build sucess without any error

Screenshot from 2023-04-26 11-19-20.png

 

hello.ko

Screenshot from 2023-04-26 11-57-07.png

I think you may be missed some steps  from links. you can rebuild again with proper caution.

I have attached mylayer zip file . you can also compare it with yours.

 

Thanks & Regards,

Tushar

0 Kudos
Reply
2,112 Views
Ada_Lovelace
Contributor IV

Hi,Tushar

I copy your files and put in to ./source but it still has errors.

Ada_Lovelace_0-1682495030332.png

Ada_Lovelace_1-1682495056272.png

I compare the files , layer.conf  is different, others are same. Then I set up the new layer referencing your steps, it reports the same error.

Ada_Lovelace_2-1682495122792.png

I put the location in the picture, I do not know what it is wrong,please help me check it.

Ada_Lovelace_3-1682495199870.pngAda_Lovelace_4-1682495216153.pngAda_Lovelace_5-1682495230991.png

 

0 Kudos
Reply
2,084 Views
nxf92355
NXP Employee
NXP Employee

Hi Ada

 

One things may be with you.i am not sure .  Did you made any change in any file or any .bb file ?

The erro you are getting

Missing or unbuildable dependency chain was: ['fsl-image-auto', 'openssl-miscmy-mod']

means your image fsl-image-auto is depending/appending on openssl-miscmy-mod named package or .bb file. do you have any recipe file named as openssl-miscmy-mod ?  i think there are no any like named file. did you made any mistake in file at /bsp-auto/sources/meta-alb/recipes-fsl/images/fsl-image-auto.bb ?  i open that file and i am seen there package as named  openssl-misc

# Supporting complex evaluation scenarios
IMAGE_INSTALL += "openssl-misc"

did you change this ?

if you not finding then please search for openssl-miscmy-mod  as

~/bsp-auto/sources/meta-alb$ grep -nr openssl-miscmy-mod

you will find . open this and correct

Hope this will helps you

 

Thanks & Regards

Tushar

0 Kudos
Reply
2,013 Views
Ada_Lovelace
Contributor IV

Hi,

I add my-mod into the fsl-image-auto.bb ,it works.

Ada_Lovelace_0-1683333783891.png

And it has  IMAGE_INSTALL += "openssl-misc  in it.

Ada_Lovelace_1-1683333836860.png

 

0 Kudos
Reply
1,983 Views
nxf92355
NXP Employee
NXP Employee

Hi Ada

that's good problem has been solved. did you find root cause of issue for the error you was getting "Missing or unbuildable dependency chain was: ['fsl-image-auto', 'openssl-miscmy-mod']"  tell us the steps to regenerate that issue

i had tried to regenerate the issue as you was getting . but i was not getting issue like you have. commonly such type of issue is generated as i explain in my previous post . so that to regenerate issue i have replaced manually "openssl-miscmy-mod" instead of "openssl-misc" in fsl-image-auto.bb  as below

and i got gendered as same error as you was getting.

Screenshot from 2023-05-08 11-25-26.png

Screenshot from 2023-05-08 11-25-14.png

 

Thanks & regards ,

Tushar

0 Kudos
Reply