kernel.xml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <sect1 id="ch-system-kernel-headers">
  2. <title>Installing Linux-&kernel-version; headers</title>
  3. <?dbhtml filename="kernel.html" dir="chapter06"?>
  4. <screen>&buildtime; &kernel-time-headers;
  5. &diskspace; &kernel-compsize-headers;</screen>
  6. <sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
  7. <sect2>
  8. <title>Installation of the kernel headers</title>
  9. <para>We won't be compiling a new kernel yet -- we'll do that when we have
  10. finished the installation of all the packages. But as some packages need the
  11. kernel header files, we're going to unpack the kernel archive now, set it up
  12. and copy the header files so they can be found by these packages.</para>
  13. <para>It is important to note that the files in the kernel source directory
  14. are not owned by <emphasis>root</emphasis>. Whenever you unpack a package as
  15. user <emphasis>root</emphasis> (like we do here inside chroot), the files end
  16. up having the user and group IDs of whatever they were on the packager's
  17. computer. This is usually not a
  18. problem for any other package you install because you remove the source
  19. tree after the installation. But the Linux kernel source tree is often kept
  20. around for a long time, so there's a chance that whatever user ID the packager
  21. used will be assigned to somebody on your machine and then that person would
  22. have write access to the kernel source.</para>
  23. <para>In light of this, you might want to run <userinput>chown -R 0:0</userinput>
  24. on the <filename>linux-&kernel-version;</filename> directory
  25. to ensure all files are owned by user <emphasis>root</emphasis>.</para>
  26. <para>Prepare for header installation:</para>
  27. <screen><userinput>make mrproper</userinput></screen>
  28. <para>This ensures that the kernel tree is absolutely clean. The kernel team
  29. recommends that this command be issued prior to <emphasis>each</emphasis> kernel
  30. compilation. You shouldn't rely on the source tree being clean after
  31. untarring.</para>
  32. <para>Create the <filename>include/linux/version.h</filename> file:</para>
  33. <screen><userinput>make include/linux/version.h</userinput></screen>
  34. <para>Create the platform-specific <filename>include/asm</filename>
  35. symlink:</para>
  36. <screen><userinput>make symlinks</userinput></screen>
  37. <para>Install the platform specific-header files:</para>
  38. <screen><userinput>cp -HR include/asm /usr/include
  39. cp -R include/asm-generic /usr/include</userinput></screen>
  40. <para>Install the cross-platform kernel header files:</para>
  41. <screen><userinput>cp -R include/linux /usr/include</userinput></screen>
  42. <para>There are a few kernel header files which make use of the
  43. <filename>autoconf.h</filename> header file. Since we do not yet configure the
  44. kernel, we need to create this file ourselves in order to avoid compilation
  45. failures. Create an empty <filename>autoconf.h</filename> file:</para>
  46. <screen><userinput>touch /usr/include/linux/autoconf.h</userinput></screen>
  47. </sect2>
  48. &c6-kernel-exp-headers;
  49. </sect1>