I am trying to build a custom Linux kernel using Buildroot. I have to do it because I later want to use the generated kernel image and rootfs with the Jailhouse hypervisor. I am using the following kernel source downloaded from here
https://github.com/siemens/linux/tree/jailhouse-enabling/5.15-rt
I am using Buildroot to generate the kernel image and rootfs as I need a very small size kernel to be used with the hypervisor. I am doing the following steps when using Buildroot.
make menuconfig
-> I use the menu to create a sample .config file. I adapt this minimal .config file to specify my kernel source location and the location of .config file using the kernel options in the menu. That part of the resulting .config file is shown below
> BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="file:///home/madox/Downloads/linux-jailhouse-enabling-5.15-rt.tar.gz"
> BR2_LINUX_KERNEL_VERSION="custom" BR2_LINUX_KERNEL_PATCH=""
> # BR2_LINUX_KERNEL_USE_DEFCONFIG is not set
> # BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG is not set BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
> BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="/home/madox/Downloads/linux-jailhouse-enabling-5.15-rt/.config" BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES=""
However, I am getting the following errors when i use make
after setting up the configurations.
>> linux custom Extracting
gzip -d -c /home/madox/Downloads/buildroot/dl/linux/linux-jailhouse-enabling-5.15-rt.tar.gz | tar --strip-components=1 -C /home/madox/Downloads/buildroot/output/build/linux-custom -xf -
>>> linux custom Patching
for p in ; do if test -d $p ; then PATH=/home/madox/Downloads/buildroot/output/host/bin:$PATH support/scripts/apply-patches.sh /home/madox/Downloads/buildroot/output/build/linux-custom $p *.patch || exit 1 ; else PATH=/home/madox/Downloads/buildroot/output/host/bin:$PATH support/scripts/apply-patches.sh /home/madox/Downloads/buildroot/output/build/linux-custom `dirname $p` `basename $p` || exit 1; fi done
make[2]: *** No rule to make target 'defconfig'. Stop.
make[1]: *** [linux/linux.mk:647: /home/madox/Downloads/buildroot/output/build/linux-custom/.stamp_dotconfig] Error 2
I would like to use a custom .config file to compile the kernel and that is the path I am specifying in BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE
. But it seems this is not the purpose of this field. Also, I am not using any patches as this kernel source already has everything I need but I am not able to disable the patch field (it is left empty).
Anyone can help me what I am doing wrong?
I just need a simple way to build my kernel using Buildroot using my .config file. or even if it is possible to build the kernel with some default configuration that generates a minimal size kernel it would also be fine.