Changeset d4c0817 in clfs-embedded


Ignore:
Timestamp:
Oct 21, 2013, 6:43:14 AM (11 years ago)
Author:
Andrew Bradford <andrew@…>
Branches:
master
Children:
390c34a
Parents:
9085699
Message:

kernel: First pass at cleanup

Remove any recommendation of using modules, they're evil :)
Recommend use of u-boot tools for creating uImages.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BOOK/bootable/common/kernel.xml

    r9085699 rd4c0817  
    3737    un-tarring.</para>
    3838
    39     <para os="e">Configure the kernel via a menu-driven interface.
    40     Please note that the udev bootscript requires "rtc" and "tmpfs" to be
    41     enabled and built into the kernel, not as modules. BLFS has
    42     some information regarding particular kernel configuration requirements of
    43     packages outside of CLFS at <ulink
    44     url="&blfs-root;view/svn/longindex.html#kernel-config-index"/>:</para>
     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>
    4542
    46     <note os="f"><para>Since we are building for an embedded system we need to make sure
    47     our key components are built into the kernel and not as modules. Our key
    48     components are console/video, disk, and network. With out these built in our
    49     system will not function properly. If your concerned about disk space, your kernel
    50     should be without modules.</para></note>
     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 simplify.</para></note>
    5149
    5250<screen os="g"><userinput>make ARCH=${CLFS_ARCH} CROSS_COMPILE=${CLFS_TARGET}- menuconfig</userinput></screen>
    5351
    54     <para os="h">Alternatively, <command>make oldconfig</command> may be more
    55     appropriate in some situations. See the <filename>README</filename>
    56     file for more information.</para>
     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>
    5756
    5857    <para os="i">If desired, skip kernel configuration by copying the kernel
    59     config file, <filename>.config</filename>, from the host system
     58    config file, <filename>.config</filename>, from an example system
    6059    (assuming it is available) to the root directory of the unpacked kernel
    61     sources. However, we do not recommend this option. It is often better
    62     to explore all the configuration menus and create the kernel configuration
    63     from scratch.</para>
     60    sources.</para>
    6461
    65     <para os="j">Compile the kernel image and modules:</para>
     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>
    6668
    6769<screen os="k"><userinput>make ARCH=${CLFS_ARCH} CROSS_COMPILE=${CLFS_TARGET}-</userinput></screen>
    6870
    6971    <para os="l">If using kernel modules, an
    70     <filename>/etc/modprobe.conf</filename> file may be needed.
    71     Information pertaining to modules and kernel configuration is
    72     located in the kernel documentation in the <filename
    73     class="directory">Documentation</filename> directory of the kernel
    74     sources tree. Also, <filename>modprobe.conf(5)</filename> may
    75     be of interest.</para>
     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>
    7677
    77     <para os="m">Be very careful when reading other documentation relating to
    78     kernel modules because it usually applies to 2.4.x kernels only. As
    79     far as we know, kernel configuration issues specific to Hotplug and
    80     Udev are not documented. The problem is that Udev will create a device
    81     node only if Hotplug or a user-written script inserts the corresponding
    82     module into the kernel, and not all modules are detectable by Hotplug.
    83     Note that statements like the one below in the
    84     <filename>/etc/modprobe.conf</filename> file do not work with Udev:</para>
    85 
    86 <screen os="n"><literal>alias char-major-XXX some-module</literal></screen>
    87 
    88     <para os="o">Because of the complications with Udev and modules,
    89     we strongly recommend starting with a completely non-modular kernel
    90     configuration, especially if this is the first time using Udev.</para>
    91 
    92     <para os="p">Install the modules, if the kernel configuration uses
    93     them:</para>
     78  <para os="p">If building modules, install the modules:</para>
    9479
    9580<screen os="q"><userinput>make ARCH=${CLFS_ARCH} CROSS_COMPILE=${CLFS_TARGET}- \
    96     INSTALL_MOD_PATH=${CLFS} modules_install</userinput></screen>
    97 
    98     <para os="r">After kernel compilation is complete, additional steps are
    99     required to complete the installation. Some files need to be copied to
    100     the <filename class="directory">${CLFS}/boot</filename> directory.</para>
    101 
    102     <para os="s">Issue the following command to install the kernel:</para>
    103 
    104 <screen os="t"><userinput>cp vmlinux ${CLFS}/boot/clfskernel-&linux-version;</userinput></screen>
    105 
    106     <para os="u"><filename>System.map</filename> is a symbol file for the kernel.
    107     It maps the function entry points of every function in the kernel API,
    108     as well as the addresses of the kernel data structures for the running
    109     kernel. Issue the following command to install the map file:</para>
    110 
    111 <screen os="v"><userinput>cp System.map ${CLFS}/boot/System.map-&linux-version;</userinput></screen>
    112 
    113     <para os="w">If we compiled our kernel with modules and we made sure
    114     <command>depmod.pl</command> is avaiable from BusyBox, we need to create the
    115     module dependency list by issuing the following command:</para>
    116 
    117 <screen os="x"><userinput>${CLFS}/cross-tools/bin/depmod.pl -F ${CLFS}/boot/System.map-&linux-version; \
    118     -b ${CLFS}/lib/modules/&linux-version;</userinput></screen>
     81    INSTALL_MOD_PATH=${CLFS}/targetfs modules_install</userinput></screen>
    11982
    12083    <para os="y">The kernel configuration file <filename>.config</filename>
    12184    produced by the <command>make menuconfig</command> step above contains
    12285    all the configuration selections for the kernel that was just compiled.
    123     It is a good idea to keep this file for future reference:</para>
     86    It is a good idea to keep this file for future reference.</para>
    12487
    125 <screen os="z"><userinput>cp .config ${CLFS}/boot/config-&linux-version;</userinput></screen>
    126 
    127     <warning os="aa">
    128       <para>Some kernel documentation recommends creating a symlink from
    129       <filename class="symlink">/usr/src/linux</filename> pointing to the
    130       kernel source directory. This is specific to kernels prior to the
    131       2.6 series and <emphasis>must not</emphasis> be created on an CLFS
    132       system as it can cause problems for packages you may wish to build
    133       once your base CLFS system is complete.</para>
    134 
    135     </warning>
    136 
    137    <para os="ab">The bootloaders section contains more information on
    138     how to configure the kernel for specifc bootloaders. Please refer
    139     to this section for your specific needs.</para>
     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>
    14093
    14194  </sect2>
     
    148101
    149102      <seglistitem>
    150         <seg>config-[linux-version], clfskernel-[linux-version],
    151         and System.map-[linux-version]</seg>
     103        <seg>.config, Image files, and System.map</seg>
    152104      </seglistitem>
    153105    </segmentedlist>
     
    159111
    160112      <varlistentry id="config">
    161         <term><filename>config-[linux-version]</filename></term>
     113        <term><filename>.config</filename></term>
    162114        <listitem>
    163115          <para>Contains all the configuration selections for the kernel</para>
    164           <indexterm zone="ch-bootable-kernel config">
    165             <primary sortas="e-/boot/config">/boot/config-[linux-version]</primary>
    166           </indexterm>
    167116        </listitem>
    168117      </varlistentry>
    169118
    170       <varlistentry id="clfskernel">
    171         <term><filename>clfskernel-[linux-version]</filename></term>
     119      <varlistentry id="kernel">
     120        <term><filename>zImage, uImage, bzImage, vmlinux</filename></term>
    172121        <listitem>
    173           <para>The engine of the Linux system. When turning on the
    174           computer, the kernel is the first part of the operating system
    175           that gets loaded. It detects and initializes all components of
    176           the computer's hardware, then makes these components available
    177           as a tree of files to the software and turns a single CPU into
    178           a multitasking machine capable of running scores of programs
    179           seemingly at the same time.</para>
    180           <indexterm zone="ch-bootable-kernel clfskernel">
    181             <primary sortas="b-clfskernel">clfskernel-[linux-version]</primary>
    182           </indexterm>
     122          <para>The compiled Linux kernel.</para>
    183123        </listitem>
    184124      </varlistentry>
    185125
    186126      <varlistentry id="System.map">
    187         <term><filename>System.map-[linux-version]</filename></term>
     127        <term><filename>System.map</filename></term>
    188128        <listitem>
    189129          <para>A list of addresses and symbols; it maps the entry points
    190130          and addresses of all the functions and data structures in the
    191           kernel</para>
    192           <indexterm zone="ch-bootable-kernel System.map">
    193             <primary sortas="e-/boot/System.map">/boot/System.map-[linux-version]</primary>
    194           </indexterm>
     131          kernel.  Useful for debugging, sometimes.</para>
    195132        </listitem>
    196133      </varlistentry>
Note: See TracChangeset for help on using the changeset viewer.