Questions tagged [kbuild]

kbuild is the build system used by the Linux kernel.

kbuild is a build framework based on GNU make and a standard set of cross platform tools. It was originally developed for the Linux Kernel, but is now used in other projects such as crosstool-ng, buildroot, ltib, etc.

kbuild is extremely powerful and tries to hide most of its complexity in templates so that the actual makefiles are relatively easy to understand and write. There are two distinct parts of kbuild; A set of tools and languages for describing configuration variables and Gnu make template code to drive the actual build process.

There are stock documentation for different topics,

The Gnu make harness for the Linux kernel is in the main Makefile and Kbuild.include. The tools for configuring variable (and processing the Kconfig language) are in a kconfig directory. Obviously other projects such as buildroot, and crosstool-ng use modified versions.

The two aspects are found in files within the kernel source. They are a Kconfig file defining variables that can be defined by the tools. The second portion is a Makefile, which uses the Kconfig output (usually .config) to guide the build process through normal Gnu make rules, templates and macros.

144 questions
1
vote
1 answer

Config u-boot for new board error because __LINUX_ARM_ARCH__

I try some set up config to load u-boot for a new board. My configuration is based on U-boot for Beagle Bone Black. I also follow some changes for new board on…
tandathuynh148
  • 190
  • 5
  • 15
1
vote
1 answer

U-Boot defconfig common configuration

I was in the middle of adding a new board to Yocto while I noticed that a lot of the configuration could be inherited from the previous hw revision. So I was wondering if there could be the possibility of including a common_defconfig in the…
garlix
  • 576
  • 9
  • 26
1
vote
0 answers

When will "make" prompt for user selection of Kconfig options when compiling linux kernel?

I am updating a config when upgrade my kernel version. I want a minimum change to the config file so that code reviewers don't take much time. There is a Kconfig entry as following for RETPOLINE: config RETPOLINE bool "Avoid speculative…
Simon Guo
  • 11
  • 1
1
vote
1 answer

U-boot 2018.09 : Getting list of compiled files and configuration options for SPL, U-boot

I am trying to study the execution flow of SPL and U-boot proper specifically for BeagleBone Black(am335x_boneblack_defconfig) by browsing through the source code. How can i generate the list of source files which gets compiled into U-boot…
SRK
  • 308
  • 3
  • 16
1
vote
2 answers

ccflag option in Makefile

I want to compile my c code (in kernel) which needs to include some header files from another directory. Instead of specifying the complete path to header files in c file, I would like to specify the include path in Makefile. My c file gets…
Udit Agarwal
  • 15
  • 1
  • 9
1
vote
0 answers

How use library at linux driver use linux source code tree to compile

I want to modify the wifi driver of Linux, because I want use ioctl and socket to change the channel. So first I use a library to implement those function and install it to linux with the header file in /usr/local/include/ folder. For normal…
1
vote
1 answer

Issues with using wildcard in Makefile while build .ko from objects across directory

I organized the kernel modules as different sub-component, so I can easily insert/remove existing sub-module to try or integrating stuff. The directory layout is shown as below: foo --+-- Makefile | +-- main.c | +-- include…
cyng93
  • 13
  • 3
1
vote
1 answer

kbuild external module questions

I am building an out-of-tree kernel module for a device driver. Overall, things are going well, but I had a few questions about using kbuild and the build system: I found this excellent post: Is it possible to set CFLAGS to a linux kernel module…
It'sPete
  • 5,083
  • 8
  • 39
  • 72
1
vote
1 answer

Kconfig and C enum

I have a multiple choice menu defined like this: menu "Audio" choice prompt "Select Audio Output" default I2S help This option selects the audio output. config AUDIO_OUTPUT_MODE_I2S bool "Generic I2S" config…
Michael Böckling
  • 7,341
  • 6
  • 55
  • 76
1
vote
2 answers

Why isn't my Kconfig entry appearing in menuconfig?

I have the following entry in drivers/media/video/Kconfig: config VIDEO_OMAP3 tristate "OMAP 3 Camera support" select VIDEOBUF_GEN select VIDEOBUF_DMA_SG select OMAP_IOMMU depends on VIDEO_V4L2 && ARCH_OMAP34XX ---help--- Driver for an OMAP…
Neil
  • 2,137
  • 16
  • 24
1
vote
2 answers

Getting kernel config from defconfig

The title says it all: I need the .config file that was used for compiling a kernel, but all I have is the defconfig file. I've seen instructions on how to produce the latter from the former, but not the other way around. Is it possible?
Jon Smark
  • 2,528
  • 24
  • 31
1
vote
2 answers

How to define a Linux kernel Kconfig item that must at least select one of its sub-options to make it work?

I am writing a kernel module that has two low-level options can be used. Both these 2 options can be select as M/Y/N, but at least one of them must be selected, else the module will not work. Just like below: [*] Enable FOO support …
Changbin Du
  • 501
  • 5
  • 11
1
vote
1 answer

How to add a board file to the Linux Kernel and where to find it on "make menu config"?

I need to add some board-specific code to a Linux kernel which I am building. (I know I should be using device-tree already, but the driver I'm inspired by doesn't and I'm already learning a dozen new things before breakfast. Adding device-tree…
fadedbee
  • 42,671
  • 44
  • 178
  • 308
1
vote
1 answer

how to create a linux kernel's .config like in cmake

I'm working on project that's going to have some feature that can be on / off depending on the customer. I know cmake has "option" syntax, but suppose I have several different projects that might have different features, how can I create a…
Billy Bob
  • 87
  • 7
1
vote
2 answers

Main file not compiling when compiling kernel module from multiple files

First I want to say that I have been searching for similar problems and what is the solution. And I found that it is: obj-m := module.o module-objs := extra.o But it dosen't work for me ... Here is the whole project…