Skip to main content
typo fixes
Source Link
Faheem Mitha
  • 36.1k
  • 33
  • 129
  • 190

Header packages (what you installed) only contain the header part of the above (and not all of that - only the "exported" headers), and some of the build infrastructure. So what you are seeing is expected. Header packages do not contain C source code (except for some stubs and build infrastructure code). The whole point of having this type of package is to save space (and bandwidth) - the whilewhole Linux kernel source tree is rather large, and completely unnecessary if you don't intend to compile the kernel yourself. The header packages are buildbuilt and shipped by distributions to provide just the right things necessary to build modules, but no more. (They certainly do not contain the compiled kernel.)

Addressing your comment: header packages don't relocate anywhere. They are buildbuilt for specific versions of the kernel, packaged in a specific directory, and that's that. It's just a set ifof files. (Note that the header packages don't necessarily have the same version as the current stable kernel binary packages - the header packages are generic, and can lag behind the actual kernel you're running. They should not, however, be from a kernel version that is more recent than the current installed (or target) kernel.)

Full kernel source code: On Ubuntu, if you want the full kernel sources to build a kernel yourself, you should install followfollowing the instructions here.

Header packages (what you installed) only contain the header part of the above (and not all of that - only the "exported" headers), and some of the build infrastructure. So what you are seeing is expected. Header packages do not contain C source code (except for some stubs and build infrastructure code). The whole point of having this type of package is to save space (and bandwidth) - the while Linux kernel source tree is rather large, and completely unnecessary if you don't intend to compile the kernel yourself. The header packages are build and shipped by distributions to provide just the right things necessary to build modules, but no more. (They certainly do not contain the compiled kernel.)

Addressing your comment: header packages don't relocate anywhere. They are build for specific versions of the kernel, packaged in a specific directory, and that's that. It's just a set if files. (Note that the header packages don't necessarily have the same version as the current stable kernel binary packages - the header packages are generic, and can lag behind the actual kernel you're running. They should not, however, be from a kernel version that is more recent than the current installed (or target) kernel.)

Full kernel source code: On Ubuntu, if you want the full kernel sources to build a kernel yourself, you should install follow the instructions here.

Header packages (what you installed) only contain the header part of the above (and not all of that - only the "exported" headers), and some of the build infrastructure. So what you are seeing is expected. Header packages do not contain C source code (except for some stubs and build infrastructure code). The whole point of having this type of package is to save space (and bandwidth) - the whole Linux kernel source tree is rather large, and completely unnecessary if you don't intend to compile the kernel yourself. The header packages are built and shipped by distributions to provide just the right things necessary to build modules, but no more. (They certainly do not contain the compiled kernel.)

Addressing your comment: header packages don't relocate anywhere. They are built for specific versions of the kernel, packaged in a specific directory, and that's that. It's just a set of files. (Note that the header packages don't necessarily have the same version as the current stable kernel binary packages - the header packages are generic, and can lag behind the actual kernel you're running. They should not, however, be from a kernel version that is more recent than the current installed (or target) kernel.)

Full kernel source code: On Ubuntu, if you want the full kernel sources to build a kernel yourself, you should install following the instructions here.

deleted 77 characters in body
Source Link
Mat
  • 54.9k
  • 11
  • 164
  • 143

Full kernel source code: On Ubuntu, if you want the full kernel sources to build a kernel yourself, I believe you should install follow the linux-source package. (Seeinstructions here if you want to build a kernel yourself.) This will provide you with full source code.

Full kernel source code: On Ubuntu, if you want the full kernel sources, I believe you should install the linux-source package. (See here if you want to build a kernel yourself.) This will provide you with full source code.

Full kernel source code: On Ubuntu, if you want the full kernel sources to build a kernel yourself, you should install follow the instructions here.

added 1827 characters in body
Source Link
Mat
  • 54.9k
  • 11
  • 164
  • 143

You shouldn't expect to find binary files at all in a kernel source directory, except for build output. (If you configure and build a kernel yourself, the kernel source directory will also contain the compiled objects, modules, the built kernel itself and a few other binary bits and pieces that make it work.)
KConfig files are a description of the kernel configuration options (and their dependencies) that are available for a given directory/module.
Apart from that, it's all (mostly) C source code, header files and Makefiles. There are a few helper scripts here and there, and assembly source too.
Header packages

Header packages (what you installed) only contain the headerheader part of the above (and not all of that - only the "exported" headers), and some of the build infrastructure. So what you are seeing is expected. Header packages do not contain C source code (except for some stubs and build infrastructure code). The whole point of having this type of package is to save space (and bandwidth) - the while Linux kernel source tree is rather large, and completely unnecessary if you don't intend to compile the kernel yourself. The header packages are build and shipped by distributions to provide just the right things necessary to build modules, but no more. (They certainly do not contain the compiled kernel.)

Addressing your comment: header packages don't relocate anywhere. They are build for specific versions of the kernel, packaged in a specific directory, and that's that. It's just a set if files. (Note that the header packages don't necessarily have the same version as the current stable kernel binary packages - the header packages are generic, and can lag behind the actual kernel you're running. They should not, however, be from a kernel version that is more recent than the current installed (or target) kernel.)

Installed kernel binaries are usually installed in the /boot directory, along with bootloader binaries and configuration files. (This is sometimes an independent filesystem, not mounted by default.) The exact name of the files depends on the kernel and distribution. (So does the bootloader.)

Installed kernel modules reside in sub-directories of:

/lib/modules/`uname -r`/

So for instance on my system, they are currently in

/lib/modules/3.1.4-gentoo/

Full kernel source code: On Ubuntu, if you want the full kernel sources, I believe you should install the linux-kernel-develsource package. (See here if you want to build a kernel yourself.) This will provide you with full source code.

You could also download a source tarball from /usr/src/linuxkernel.org and unpack it somewhere (do not overwrite Ubuntu-installed files if you use this tarball, keep your personal stuff and the stuff managed by RPM separate).

/usr/src/linux is a traditional place to put kernel sources, but nothing prevents you from putting kernel sources elsewhere. This path is also often just a symbolic link to a directory. e.g. I have this on my machine:

You shouldn't expect to find binary files at all in a kernel source directory, except for build output. (If you configure and build a kernel yourself, the kernel source directory will also contain the compiled objects, modules, the built kernel itself and a few other binary bits and pieces that make it work.)
KConfig files are a description of the kernel configuration options (and their dependencies) that are available for a given directory/module.
Apart from that, it's all (mostly) C source code, header files and Makefiles. There are a few helper scripts here and there, and assembly source too.
Header packages only contain the header part of the above (and not all of that - only the "exported" headers), and some of the build infrastructure. So what you are seeing is expected.

On Ubuntu, if you want the full kernel sources, I believe you should install the linux-kernel-devel package. (See here if you want to build a kernel yourself.)

/usr/src/linux is a traditional place to put kernel sources, but nothing prevents you from putting kernel sources elsewhere. This path is also often just a symbolic link to a directory. e.g. I have this on my machine:

You shouldn't expect to find binary files at all in a kernel source directory, except for build output. (If you configure and build a kernel yourself, the kernel source directory will also contain the compiled objects, modules, the built kernel itself and a few other binary bits and pieces that make it work.)
KConfig files are a description of the kernel configuration options (and their dependencies) that are available for a given directory/module.
Apart from that, it's all (mostly) C source code, header files and Makefiles. There are a few helper scripts here and there, and assembly source too.

Header packages (what you installed) only contain the header part of the above (and not all of that - only the "exported" headers), and some of the build infrastructure. So what you are seeing is expected. Header packages do not contain C source code (except for some stubs and build infrastructure code). The whole point of having this type of package is to save space (and bandwidth) - the while Linux kernel source tree is rather large, and completely unnecessary if you don't intend to compile the kernel yourself. The header packages are build and shipped by distributions to provide just the right things necessary to build modules, but no more. (They certainly do not contain the compiled kernel.)

Addressing your comment: header packages don't relocate anywhere. They are build for specific versions of the kernel, packaged in a specific directory, and that's that. It's just a set if files. (Note that the header packages don't necessarily have the same version as the current stable kernel binary packages - the header packages are generic, and can lag behind the actual kernel you're running. They should not, however, be from a kernel version that is more recent than the current installed (or target) kernel.)

Installed kernel binaries are usually installed in the /boot directory, along with bootloader binaries and configuration files. (This is sometimes an independent filesystem, not mounted by default.) The exact name of the files depends on the kernel and distribution. (So does the bootloader.)

Installed kernel modules reside in sub-directories of:

/lib/modules/`uname -r`/

So for instance on my system, they are currently in

/lib/modules/3.1.4-gentoo/

Full kernel source code: On Ubuntu, if you want the full kernel sources, I believe you should install the linux-source package. (See here if you want to build a kernel yourself.) This will provide you with full source code.

You could also download a source tarball from kernel.org and unpack it somewhere (do not overwrite Ubuntu-installed files if you use this tarball, keep your personal stuff and the stuff managed by RPM separate).

/usr/src/linux is a traditional place to put kernel sources, but nothing prevents you from putting kernel sources elsewhere. This path is also often just a symbolic link to a directory. e.g. I have this on my machine:

Source Link
Mat
  • 54.9k
  • 11
  • 164
  • 143
Loading