kernelheaders.xml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <sect1 id="ch05-kernel-headers">
  2. <title>Installing Linux-&kernel-version; headers</title>
  3. <?dbhtml filename="kernel-headers.html" dir="chapter05"?>
  4. <screen>Estimated build time: &kernel-time-headers;
  5. Estimated required disk space: &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>As some packages need to refer to the kernel header files, we're going
  10. to unpack the kernel archive now, set it up, and copy the required files to a
  11. place where <userinput>gcc</userinput> can later find them.</para>
  12. <para>Prepare for the header installation with:</para>
  13. <screen><userinput>make mrproper</userinput></screen>
  14. <para>This ensures that the kernel tree is absolutely clean. The kernel team
  15. recommends that this command be issued prior to <emphasis>each</emphasis> kernel
  16. compilation. You shouldn't rely on the source tree being clean after
  17. untarring.</para>
  18. <para>Create the <filename>include/linux/version.h</filename> file:</para>
  19. <screen><userinput>make include/linux/version.h</userinput></screen>
  20. <para>Create the platform-specific <filename>include/asm</filename>
  21. symlink:</para>
  22. <screen><userinput>make symlinks</userinput></screen>
  23. <para>Install the platform-specific header files:</para>
  24. <screen><userinput>mkdir /tools/include/asm
  25. cp include/asm/* /tools/include/asm
  26. cp -R include/asm-generic /tools/include</userinput></screen>
  27. <para>Install the cross-platform kernel header files:</para>
  28. <screen><userinput>cp -R include/linux /tools/include</userinput></screen>
  29. <para>There are a few kernel header files which make use of the
  30. <filename>autoconf.h</filename> header file. Since we do not yet configure the
  31. kernel, we need to create this file ourselves in order to avoid compilation
  32. failures. Create an empty <filename>autoconf.h</filename> file:</para>
  33. <screen><userinput>touch /tools/include/linux/autoconf.h</userinput></screen>
  34. </sect2>
  35. </sect1>