0

For a project I had to patch Linux kernel version 3.10.25+. I did it and it runs. The point is that I want to install headers too.

When I install the headers running:

$ make headers_install

it creates a folder where Makefile, Kbuild and Kconfig files are missing, and I can't figure out why.

I built the kernel downloading the source code from a github repo, and run make install, make modules_prepare, make modules and make modules_install.

phil91
  • 81
  • 3
  • 14
  • are you working with Ubuntu or Debian ? – Punit Vara Nov 30 '15 at 10:50
  • I am working with Ubuntu. – phil91 Nov 30 '15 at 10:55
  • **sudo apt-get install linux-headers-$(uname -r)** you can use this command to install header .Have you tried this? – Punit Vara Nov 30 '15 at 10:57
  • No, I didn't. My kernel patch do this: `cp pkt_sched.h include/uapi/linux/` , do you think I can use the command you've just suggested? @punitvara – phil91 Nov 30 '15 at 11:03
  • Yes of course. Excuse me but I do not think cp command is installing headers . Better you try what I have suggested you – Punit Vara Nov 30 '15 at 11:25
  • After I run `sudo apt-get update && sudo apt-cache search linux-headers` I don't have linux-headers-3.10.25 @punitvara – phil91 Nov 30 '15 at 11:41
  • `make headers_install` installs headers for being used by **user space programs**. Such usage doesn't require files `Makefile`, `Kbuild` and `Kconfig`. For build kernel modules you still need *source* header files, available through link `/lib/modules//build/include`. For more info see [documentation](https://www.kernel.org/doc/Documentation/kbuild/headers_install.txt) about this make's target. – Tsyvarev Nov 30 '15 at 12:05
  • In this folder `/lib/modules//` build is a link to the folder where I have kernel code. This is not what I expected because in this way I can't copy the modules folder to other machines. I built the kernel downloading the source code from a github repo, and running, `make install`, `make modules_prepare`, `make modules`, `make modules_install` @Tsyvarev – phil91 Nov 30 '15 at 14:24
  • I know this question is a little off-topic, but I'm wondering why the others linux header directories under `/usr/src` have that kind of files and the `build` file in `/lib/modules/$(uname -r)` is a link to `/usr/src/linux-headers-*`. @Tsyvarev – phil91 Nov 30 '15 at 14:35
  • 1
    Linux kernel's build system doesn't provide *distribution* functionality - its make *targets* are just for create correct **environment on target machine**. For *distribute* custom kernel, distro-specific tools are usually used. For Debian/Ubuntu you can use `fakeroot`. See. e.g., this [question](http://forums.debian.net/viewtopic.php?f=10&t=116677) on http://forums.debian.net. And that site, probably, is a better place for your question. – Tsyvarev Nov 30 '15 at 16:45
  • Your last comment is the answer I was waiting for. Thanks. @Tsyvarev – phil91 Nov 30 '15 at 18:13

0 Answers0