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_v220.127.116.11/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.
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 18.104.22.168 and 5.7 to learn more about how to use this tool.
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.
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.
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.
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, 22.214.171.124.
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_v126.96.36.199/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.
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.
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,
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.
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,