- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi AU_yzy0050,
Could please send us an example of how the messages you'd like to include would look like?
-Peter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi, Peter
Thanks for your effort.
I'm looking forward to what you will find.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi AU_yzy0050,
We are still working on this. We'll try to update you as soon as possible.
-Peter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I appreciate your effort, Peter.
Meanwhile, I am studying it by myself.
I will also update whatever I find.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page