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

Proper feature checks for kernel module source code

Scenario 1: I'm trying to install IBM GPFS driver onto RHEL6 with a vanilla kernel 3.10 (actually, kernel-lt from Elrepo). The GPL part won't compile due to: Too many/too few arguments passed to function struct x has no such member type…
basin
  • 3,949
  • 2
  • 27
  • 63
1
vote
1 answer

Makefile pass define at compile time?

I am trying to pass a "define variable called DEBUG" at compile time for a kernel module. i.e provide the same functionality as DEBUG does below, but in a Makefile for a kernel module. gcc -o foo -DDEBUG=1 foo.c Can anyone give me a hint on how…
Henrik
  • 405
  • 1
  • 8
  • 19
1
vote
0 answers

How to identify .config or menuconfig entry for a given kernel source code file

During compilation of an out of tree driver for a PCIe device (avc8000nano) under Linux Yocto (fsl-community-image, imx6qsabresd, core-image-kernel-dev) I get the following warning messages, which later prohibit to load the driver: WARNING:…
R.Buechner
  • 11
  • 1
1
vote
1 answer

How do I build just the directory containing my updated source code

I successfully created an image for Samsung Note 3 by downloading the source from Samsung and AOSP and running make as instructed in the README file. But now I want to modify a device driver, and see the result in the image. This means I really do…
user3326293
  • 817
  • 1
  • 14
  • 37
1
vote
1 answer

linux kconfig command line interface

My goal is to change kbuild configs using the command line without messing up dependencies. For this I've created a 'reference' config by editing my default .config with make menuconfig. The 'only' thing I've changed was changing from 64 bit to 32…
Uroc327
  • 1,379
  • 2
  • 10
  • 28
1
vote
0 answers

Adding Linux module: Can't do "make menuconfig"

I'm trying to install a Linux external kernel module. I've unpacked the full source tarball: there are source codes (.c), Kconfig, and Makefile. While adding options to .config with make menuconfig, I got make: *** No rule to make target…
qweeah
  • 199
  • 2
  • 10
1
vote
1 answer

depstree.NamespaceNotFoundError: Namespace [name here changes every build] never provided

I am trying to build a really nice MIT licensed html5 billiards game. http://www.agent8ball.com Which is reliant on kbuild: github.com/kevmoo/kbuild To build this google closure app. Kbuild is reliant on brew, and I am on linux so I am using…
user2672957
1
vote
1 answer

Compiling Linux Kernel Module With A Custom Header

I would like to compile a simple character device module depending on a custom header. The folder is thus organized, + mymod.c | customized-header.h | customized-header.c | Makefile In mymod.c, the header is thus used, #include…
MeadowMuffins
  • 507
  • 1
  • 5
  • 20
1
vote
3 answers

SystemTap failed with error "WARNING: kbuild exited with status: 2"

I built a custom kernel 3.2-41, required kernel-debuginfo-common and kernel-debuginfo packages. I installed these packages on CentOS System with kernel 2.6.32-358. System booted fine with new kernel. I ran stap to list system calls and kernel…
1
vote
2 answers

Kconfig choice: non-selected choices shown as new

I have the following Kconfig code: choice prompt "Choice ?" config A_CHOSEN bool "A" config B_CHOSEN bool "B" endchoice My problem, everytime i run make oldconfig it says: * * Restart config... * Choice ? > 1. A…
arved
  • 4,401
  • 4
  • 30
  • 53
0
votes
1 answer

Object file addressing in Linux Makefile

I am writing a simple device driver in Linux. In the makefile we normally write first line as obj-m += hello.o where hello is the module written. I have seen in other makefiles the symbol += being replaced by := and some others. What is…
elyon
  • 9
  • 2
0
votes
0 answers

Is there a method to generate compilation database in a Yocto Bitbake Project?

This is a complex Yocto & Bitbake Project. I need to build it use bitbake command, like bitbake xx-kernel. And the xx-kernel project looks like the linux kernel, using kbuild, make toolchains for building. How can I generate compilation database? I…
0
votes
0 answers

Compiling external firmware into kernel with CONFIG_EXTRA_FIRMWARE - Make failing with "No rule to make target"

I have some pre-compiled firmware blobs, including foo.bin, that I'd like to have included in the kernel binary that I'm compiling so it can be accessed in early boot. I've included "foo.bin" in CONFIG_EXTRA_FIRMWARE, but when I set…
thisisbenmanley
  • 386
  • 2
  • 9
0
votes
1 answer

where should linux kernel modules install headers

I have an out of tree linux kernel module that has a public header. This header is intended to be shared with other modules, as it declares exported functions of the module, and not with userspace. where should my module install this headers? that…
eddy
  • 488
  • 5
  • 18
0
votes
0 answers

How to build a platform drivers into a kernel module with yocto?

The goal is to put an existing (in-source kernel) device driver into an external kernel module. The device driver is put together into a struct platform_driver instance, then is registered with module_platform_driver() macro. The macro is supposed…