I don't know if you already have checked these links, but it could be helpful:
http://www.malinov.com/Home/sergey-s-blog/intelgalileo-buildinglinuximage > In this one you could check the changes made in the image and the configuration of the kernel after that.
Thanks for the links. I have built Sergey's image before, so I understand his method for adding patches and then compiling. I've also looked at the BSP and based on what I can find, it points to making menuconfig changes, which I describe below.
I should also correct myself and say that I can get menuconfig changes to compile in using the following commands on a build directory where I've already compiled a full SD image before (Note: I'm using the IoT DevKit now):
bitbake linux-yocto-quark -c menuconfig
bitbake iot-devkit-prof-dev-image (or whatever your image is)
My issue is once I compile a full image, say I want to either add a patch file or edit the kernel source. Once I edit a file, I want to run a command that will rebuild the kernel with my changes without rebuilding my whole image.
The Yocto guide briefly mentions this in Section 188.8.131.52 of the link you provided:
Rebuild the kernel image with your changes: Rebuilding the kernel image applies your changes.
The first question is, what is the command used to rebuild the kernel image?
Also, I'm currently editing kernel files in meta-intel-iot-devkit/build/tmp/work/quark-poky-linux/linux-yocto-quark/3.8-r0/linux before I rebuild.
Is that the correct kernel source directory to edit files?
I believe I tried that before, but just to be safe I went through the procedure again. With a fully built image, I went back to the build/ directory and did the following:
- bitbake -c cleansstate linux-yocto-quark
- bitbake -c menuconfig linux-yocto-quark
- Edited config, saved
- Edited a kernel source .c file, adding a printk() to a location I know would show up at boot
- bitbake iot-devkit-prof-dev-image
I copied the resulting files to SD (only bzImage was modified) and booted.
The result: I did not find my printk() statement at boot, so it appears that my source change didn't get wrapped into the updated kernel.
I gave that a shot, but no luck. I also tried to edit the kernel source .c file in meta-intel-iot-devkit/build/tmp/work/quark-poky-linux/linux-yocto-quark/3.8-r0/linux-quark-standard-build instead of meta-intel-iot-devkit/build/tmp/work/quark-poky-linux/linux-yocto-quark/3.8-r0/linux with no luck.
Have you tried editing the local.conf file? You can use BB_NUMBER_THREADS and PARALLEL_MAKE twice your host processor's number of cores. Take a look in the section Configuring the local.conf File in this link
To rebuild the kernel (and just the kernel) after updating the config or anything in the sources, you better run
bitbake -f -c deploy linux-yocto-clanton
to compile the kernel and put it into tmp/deploy/image.
Put the actual kernel recipe name if you're using other BSP than the standard one (i.e. DevKit's one would be called differently as I can see from the paths you've posted, I haven't tried this one myself).
Cleaning sstate or rebuilding the whole image is redundant here and just cause more work (and delay) than necessary.
You can find additional hints regarding the kernel development cycle recommended by Yocto team here:
1 of 1 people found this helpful
Thanks Alex! After trying the deploy command, I was still missing something, so I took a look at the Yocto link you provided and after following the instructions, I got it to work!
Here are instructions for manual source editing that worked for me:
- bitbake linux-yocto-quark -c kernel_configme -f
- bitbake linux-yocto-quark -c menuconfig
- Make any menuconfig changes and save
- Edit a kernel source .c file, adding a printk() to a location I know would show up at boot
- bitbake -f linux-yocto-quark (edited per Alex's comments below)
- bitbake iot-devkit-prof-dev-image (or whatever your image is)
I was able to copy the new image to my SD, boot and see my printk() in the dmesg output:
[ 4.285756] MATT WAS HERE!
Thanks guys, looks like I'm all set!
1 of 1 people found this helpful
If you don't need to execute the steps iteratively, then you can compress these three commands
- bitbake linux-yocto-quark -c compile -f
- bitbake linux-yocto-quark -c deploy
- bitbake linux-yocto-quark
into just one
bitbake -f linux-yocto-quark
That will do compile, deploy and IPK package creation and "-f" is to make sure it disregards the sstate cache and actually does that.