[a9e389d] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?> |
---|
[bd48e48] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ |
---|
[a9e389d] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent"> |
---|
| 5 | %general-entities; |
---|
| 6 | ]> |
---|
| 7 | |
---|
| 8 | <sect1 id="ch-bootable-kernel" role="wrap"> |
---|
| 9 | <?dbhtml filename="kernel.html"?> |
---|
| 10 | |
---|
| 11 | <title>Linux-&linux-version;</title> |
---|
| 12 | |
---|
| 13 | <indexterm zone="ch-bootable-kernel"> |
---|
| 14 | <primary sortas="a-Linux">Linux</primary> |
---|
| 15 | </indexterm> |
---|
| 16 | |
---|
| 17 | <sect2 role="package"><title/> |
---|
| 18 | <para>The Linux package contains the Linux kernel.</para> |
---|
| 19 | |
---|
| 20 | </sect2> |
---|
| 21 | |
---|
| 22 | <sect2 role="installation"> |
---|
| 23 | <title>Installation of the kernel</title> |
---|
| 24 | |
---|
| 25 | <para os="a">Building the kernel involves a few steps—configuration, |
---|
| 26 | compilation, and installation. Read the <filename>README</filename> |
---|
| 27 | file in the kernel source tree for alternative methods to the way this |
---|
| 28 | book configures the kernel.</para> |
---|
| 29 | |
---|
| 30 | <para os="b">Prepare for compilation by running the following command:</para> |
---|
| 31 | |
---|
| 32 | <screen os="c"><userinput>make mrproper</userinput></screen> |
---|
| 33 | |
---|
| 34 | <para os="d">This ensures that the kernel tree is absolutely clean. The |
---|
| 35 | kernel team recommends that this command be issued prior to each |
---|
| 36 | kernel compilation. Do not rely on the source tree being clean after |
---|
| 37 | un-tarring.</para> |
---|
| 38 | |
---|
[d4c0817] | 39 | <para os="e">Configure the kernel via a menu-driven interface. Be sure to |
---|
| 40 | enable DEVTMPFS so that <filename class="directory">/dev</filename> will |
---|
| 41 | be populated automatically.</para> |
---|
| 42 | |
---|
| 43 | <note os="f"><para>Since you are building for an embedded system make sure |
---|
| 44 | all key components are built into the kernel and not as modules. The key |
---|
[06c81a1] | 45 | components are console/video, disk, and network. Without these built |
---|
[d4c0817] | 46 | in, the system will not function properly. It is recommended to |
---|
| 47 | configure the kernel without modules in order to conserve disk space |
---|
[209f20d] | 48 | and to reduce the complexity of booting.</para></note> |
---|
[a9e389d] | 49 | |
---|
[6a3c6dc] | 50 | <screen os="g"><userinput>make ARCH=${CLFS_ARCH} CROSS_COMPILE=${CLFS_TARGET}- menuconfig</userinput></screen> |
---|
[a9e389d] | 51 | |
---|
[d4c0817] | 52 | <para os="h">Alternatively, the <command>make oldconfig</command> or |
---|
| 53 | <command>make <replaceable>${CLFS_TARGET}</replaceable>_defconfig</command> |
---|
| 54 | may be more appropriate in some situations. See the |
---|
| 55 | <filename>README</filename> file for more information.</para> |
---|
[a9e389d] | 56 | |
---|
[81d9bce] | 57 | <para os="i">If desired, skip kernel configuration by copying the kernel |
---|
[d4c0817] | 58 | config file, <filename>.config</filename>, from an example system |
---|
[a9e389d] | 59 | (assuming it is available) to the root directory of the unpacked kernel |
---|
[d4c0817] | 60 | sources.</para> |
---|
[a9e389d] | 61 | |
---|
[d4c0817] | 62 | <note><para>If you are using the u-boot bootloader, creating a |
---|
| 63 | <filename>uImage</filename> type kernel is recommended. Install the |
---|
| 64 | u-boot tools (not documented here) and append "uImage" when compiling the |
---|
| 65 | kernel.</para></note> |
---|
| 66 | |
---|
| 67 | <para os="j">Compile the configured kernel image and modules:</para> |
---|
[a9e389d] | 68 | |
---|
[6a3c6dc] | 69 | <screen os="k"><userinput>make ARCH=${CLFS_ARCH} CROSS_COMPILE=${CLFS_TARGET}-</userinput></screen> |
---|
[a9e389d] | 70 | |
---|
[81d9bce] | 71 | <para os="l">If using kernel modules, an |
---|
[d4c0817] | 72 | <filename>/etc/modprobe.conf</filename> file may be needed. Information |
---|
| 73 | pertaining to modules and kernel configuration is located in the kernel |
---|
| 74 | documentation in the <filename class="directory">Documentation</filename> |
---|
| 75 | directory of the kernel sources tree. Also, |
---|
| 76 | <filename>modprobe.conf(5)</filename> may be of interest.</para> |
---|
[a9e389d] | 77 | |
---|
[d4c0817] | 78 | <para os="p">If building modules, install the modules:</para> |
---|
[a9e389d] | 79 | |
---|
[d4c0817] | 80 | <screen os="q"><userinput>make ARCH=${CLFS_ARCH} CROSS_COMPILE=${CLFS_TARGET}- \ |
---|
| 81 | INSTALL_MOD_PATH=${CLFS}/targetfs modules_install</userinput></screen> |
---|
[a9e389d] | 82 | |
---|
[81d9bce] | 83 | <para os="y">The kernel configuration file <filename>.config</filename> |
---|
[a9e389d] | 84 | produced by the <command>make menuconfig</command> step above contains |
---|
| 85 | all the configuration selections for the kernel that was just compiled. |
---|
[d4c0817] | 86 | It is a good idea to keep this file for future reference.</para> |
---|
[a9e389d] | 87 | |
---|
[d4c0817] | 88 | <para>The resulting kernel will be located within the <filename |
---|
| 89 | class="directory">arch/${CLFS_ARCH}/boot</filename>. There may be more |
---|
| 90 | than one version of the same kernel, simply with different compression or |
---|
| 91 | bootloader helpers added. Follow your bootloader's instructions on how to |
---|
| 92 | copy the kernel to the final system.</para> |
---|
[81d9bce] | 93 | |
---|
[a9e389d] | 94 | </sect2> |
---|
| 95 | |
---|
| 96 | <sect2 id="contents-kernel" role="content"> |
---|
| 97 | <title>Contents of Linux</title> |
---|
| 98 | |
---|
| 99 | <segmentedlist> |
---|
| 100 | <segtitle>Installed files</segtitle> |
---|
| 101 | |
---|
| 102 | <seglistitem> |
---|
[d4c0817] | 103 | <seg>.config, Image files, and System.map</seg> |
---|
[a9e389d] | 104 | </seglistitem> |
---|
| 105 | </segmentedlist> |
---|
| 106 | |
---|
| 107 | <variablelist> |
---|
| 108 | <bridgehead renderas="sect3">Short Descriptions</bridgehead> |
---|
| 109 | <?dbfo list-presentation="list"?> |
---|
| 110 | <?dbhtml list-presentation="table"?> |
---|
| 111 | |
---|
| 112 | <varlistentry id="config"> |
---|
[d4c0817] | 113 | <term><filename>.config</filename></term> |
---|
[a9e389d] | 114 | <listitem> |
---|
| 115 | <para>Contains all the configuration selections for the kernel</para> |
---|
| 116 | </listitem> |
---|
| 117 | </varlistentry> |
---|
| 118 | |
---|
[d4c0817] | 119 | <varlistentry id="kernel"> |
---|
| 120 | <term><filename>zImage, uImage, bzImage, vmlinux</filename></term> |
---|
[a9e389d] | 121 | <listitem> |
---|
[d4c0817] | 122 | <para>The compiled Linux kernel.</para> |
---|
[a9e389d] | 123 | </listitem> |
---|
| 124 | </varlistentry> |
---|
| 125 | |
---|
| 126 | <varlistentry id="System.map"> |
---|
[d4c0817] | 127 | <term><filename>System.map</filename></term> |
---|
[a9e389d] | 128 | <listitem> |
---|
| 129 | <para>A list of addresses and symbols; it maps the entry points |
---|
| 130 | and addresses of all the functions and data structures in the |
---|
[d4c0817] | 131 | kernel. Useful for debugging, sometimes.</para> |
---|
[a9e389d] | 132 | </listitem> |
---|
| 133 | </varlistentry> |
---|
| 134 | |
---|
| 135 | </variablelist> |
---|
| 136 | |
---|
| 137 | </sect2> |
---|
| 138 | |
---|
| 139 | </sect1> |
---|