Buildroot - Kernel configuration with Xenomai patch - linux

I'm trying to use a Raspberry Pi board with the images generated by
Buildroot. I'm using the raspberrypi_defconfig configuration, as suggested here, in order to generate the rootfs, the kernel image and all files required to boot the system.
The problem
In order to build a Real Time system I need to apply the Xenomai kernel patch available for kernels 3.5.7, 3.10.32 and 3.14. The list of availables Xenomai patches can be found here. Here are the changes I made in the graphical configuration tool:
Toolchain -> Kernel headers (Manually specified Linux version) -> 3.5.7
Kernel -> Kernel version (custom) -> 3.5.7 as Kernel version
Kernel -> Kernel configutation (Using a defconfig) -> (bcmrpi_quick)
Kernel -> Linux Kernel Extentions -> [*] Adeos/Xenomai Real-time patch
Kernel -> Linux Kernel Extentions -> Path for Adeos patch file (the Relative path to the correct patch)
After the make command I get the following error. Buildroot couldn't find the config file
/buildroot-2013.11/output/build/linux-3.5.7/arch/arm/configs/bcmrpi_quick_defconfig’: No such file or directory
Which defconfig name should I use in the Kernel -> Defconfig name field?
I will appreciate your help with this situation.

Related

How to build a linux kernel with -generic suffix?

I'm trying to build linux kernel for arm64 using buildroot. All my builds end without -generic suffix (uname -r ) but when I checked official ubuntu kernel they end with -generic. I searched buildroot manual etc. but I couldn't find related information.
So how can I build a generic kernel ?
This additional -generic string is not very important, it's just a free form string that you can append to the kernel version. This free form string is specified in the kernel configuration, with the CONFIG_LOCALVERSION option.

How to get kernel version without running it (Get ARM kernel version on an AMD64 Linux)

I need to know the version of a kernel file without running it. Therefore, the following questions arise in this realm:
Is it possible to get the kernel version in the u-boot environment? I mean before running the kernel I want to get the version of my kernel file.
Suppose I am running ubuntu on my amd64 processor and I have a zImage file which is cross compiled for ARM processor. Therefore I can not run this zImage file on amd64. Then how can I get version of this zImage file without running it on an ARM processor? I checked out uname manual but it does not accept a file as argument. I also issued readelf -V on a vmlinux kernel file, but it was an unsuccessful attempt.

How to extract the config from a kernel image file when CONFIG_IKCONFIG is set as a module (=m)?

How do I extract the kernel configuration from a kernel image file?
The kernel image file type is:
/boot/kernel7.img: Linux kernel ARM boot executable zImage (little-endian)
The kernel has been compiled with CONFIG_IKCONFIG enabled. However,
scripts/extract-ikconfig /boot/kernel7.img
returns
extract-ikconfig: Cannot find kernel config.
Note: I am trying the get the config without booting the kernel.
If the kernel has been compiled with CONFIG_IKCONFIG=m (note the m), the configuration in stored in a module (configs.ko) and not in the kernel itself. That's the reason why running extract-ikconfig on the kernel image fails.
In this case, we can extract the config from the configuration module:
/usr/src/$(uname -r)/scripts/extract-ikconfig \
/lib/modules/$(uname -r)/kernel/kernel/configs.ko

How to setup a pre-emptive real time kernel in Yocto for a evalboard(which has a preset kernel from the manufacturer)?

I like to play around with a pre-emptive linux kernel and Yocto.
As hardware the SAMA5D3x Evalboard + SAMA5D35-CM module is used.
Atmel is providing a meta-atmel layer, which includes the "at91-linux_*.bb" recipe. This recipe builds the kernel for the SAMA5D3x machines.
For using the realtime kernel I should insert the realtime patches and activate them at the kernel config.
I did not found a tutorial how to do this with an existing kernel. My question is:
How/where to modify a given kernel recipe to make it a realtime kernel(preempt-rt)?
My test project is located at the
project dir "/home/user/yocto". It has following content:
"/yocto git clone" ==> Yocto system
"/meta-openembedded" ==> meta embedded recipes
"/meta-atmel" ==> atmels yocto layer
"/meta-atmel/recipes-kernel/linux/linux-at91_4.4.bb" ==> the kernel recipe
"/meta-atmel/conf/machine/sama5d3xek.conf" ==> the machine that run the kernel
"/myTest" ==> my test project
"/myTest/recipes-kernel/linux-at91_%.bbappend" ==> replace the kernel config + add own device tree
"/myTest/recipes-kernel/linux/linux-at91/sama5d3xek/defconfig" ==> my own kernel config
/myTest/recipes-kernel/linux/linux-at91/sama5d3xek/myDev.dts ==> my own device tree
Any ideas/tutorials how to manage to activate the RT-Kernel in Yocto?
In general:
in .../source/poky/recipes-kernel/linux you should find a linux-yocto-rt_X.XX.bb recipe to compile a full preemptive RT kernel.
For meta-atmel you should do:
Download the correct RT patch for your kernel version and apply it using a .bbappend file to your current linux kernel recipe. You could find the patch HERE
Add the patch to your bbappend file (stored in your own layer in the one of accepted direcotries). p.e.: SRC_URI += "file://0001-linux-rt.patch"
Activate preemptive kernel. Manually set CONFIG_PREEMPT=y at defconfig at your layer. Alternativly you can use bitbake virtual/kernel -c menuconfig
Pitfalls at meta-atmel:
the linux-at91_4.4.bb recipe does not care about patch and sublevel of the kernel (p.e. 4.4.66 -> ..). if there is a new version at at91-linux it will go after some time to the meta-atmel layer.
the RT branch of the linux kernel is not provided for every new sublevel
this means constant breaks of your own meta-layer

Recompile Linux kernel (with Xen) config flags not being used

I am trying to compile the linux kernel (3.0.0-13) with the Xen dom0 config flags which are not exposed via menuconfig. (Yes, I know that ubuntu provides a 'virtual' flavoured kernel that supports Xen paravirtualization, but that kernel does not seem to boot on my hardware. So, I am trying to compile the 'generic' flavoured ubuntu kernel with the extra Xen config flags since I know that the 'generic' flavour runs on my hardware). Every time that I try to compile my config flags are ignored based on the .config file that is generated and packaged with my kernel binary.
I have tried the following the following:
Downloaded the kernel source using apt-get source linux-image
I have then followed all of the steps from this guide: How to compile a new Ubuntu 11.10 (Oneiric) kernel and performed the following extra steps:
put my own config flags in the config.flavour.xxx file then compiled the linux-image package
Paused the 'debian/rules editconfigs' command immediately after the it runs 'menuconfig' and replaced the build/.config file with my custom .config file then compiled the linux-image package
I have also used the following howto How To Compile A Kernel - The Ubuntu Way and run the following commands on kernel source code that I already had:
edit the .config file to have my config flags
run 'make oldconfig'
run 'make-kpkg clean && fakeroot make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers'
After every time I have compiled the kernel I have installed the newly compiled linux-image package and have discovered that my config flags are not in the /boot/config-xxx file as I expect.
What am I doing wrong to cause my config flags to be ignored?
What can I do to make sure that my kernel config flags are used when compiling?
Is there some other option than recompiling the kernel to get a Xen dom0 kernel that work for my hardware?
For question 3: Is there another way to get a xen dom0 kernel for my hardware?
Yes.
Although all of the xen documentation says that all stock kernel support xen dom0, what they mean is that the source for all stock kernels now support xen dom0 but that support is turned off in their precompiled binaries.
On debian there is the following package which is a prebuilt linux kernel with the xen dom0 support turned on. Package: linux-image-xen-686
For anyone else who is really looking to compile their own xen dom0 kernel the following site has a good guide: Compiling a Xen Dom0 Kernel for Ubuntu Jaunty
What am I doing wrong to cause my config flags to be ignored?
The root of the issue lies in the first portion of your problem; the Xen dom0 config flags are not exposed via menuconfig
Simply setting them in the .config doesn't mean they'll be activated. You have to consider the dependencies for the config options.
From the linux 3.0 tag at github: https://github.com/torvalds/linux/blob/02f8c6aee8df3cdc935e9bdd4f2d020306035dbe/arch/x86/xen/Kconfig
config XEN_DOM0
def_bool y
depends on XEN && PCI_XEN && SWIOTLB_XEN
depends on X86_LOCAL_APIC && X86_IO_APIC && ACPI && PCI
Are all these depends flags met?
What can I do to make sure that my kernel config flags are used when compiling?
In the beginning stages of the kernel compile process, the .config file is re-written if there are any discrepancies. A good test to make sure your edits will persist is checking if they still exist in your .config file after doing a make menuconfig and saving changes. If after that your flags are still there, you can be sure that your flags are being used.
Is there some other option than recompiling the kernel to get a Xen dom0 kernel that work for my hardware?
Not unless another distribution ships with XEN_DOM0 enabled.

Resources