Community
cancel
Showing results for 
Search instead for 
Did you mean: 
YYan8
New Contributor I
1,460 Views

Galileo Gen 2 kernel development

Hi, guys,

I'm new to this board and Yocto.

I'm trying to make modifications for the kernel and compile it.

What is the kernel source code directory? And how can I compile new code into a new image, still bitbake image-full?

Say for example, I modified the source code in the directory of ./meta-clanton_v1.2.1.1/yocto_build/tmp/work/i586-poky-linux/linux-libc-headers/3.16-r0/linux-3.16, and then I recompiled with command bitbake image-full. It did not work.

Currently, I don't need to make a patch. I just want to add a printk there, and see how it works.

Thank you.

14 Replies
idata
Community Manager
89 Views

Hello AU_yzy0050,

 

 

You are on the right track, you are following the latest Quark X1000 BSP and already working on the image. In order to make modifications to the image, there are two main methods. You can modify the recipes manually (those are the .bb files) or you can use menuconfig.

 

 

Of those two I believe the most convenient is menuconfig. I suggest you to read Yocto's Mega Manual ( http://www.yoctoproject.org/docs/1.7.2/mega-manual/mega-manual.html) in section 4.1.2.2 and 5.7 to learn more about how to use this tool.

 

 

-Peter.
YYan8
New Contributor I
89 Views

Hi, Peter,

Thanks for your reply.

I did menucinfig. It cannot change any source codes, like I want to add a printk message in the kernel.

Can recipes do it, source code modification? Or other simple ways?

Thank you very much.

idata
Community Manager
89 Views

What exactly do you want to achieve? I don't have a clear idea about that. Why do you need to modify the kernel? Is there any possibility of making the changes you require on the image? I mean, like installing the printk package from source.

 

 

-Peter.
YYan8
New Contributor I
89 Views

Hi, Peter,

Let me clarify.

I need to modify a driver in the kernel. Codes have been tested in other platforms. What I need to do is to make the exact same changes, most of which are printing messages in the kernel.

Now, I'm not sure how to make it work, i.e., where is the kernel source code in the environment and how I can compile the new kernel.

Hopefully, this is clear for you.

Thanks.

idata
Community Manager
89 Views

Hi AU_yzy0050,

 

 

Could please send us an example of how the messages you'd like to include would look like?

 

 

-Peter.
YYan8
New Contributor I
89 Views

Hi, Peter,

In the file, ./drivers/net/wireless/ath/ath9k/main.c, I will add a printk message,

+ printk("INT_TX %llu\n", (long long) tsf);

This is one of files, and one of many modifications.

I simply want to add these lines in the source code and then compile the image.

I followed the instruction from Yocto Project Development Manual, 4.1.2.2.

It says,

Establish the temporary kernel source files: Temporary kernel source files are kept in the http://www.yoctoproject.org/docs/1.6.1/dev-manual/dev-manual.html# build-directory Build Directory created by the OpenEmbedded build system when you run BitBake.

Rebuild the kernel image with your changes: Rebuilding the kernel image applies your changes.

The source code for Galileo, I think, is located in ./meta-clanton_v1.2.1.1/yocto_build/tmp/work/i586-poky-linux/linux-libc-headers/3.16-r0/linux-3.16, which was mentioned in my initial post. And then I do bitbake image-full, but the modification does work.

idata
Community Manager
89 Views

I understand... thank you for the clarification. I haven't done something like this before, but let me check it to see if I'm able to find something useful for you. If I'm able to find anything useful I'll post it here.

 

 

-Peter.
YYan8
New Contributor I
89 Views

Hi, Peter

Thanks for your effort.

I'm looking forward to what you will find.

YYan8
New Contributor I
89 Views

Hi, Peter,

Do you have any updates so far?

Thanks.

idata
Community Manager
89 Views

Hi AU_yzy0050,

 

 

We are still working on this. We'll try to update you as soon as possible.

 

 

-Peter.
YYan8
New Contributor I
89 Views

I appreciate your effort, Peter.

Meanwhile, I am studying it by myself.

I will also update whatever I find.

Padraig_C_Intel
Employee
89 Views

Hi AU_yzy0050,

The other day I was adding an i2c driver to the Intel Yocto kernel, which qualifies for modifying the kernel. I am guessing this is similar to what you want to do...

To do this put in the following commands:

1. bitbake –c devshell linux-yocto-quark

Now make your modifications to the kernel then:

2. bitbake –c compile linux-yocto-quark -f

3. bitbake linux-yocto-quark

4. bitbake image-full

Hope this helps,

Padraig

YYan8
New Contributor I
89 Views

Hi, Padraigc,

Thank you very much for your reply.

It should work. I just only changed version number to test your commands, and it worked. I will work on driver modification tomorrow.

Thank you again, it saves me a lot of time.

Well, I'm wondering where you got these stuffs. I want to get the link, and learn as much as possible.

Padraig_C_Intel
Employee
89 Views

Hi AU_yzy0050,

No problem, its great to help others out with the way people help me.

I'm afraid I don't have a specific link, I was helped with this problem by a colleague of mine, but I'm sure the Open Embedded Wiki will have something on it, as Bitbake is part of Open Embedded.

Glad to help,

Padraig

Reply