1 | <?xml version="1.0" encoding="ISO-8859-1"?> |
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ |
---|
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 | |
---|
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 |
---|
45 | components are console/video, disk, and network. With out these built |
---|
46 | in, the system will not function properly. It is recommended to |
---|
47 | configure the kernel without modules in order to conserve disk space |
---|
48 | and to reduce the complexity of booting.</para></note> |
---|
49 | |
---|
50 | <screen os="g"><userinput>make ARCH=${CLFS_ARCH} CROSS_COMPILE=${CLFS_TARGET}- menuconfig</userinput></screen> |
---|
51 | |
---|
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> |
---|
56 | |
---|
57 | <para os="i">If desired, skip kernel configuration by copying the kernel |
---|
58 | config file, <filename>.config</filename>, from an example system |
---|
59 | (assuming it is available) to the root directory of the unpacked kernel |
---|
60 | sources.</para> |
---|
61 | |
---|
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> |
---|
68 | |
---|
69 | <screen os="k"><userinput>make ARCH=${CLFS_ARCH} CROSS_COMPILE=${CLFS_TARGET}-</userinput></screen> |
---|
70 | |
---|
71 | <para os="l">If using kernel modules, an |
---|
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> |
---|
77 | |
---|
78 | <para os="p">If building modules, install the modules:</para> |
---|
79 | |
---|
80 | <screen os="q"><userinput>make ARCH=${CLFS_ARCH} CROSS_COMPILE=${CLFS_TARGET}- \ |
---|
81 | INSTALL_MOD_PATH=${CLFS}/targetfs modules_install</userinput></screen> |
---|
82 | |
---|
83 | <para os="y">The kernel configuration file <filename>.config</filename> |
---|
84 | produced by the <command>make menuconfig</command> step above contains |
---|
85 | all the configuration selections for the kernel that was just compiled. |
---|
86 | It is a good idea to keep this file for future reference.</para> |
---|
87 | |
---|
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> |
---|
93 | |
---|
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> |
---|
103 | <seg>.config, Image files, and System.map</seg> |
---|
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"> |
---|
113 | <term><filename>.config</filename></term> |
---|
114 | <listitem> |
---|
115 | <para>Contains all the configuration selections for the kernel</para> |
---|
116 | </listitem> |
---|
117 | </varlistentry> |
---|
118 | |
---|
119 | <varlistentry id="kernel"> |
---|
120 | <term><filename>zImage, uImage, bzImage, vmlinux</filename></term> |
---|
121 | <listitem> |
---|
122 | <para>The compiled Linux kernel.</para> |
---|
123 | </listitem> |
---|
124 | </varlistentry> |
---|
125 | |
---|
126 | <varlistentry id="System.map"> |
---|
127 | <term><filename>System.map</filename></term> |
---|
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 |
---|
131 | kernel. Useful for debugging, sometimes.</para> |
---|
132 | </listitem> |
---|
133 | </varlistentry> |
---|
134 | |
---|
135 | </variablelist> |
---|
136 | |
---|
137 | </sect2> |
---|
138 | |
---|
139 | </sect1> |
---|