Where is the kernel source in build? - yocto

I build a yocto OS image, the image is done, but I can't find the kernel source.
I want to modify some files in the kernel source.
I see no any kernel source file in build/

i built for Yocto dunfell , core-image-minimal image for qemuarm machine
You can find kernel source in
build/tmp/work-shared/qemuarm/kernel-source

Related

Building custom Linux kernel in yocto build system

I am using BSP layer meta-ti in yocto build system with poky as distro. When i set the MACHINE variable as "beaglebone", the PREFERRED_PROVIDER_virtual/kernel is "linux-ti-staging" i.e the kernel source will be downloaded from SRC_URI present in recipe linux-ti-staging-version.bb.
I have written my own kernel recipe(my-custom-kernel-version.bb) where i have specified the SRC_URI pointing to different github path to defconfig for the custom kernel source. This recipe is present in meta-mylayer/recipes-kernel/linux/
I do want to do any kernel modification in yocto using bitbake -c menuconfig virtual/kernel.
How can i make bitbake to pickup up my-custom-kernel-version.bb
rather than the linux-ti-staging-version.bb to fetch the kernel source.
Inside your distribution file. You can simply add:
PREFERRED_PROVIDER_virtual/kernel = "my-custom-kernel-version"
Make sure that you have PROVIDES += "virtual/kernel" in your kernel recipe.

Android AOSP make kernel menuconfig

What is kernel 'make menuconfig' in android AOSP
I tried make kernel from AOSP. it could build kernel only.
But how about if I want to customize kernel config from menuconfig
Regards
Peter
There's a config.sh script for menuconfig in android kernel source.
Here's the step:
download android kernel source code
repo init -u https://android.googlesource.com/kernel/manifest -b BRANCH
repo sync
run menuconfig
BUILD_CONFIG=common/build.config.gki.aarch64 build/config.sh menuconfig
modify menuconfigs and save .config
build kernel
BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh
Reference: https://source.android.com/docs/setup/build/building-kernels
Building Android kernels for various devices is documented on source.android.com. It covers the Android Common Kernels as well as some widely used devices that can be built directly from AOSP. While there are no specific instructions for make menuconfig, it contains a section on how to customize the kernel build with specific kernel configuration options.
Such kernel options can of course be discovered through make menuconfig as usual.

Extracting particular executable from Yocto build files

I have a project that could be built with the Yocto build system to generate a full disk image. According to the existing procedure, I can get only a full disk image that should be flashed on SD card.
And this does not suit my needs because I can't flash the image on the board. In my case, I need to build a certain project (that currently has a recipe) to an executable. (This project currently is a part of the full disk that is built with Yocto)
So I am wondering, is it possible to extract this executable (and the libraries that this executable depends on) from Yocto build files, so that I could copy and install it on the board? Which possibilities do I have to do this? Do I have some quick and dirty way to do this?
P.S: I heard something about that Yocto can provide a package for a certain project, that could be installed by the corresponding package manager on the board. On the board installed dpkg package manager.
It's a solution to add tar.gz to your IMAGE_FSTYPE.
After building the image, you can extract the executable you were looking for from the created archive.
Or you add the output format you need for your target and install the full image.

Where can I find what drivers built in my yocto project Linux kernel image?

I'm using Yocto project to build a linux kernel image following these steps:
https://www.at91.com/linux4sam/bin/view/Linux4SAM/Sama5d27Som1EKMainPage
For some reasons I just want to reduce my Image size so I can flash it on QSPI 8 Mega octet memory. I have tried to reduce the size of my rootFS, I have removed some packages that I found in .manifest file and some Distro features. But I did not find how can I modify the kernel size which size is fixed ( 4.2 Mega octet ).
I think that when I can remove some drivers that I don't need the kernel size will be reduced.
I just want to know how can I find what drivers are built in my image and where can I find them ? and later how can I delete the ones that I don't need ?
Thank you.
if you check the .config file that was generated for your BSP, it will show what drivers (and other things) were built into your kernel (check for the 'y' on all the options).
Such file should be somewhere in:
tmp/work//linux-yocto//linux-*-build/.config
Sorry that I can't give you the exact location, but it literally depends on what BSP/MACHINE you are building for.
Also, if you want to modify such configuration, you can call:
$ bitbake -c menuconfig virtual/kernel
that will bring up the menuconfig ncurses interface, in which you can not only see what is installed but also modify what you need.

building the kernel for biackfin target

I'm trying to build a rootfs for an blackfin target, However I can't figure out how I configure the kernel that buildroot produces. The first run through came up with menuconfig, but it's cached the .config since then and I can't see where to change it.
regards
santhosh babu
You need to run make linux-menuconfig to ask Buildroot to start the menuconfig interface of the Linux kernel.