Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to compile a custom kernel for Nvidia's Jetson TK1 board, and it seems that as well as the kernel itself (zImage) I will need /usr/src/linux-headers-{version} and /lib/modules/{version}.

However I can't see how to create the linux-headers. I have tried running make headers_install but it does not seem to create the same type of output as what I see in other /usr/src/linux-headers directories.

I've seen other similar questions such as here, however this assumes you are building the same version as you are running, where I am trying to build with a different LOCAL_VERSION.

I am starting from a "Linux4Tegra" distro, however, I am attempting to make a custom system based on Ubuntu Core.

To clarify, I am trying to create a kernel with my own LOCAL_VERSION, i.e., my own version, not an existing version in any repository. I would like to generate the headers that match this. So installing a linux-headers-xxx package will not address my problem.

My question is how are these packages initially created from the linux source?

When I look at the files in the existing headers directories, it contains references to that kernel version, so I am assuming that this has been generated from that version of the linux source. How can I generate these? When someone is compiling a version of the kernel, surely they generate these files somehow?

share|improve this question
    
add your distro to the post please – Rui F Ribeiro Mar 16 at 6:30
    
How does the output vary from what you'd normally see in /usr/src/linux-headers? – EightBitTony Mar 16 at 7:53
    
Not at my computer until tomorrow, but the output is basically completely different. No commonality whatsoever as far as I could see. – Alex Mar 16 at 8:39

Run sudo apt-get install linux-headers-generic

share|improve this answer
    
I am not sure this will work for me, as the headers I get are a different version again (matching neither my running kernel or of course my custom kernel version). Also, there are locations in the kernel headers that refer to the version, such as in include/config/kernel.release, so surely there is some way to generate these from an already configured source tree? – Alex Mar 16 at 6:42
    
You can try to run sudo apt-get install linux-headers-$(uname -r) to get headers of your current kernel version – Lev Bystritskiy Mar 17 at 0:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.