Changeset fcc02767 for chapter08


Ignore:
Timestamp:
06/07/2020 08:16:00 PM (4 years ago)
Author:
Bruce Dubbs <bdubbs@…>
Branches:
10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
Children:
595ff03
Parents:
d53fefa
Message:

Initial commit of alternative cross LFS

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/cross2@11897 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

Location:
chapter08
Files:
24 added
3 edited
52 moved

Legend:

Unmodified
Added
Removed
  • chapter08/chapter08.xml

    rd53fefa rfcc02767  
    66]>
    77
    8 <chapter id="chapter-bootable" xreflabel="Chapter&nbsp;8">
     8<chapter id="chapter-building-system" xreflabel="Chapter&nbsp;8">
    99  <?dbhtml dir="chapter08"?>
    1010  <?dbhtml filename="chapter08.html"?>
    1111
    12   <title>Making the LFS System Bootable</title>
     12  <title>Installing Basic System Software</title>
    1313
    1414  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="introduction.xml"/>
    15   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="fstab.xml"/>
    16   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="kernel.xml"/>
     15  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="pkgmgt.xml"/>
     16  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="man-pages.xml"/>
     17  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="glibc.xml"/>
     18  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="zlib.xml"/>
     19  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bzip2.xml"/>
     20  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="xz.xml"/>
     21  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="zstd.xml"/>
     22  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="file.xml"/>
     23  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="readline.xml"/>
     24  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="m4.xml"/>
     25  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bc.xml"/>
     26  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="flex.xml"/>
     27  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="binutils.xml"/>
     28  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gmp.xml"/>
     29  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="mpfr.xml"/>
     30  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="mpc.xml"/>
     31  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="attr.xml"/>
     32  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="acl.xml"/>
     33  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="libcap.xml"/>
     34  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="shadow.xml"/>
     35  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gcc.xml"/>
     36  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="pkgconfig.xml"/>
     37  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="ncurses.xml"/>
     38  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sed.xml"/>
     39  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="psmisc.xml"/>
     40  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="iana-etc.xml"/>
     41  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gettext.xml"/>
     42  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bison.xml"/>
     43  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="grep.xml"/>
     44  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bash.xml"/>
     45  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="libtool.xml"/>
     46  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gdbm.xml"/>
     47  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gperf.xml"/>
     48  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="expat.xml"/>
     49  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="inetutils.xml"/>
     50  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="perl.xml"/>
     51  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="xml-parser.xml"/>
     52  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="intltool.xml"/>
     53  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="autoconf.xml"/>
     54  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="automake.xml"/>
     55  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="kmod.xml"/>
     56  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="libelf.xml"/>
     57  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="libffi.xml"/>
     58  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="openssl.xml"/>
     59  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="python.xml"/>
     60  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="ninja.xml"/>
     61  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="meson.xml"/>
     62  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="coreutils.xml"/>
     63  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="check.xml"/>
     64  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="diffutils.xml"/>
     65  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gawk.xml"/>
     66  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="findutils.xml"/>
     67  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="groff.xml"/>
    1768  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="grub.xml"/>
     69  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="less.xml"/>
     70  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gzip.xml"/>
     71  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="iproute2.xml"/>
     72  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="kbd.xml"/>
     73  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="libpipeline.xml"/>
     74  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="make.xml"/>
     75  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="patch.xml"/>
     76  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="man-db.xml"/>
     77  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="tar.xml"/>
     78  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="texinfo.xml"/>
     79  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="vim.xml"/>
     80
     81  <!-- systemd only -->
     82  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="systemd.xml"/>
     83  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dbus.xml"/>
     84
     85  <!-- sysv only -->
     86  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="eudev.xml"/>
     87
     88  <!-- Both sysv on systemd builds -->
     89  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="procps.xml"/>
     90  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="util-linux.xml"/>
     91
     92  <!-- Both sysv and systemd builds -->
     93  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="e2fsprogs.xml"/>
     94
     95  <!-- sysv only -->
     96  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sysklogd.xml"/>
     97  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sysvinit.xml"/>
     98
     99  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="aboutdebug.xml"/>
     100  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="strippingagain.xml"/>
     101  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="revisedchroot.xml"/>
    18102
    19103</chapter>
  • chapter08/grub.xml

    rd53fefa rfcc02767  
    66]>
    77
    8 <sect1 id="ch-bootable-grub" role="wrap">
     8<sect1 id="ch-system-grub" role="wrap">
    99  <?dbhtml filename="grub.html"?>
    1010
     
    1515  </sect1info>
    1616
    17   <title>Using GRUB to Set Up the Boot Process</title>
    18 
    19   <sect2>
    20     <title>Introduction</title>
    21 
    22     <warning><para>Configuring GRUB incorrectly can render your system
    23     inoperable without an alternate boot device such as a CD-ROM.  This
    24     section is not required to boot your LFS system.  You may just
    25     want to modify your current boot loader, e.g. Grub-Legacy, GRUB2, or
    26     LILO.</para></warning>
    27 
    28 
    29     <para> Ensure that an emergency boot disk is ready to <quote>rescue</quote>
    30     the computer if the computer becomes unusable (un-bootable).  If you do not
    31     already have a boot device, you can create one.  In order for the procedure
    32     below to work, you need to jump ahead to BLFS and install
    33     <userinput>xorriso</userinput> from the <ulink
    34     url="&blfs-book;multimedia/libisoburn.html">
    35     libisoburn</ulink> package.</para>
    36 
    37 <screen role="nodump"><userinput>cd /tmp
    38 grub-mkrescue --output=grub-img.iso
    39 xorriso -as cdrecord -v dev=/dev/cdrw blank=as_needed grub-img.iso</userinput></screen>
    40 
    41     <note>
    42       <para>
    43         To boot LFS on host systems that have UEFI enabled, the kernel needs to
    44         have been built with the CONFIG_EFI_STUB capabality described in the
    45         previous section.  However, LFS can be booted using GRUB2 without such
    46         an addition. To do this, the UEFI Mode and Secure Boot capabilities in
    47         the host system's BIOS need to be turned off.  For details, see <ulink
    48         url="&hints-root;lfs-uefi.txt">
    49         the lfs-uefi.txt hint</ulink> at
    50         &hints-root;lfs-uefi.txt.
    51       </para>
    52     </note>
     17  <title>GRUB-&grub-version;</title>
     18
     19  <indexterm zone="ch-system-grub">
     20    <primary sortas="a-Grub">GRUB</primary>
     21  </indexterm>
     22
     23  <sect2 role="package">
     24    <title/>
     25
     26    <para>The GRUB package contains the GRand Unified Bootloader.</para>
     27
     28    <segmentedlist>
     29      <segtitle>&buildtime;</segtitle>
     30      <segtitle>&diskspace;</segtitle>
     31
     32      <seglistitem>
     33        <seg>&grub-ch6-sbu;</seg>
     34        <seg>&grub-ch6-du;</seg>
     35      </seglistitem>
     36    </segmentedlist>
    5337
    5438  </sect2>
    5539
    56   <sect2>
    57     <title>GRUB Naming Conventions</title>
    58 
    59     <para>GRUB uses its own naming structure for drives and partitions in
    60     the form of <emphasis>(hdn,m)</emphasis>, where <emphasis>n</emphasis>
    61     is the hard drive number and <emphasis>m</emphasis> is the partition
    62     number. The hard drive number starts from zero, but the partition number
    63     starts from one for normal partitions and five for extended partitions.
    64     Note that this is different from earlier versions where
    65     both numbers started from zero. For example, partition <filename
    66     class="partition">sda1</filename> is <emphasis>(hd0,1)</emphasis> to
    67     GRUB and <filename class="partition">sdb3</filename> is
    68     <emphasis>(hd1,3)</emphasis>. In contrast to Linux, GRUB does not
    69     consider CD-ROM drives to be hard drives. For example, if using a CD
    70     on <filename class="partition">hdb</filename> and a second hard drive
    71     on <filename class="partition">hdc</filename>, that second hard drive
    72     would still be <emphasis>(hd1)</emphasis>.</para>
     40  <sect2 role="installation">
     41    <title>Installation of GRUB</title>
     42
     43    <para>Prepare GRUB for compilation:</para>
     44
     45<screen><userinput remap="configure">./configure --prefix=/usr          \
     46            --sbindir=/sbin        \
     47            --sysconfdir=/etc      \
     48            --disable-efiemu       \
     49            --disable-werror</userinput></screen>
     50
     51    <variablelist>
     52      <title>The meaning of the new configure options:</title>
     53
     54      <varlistentry>
     55        <term><parameter>--disable-werror</parameter></term>
     56        <listitem>
     57          <para>This allows the build to complete with warnings introduced
     58          by more recent Flex versions.</para>
     59        </listitem>
     60      </varlistentry>
     61
     62      <varlistentry>
     63        <term><parameter>--disable-efiemu</parameter></term>
     64        <listitem>
     65          <para>This option minimizes what is built by disabling a feature and
     66          testing programs not needed for LFS.</para>
     67        </listitem>
     68      </varlistentry>
     69
     70    </variablelist>
     71
     72    <para>Compile the package:</para>
     73
     74<screen><userinput remap="make">make</userinput></screen>
     75
     76    <para>This package does not come with a test suite.</para>
     77
     78    <para>Install the package:</para>
     79
     80<screen><userinput remap="install">make install
     81mv -v /etc/bash_completion.d/grub /usr/share/bash-completion/completions</userinput></screen>
     82
     83  <para>Using GRUB to make your LFS system bootable will be discussed in
     84  <xref linkend="ch-bootable-grub"/>.</para>
    7385
    7486  </sect2>
    7587
    76   <sect2>
    77     <title>Setting Up the Configuration</title>
    78 
    79     <para>GRUB works by writing data to the first physical track of the
    80     hard disk.  This area is not part of any file system.  The programs
    81     there access GRUB modules in the boot partition.  The default location
    82     is /boot/grub/.</para>
    83 
    84     <para>The location of the boot partition is a choice of the user that
    85     affects the configuration.  One recommendation is to have a separate small
    86     (suggested size is 100 MB) partition just for boot information.  That way
    87     each build, whether LFS or some commercial distro, can access the same boot
    88     files and access can be made from any booted system.  If you choose to do
    89     this, you will need to mount the separate partition, move all files in the
    90     current <filename class="directory">/boot</filename> directory (e.g. the
    91     linux kernel you just built in the previous section) to the new partition.
    92     You will then need to unmount the partition and remount it as <filename
    93     class="directory">/boot</filename>.  If you do this, be sure to update
    94     <filename>/etc/fstab</filename>.</para>
    95 
    96     <para>Using the current lfs partition will also work, but configuration
    97     for multiple systems is more difficult.</para>
    98 
    99     <para>Using the above information, determine the appropriate
    100     designator for the root partition (or boot partition, if a separate
    101     one is used). For the following example, it is assumed that the root
    102     (or separate boot) partition is <filename
    103     class="partition">sda2</filename>.</para>
    104 
    105     <para>Install the GRUB files into <filename
    106     class="directory">/boot/grub</filename> and set up the boot track:</para>
    107 
    108     <warning>
    109       <para>The following command will overwrite the current boot loader. Do not
    110       run the command if this is not desired, for example, if using a third party
    111       boot manager to manage the Master Boot Record (MBR).</para>
    112     </warning>
    113 
    114 <screen role="nodump"><userinput>grub-install /dev/sda</userinput></screen>
    115 
    116     <note>
    117       <para>If the system has been booted using UEFI,
    118       <command>grub-install</command> will try to install files for the
    119       <emphasis>x86_64-efi</emphasis> target, but those files
    120       have not been installed in chapter 6. If this is the case, add
    121       <option>--target i386-pc</option> to the command above.</para>
    122     </note>
    123 
    124 <!-- This does not seem to be true any more
    125     <note><para><application>grub-install</application> is a script and calls another
    126     program, grub-probe, that may fail with a message "cannot stat `/dev/root'".
    127     If so, create a temporary symbolic link from your root partition to /dev/root:</para>
    128 
    129 <screen role="nodump"><userinput>ln -sv /dev/sda2 /dev/root</userinput></screen>
    130 
    131     <para>The symbolic link will only be present until the system is rebooted.
    132     The link is only needed for the installation procedure.
    133     </para></note>
    134 -->
     88  <sect2 id="contents-gRUB" role="content">
     89    <title>Contents of GRUB</title>
     90
     91    <segmentedlist>
     92      <segtitle>Installed programs</segtitle>
     93      <segtitle>Installed directories</segtitle>
     94
     95      <seglistitem>
     96
     97       <seg>grub-bios-setup,      grub-editenv,    grub-file,        grub-fstest,
     98            grub-glue-efi,        grub-install,    grub-kbdcomp,     grub-macbless,   
     99            grub-menulst2cfg,     grub-mkconfig,
     100                                  grub-mkimage,    grub-mklayout,    grub-mknetdir,
     101            grub-mkpasswd-pbkdf2, grub-mkrelpath,  grub-mkrescue,    grub-mkstandalone,
     102            grub-ofpathname,      grub-probe,      grub-reboot,      grub-render-label,
     103            grub-script-check,
     104            grub-set-default,     grub-sparc64-setup, and grub-syslinux2cfg</seg>
     105
     106        <seg>/usr/lib/grub, /etc/grub.d, /usr/share/grub, and /boot/grub (when grub-install
     107        is first run)</seg>
     108      </seglistitem>
     109    </segmentedlist>
     110
     111    <variablelist>
     112      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
     113      <?dbfo list-presentation="list"?>
     114      <?dbhtml list-presentation="table"?>
     115
     116      <varlistentry id="grub-bios-setup">
     117        <term><command>grub-bios-setup</command></term>
     118        <listitem>
     119          <para>Is a helper program for grub-install</para>
     120          <indexterm zone="ch-system-grub grub-bios-setup">
     121            <primary sortas="b-grub-bios-setup">grub-bios-setup</primary>
     122          </indexterm>
     123        </listitem>
     124      </varlistentry>
     125
     126      <varlistentry id="grub-editenv">
     127        <term><command>grub-editenv</command></term>
     128        <listitem>
     129          <para>A tool to edit the environment block</para>
     130          <indexterm zone="ch-system-grub grub-editenv">
     131            <primary sortas="b-grub-editenv">grub-editenv</primary>
     132          </indexterm>
     133        </listitem>
     134      </varlistentry>
     135
     136      <varlistentry id="grub-file">
     137        <term><command>grub-file</command></term>
     138        <listitem>
     139          <para>Checks if FILE is of the specified type.</para>
     140          <indexterm zone="ch-system-grub grub-file">
     141            <primary sortas="b-grub-file">grub-file</primary>
     142          </indexterm>
     143        </listitem>
     144      </varlistentry>
     145
     146      <varlistentry id="grub-fstest">
     147        <term><command>grub-fstest</command></term>
     148        <listitem>
     149          <para>Tool to debug the filesystem driver</para>
     150          <indexterm zone="ch-system-grub grub-fstest">
     151            <primary sortas="b-grub-fstest">grub-fstest</primary>
     152          </indexterm>
     153        </listitem>
     154      </varlistentry>
     155
     156      <varlistentry id="grub-glue-efi">
     157        <term><command>grub-glue-efi</command></term>
     158        <listitem>
     159          <para>Processes ia32 and amd64 EFI images and glues them
     160          according to Apple format.</para>
     161          <indexterm zone="ch-system-grub grub-glue-efi">
     162            <primary sortas="b-grub-glue-efi">grub-glue-efi</primary>
     163          </indexterm>
     164        </listitem>
     165      </varlistentry>
     166
     167      <varlistentry id="grub-install">
     168        <term><command>grub-install</command></term>
     169        <listitem>
     170          <para>Install GRUB on your drive</para>
     171          <indexterm zone="ch-system-grub grub-install">
     172            <primary sortas="b-grub-install">grub-install</primary>
     173          </indexterm>
     174        </listitem>
     175      </varlistentry>
     176
     177      <varlistentry id="grub-kbdcomp">
     178        <term><command>grub-kbdcomp</command></term>
     179        <listitem>
     180          <para>Script that converts an xkb layout into one recognized by
     181          GRUB</para>
     182          <indexterm zone="ch-system-grub grub-kbdcomp">
     183            <primary sortas="b-grub-kbdcomp">grub-kbdcomp</primary>
     184          </indexterm>
     185        </listitem>
     186      </varlistentry>
     187
     188      <varlistentry id="grub-macbless">
     189        <term><command>grub-macbless</command></term>
     190        <listitem>
     191          <para>Mac-style bless on HFS or HFS+ files</para>
     192          <indexterm zone="ch-system-grub grub-macbless">
     193            <primary sortas="b-grub-macbless">grub-macbless</primary>
     194          </indexterm>
     195        </listitem>
     196      </varlistentry>
     197
     198      <varlistentry id="grub-menulst2cfg">
     199        <term><command>grub-menulst2cfg</command></term>
     200        <listitem>
     201          <para>Converts a GRUB Legacy <filename>menu.lst</filename>
     202          into a <filename>grub.cfg</filename> for use with GRUB 2</para>
     203          <indexterm zone="ch-system-grub grub-menulst2cfg">
     204            <primary sortas="b-grub-menulst2cfg">grub-menulst2cfg</primary>
     205          </indexterm>
     206        </listitem>
     207      </varlistentry>
     208
     209      <varlistentry id="grub-mkconfig">
     210        <term><command>grub-mkconfig</command></term>
     211        <listitem>
     212          <para>Generate a grub config file</para>
     213          <indexterm zone="ch-system-grub grub-mkconfig">
     214            <primary sortas="b-grub-mkconfig">grub-mkconfig</primary>
     215          </indexterm>
     216        </listitem>
     217      </varlistentry>
     218
     219      <varlistentry id="grub-mkimage">
     220        <term><command>grub-mkimage</command></term>
     221        <listitem>
     222          <para>Make a bootable image of GRUB</para>
     223          <indexterm zone="ch-system-grub grub-mkimage">
     224            <primary sortas="b-grub-mkimage">grub-mkimage</primary>
     225          </indexterm>
     226        </listitem>
     227      </varlistentry>
     228
     229      <varlistentry id="grub-mklayout">
     230        <term><command>grub-mklayout</command></term>
     231        <listitem>
     232          <para>Generates a GRUB keyboard layout file</para>
     233          <indexterm zone="ch-system-grub grub-mklayout">
     234            <primary sortas="b-grub-mklayout">grub-mklayout</primary>
     235          </indexterm>
     236        </listitem>
     237      </varlistentry>
     238
     239      <varlistentry id="grub-mknetdir">
     240        <term><command>grub-mknetdir</command></term>
     241        <listitem>
     242          <para>Prepares a GRUB netboot directory</para>
     243          <indexterm zone="ch-system-grub grub-mknetdir">
     244            <primary sortas="b-grub-mknetdir">grub-mknetdir</primary>
     245          </indexterm>
     246        </listitem>
     247      </varlistentry>
     248
     249      <varlistentry id="grub-mkpasswd-pbkdf2">
     250        <term><command>grub-mkpasswd-pbkdf2</command></term>
     251        <listitem>
     252          <para>Generates an encrypted PBKDF2 password for use in the boot
     253          menu</para>
     254          <indexterm zone="ch-system-grub grub-mkpasswd-pbkdf2">
     255            <primary sortas="b-grub-mkpasswd-pbkdf2">grub-mkpasswd-pbkdf2</primary>
     256          </indexterm>
     257        </listitem>
     258      </varlistentry>
     259
     260      <varlistentry id="grub-mkrelpath">
     261        <term><command>grub-mkrelpath</command></term>
     262        <listitem>
     263          <para>Makes a system pathname relative to its root</para>
     264          <indexterm zone="ch-system-grub grub-mkrelpath">
     265            <primary sortas="b-grub-mkrelpath">grub-mkrelpath</primary>
     266          </indexterm>
     267        </listitem>
     268      </varlistentry>
     269
     270      <varlistentry id="grub-mkrescue">
     271        <term><command>grub-mkrescue</command></term>
     272        <listitem>
     273          <para>Make a bootable image of GRUB suitable for a floppy disk or CDROM/DVD</para>
     274          <indexterm zone="ch-system-grub grub-mkrescue">
     275            <primary sortas="b-grub-mkrescue">grub-mkrescue</primary>
     276          </indexterm>
     277        </listitem>
     278      </varlistentry>
     279
     280      <varlistentry id="grub-mkstandalone">
     281        <term><command>grub-mkstandalone</command></term>
     282        <listitem>
     283          <para>Generates a standalone image</para>
     284          <indexterm zone="ch-system-grub grub-mkstandalone">
     285            <primary sortas="b-grub-mkstandalone">grub-mkstandalone</primary>
     286          </indexterm>
     287        </listitem>
     288      </varlistentry>
     289
     290      <varlistentry id="grub-ofpathname">
     291        <term><command>grub-ofpathname</command></term>
     292        <listitem>
     293          <para>Is a helper program that prints the path of a GRUB device</para>
     294          <indexterm zone="ch-system-grub grub-ofpathname">
     295            <primary sortas="b-grub-ofpathname">grub-ofpathname</primary>
     296          </indexterm>
     297        </listitem>
     298      </varlistentry>
     299
     300      <varlistentry id="grub-probe">
     301        <term><command>grub-probe</command></term>
     302        <listitem>
     303          <para>Probe device information for a given path or device</para>
     304          <indexterm zone="ch-system-grub grub-probe">
     305            <primary sortas="b-grub-probe">grub-probe</primary>
     306          </indexterm>
     307        </listitem>
     308      </varlistentry>
     309
     310      <varlistentry id="grub-reboot">
     311        <term><command>grub-reboot</command></term>
     312        <listitem>
     313          <para>Sets the default boot entry for GRUB for the next boot only</para>
     314          <indexterm zone="ch-system-grub grub-reboot">
     315            <primary sortas="b-grub-reboot">grub-reboot</primary>
     316          </indexterm>
     317        </listitem>
     318      </varlistentry>
     319
     320      <varlistentry id="grub-render-label">
     321        <term><command>grub-render-label</command></term>
     322        <listitem>
     323          <para>Render Apple .disk_label for Apple Macs</para>
     324          <indexterm zone="ch-system-grub grub-render-label">
     325            <primary sortas="b-grub-render-label">grub-render-label</primary>
     326          </indexterm>
     327        </listitem>
     328      </varlistentry>
     329
     330      <varlistentry id="grub-script-check">
     331        <term><command>grub-script-check</command></term>
     332        <listitem>
     333          <para>Checks GRUB configuration script for syntax errors</para>
     334          <indexterm zone="ch-system-grub grub-script-check">
     335            <primary sortas="b-grub-script-check">grub-script-check</primary>
     336          </indexterm>
     337        </listitem>
     338      </varlistentry>
     339
     340      <varlistentry id="grub-set-default">
     341        <term><command>grub-set-default</command></term>
     342        <listitem>
     343          <para>Sets the default boot entry for GRUB</para>
     344          <indexterm zone="ch-system-grub grub-set-default">
     345            <primary sortas="b-grub-set-default">grub-set-default</primary>
     346          </indexterm>
     347        </listitem>
     348      </varlistentry>
     349
     350      <varlistentry id="grub-sparc64-setup">
     351        <term><command>grub-sparc64-setup</command></term>
     352        <listitem>
     353          <para>Is a helper program for grub-setup</para>
     354          <indexterm zone="ch-system-grub grub-sparc64-setup">
     355            <primary sortas="b-grub-sparc64-setup">grub-setup</primary>
     356          </indexterm>
     357        </listitem>
     358      </varlistentry>
     359
     360      <varlistentry id="grub-syslinux2cfg">
     361        <term><command>grub-syslinux2cfg</command></term>
     362        <listitem>
     363          <para>Transform a syslinux config file into grub.cfg format</para>
     364          <indexterm zone="ch-system-grub grub-syslinux2cfg">
     365            <primary sortas="b-grub-syslinux2cfg">grub-syslinux2cfg</primary>
     366          </indexterm>
     367        </listitem>
     368      </varlistentry>
     369
     370    </variablelist>
     371
    135372  </sect2>
    136373
    137   <sect2 id="grub-cfg">
    138     <title>Creating the GRUB Configuration File</title>
    139 
    140     <para>Generate <filename>/boot/grub/grub.cfg</filename>:</para>
    141 
    142     <screen revision="sysv"><userinput>cat &gt; /boot/grub/grub.cfg &lt;&lt; "EOF"
    143 <literal># Begin /boot/grub/grub.cfg
    144 set default=0
    145 set timeout=5
    146 
    147 insmod ext2
    148 set root=(hd0,2)
    149 
    150 menuentry "GNU/Linux, Linux &linux-version;-lfs-&version;" {
    151         linux   /boot/vmlinuz-&linux-version;-lfs-&version; root=/dev/sda2 ro
    152 }</literal>
    153 EOF</userinput></screen>
    154 
    155     <screen revision="systemd"><userinput>cat &gt; /boot/grub/grub.cfg &lt;&lt; "EOF"
    156 <literal># Begin /boot/grub/grub.cfg
    157 set default=0
    158 set timeout=5
    159 
    160 insmod ext2
    161 set root=(hd0,2)
    162 
    163 menuentry "GNU/Linux, Linux &linux-version;-lfs-&versiond;" {
    164         linux   /boot/vmlinuz-&linux-version;-lfs-&versiond; root=/dev/sda2 ro
    165 }</literal>
    166 EOF</userinput></screen>
    167 
    168 
    169     <note><para>From <application>GRUB</application>'s perspective, the
    170     kernel files are relative to the partition used.  If you
    171     used a separate /boot partition, remove /boot from the above
    172     <emphasis>linux</emphasis> line.  You will also need to change the
    173     <emphasis>set root</emphasis> line to point to the boot partition.
    174     </para></note>
    175 
    176     <para>GRUB is an extremely powerful program and it provides a tremendous
    177     number of options for booting from a wide variety of devices, operating
    178     systems, and partition types.  There are also many options for customization
    179     such as graphical splash screens, playing sounds, mouse input, etc.  The
    180     details of these options are beyond the scope of this introduction.</para>
    181 
    182     <caution><para>There is a command, <application>grub-mkconfig</application>, that
    183     can write a configuration file automatically.  It uses a set of scripts in
    184     /etc/grub.d/ and will destroy any customizations that you make.  These scripts
    185     are designed primarily for non-source distributions and are not recommended for
    186     LFS.  If you install a commercial Linux distribution, there is a good chance
    187     that this program will be run.  Be sure to back up your grub.cfg file.</para></caution>
    188 
    189    </sect2>
    190 
    191374</sect1>
  • chapter08/introduction.xml

    rd53fefa rfcc02767  
    66]>
    77
    8 <sect1 id="ch-bootable-introduction">
     8<sect1 id="ch-system-introduction">
    99  <?dbhtml filename="introduction.html"?>
    1010
    1111  <title>Introduction</title>
    1212
    13   <para>It is time to make the LFS system bootable. This chapter
    14   discusses creating an <filename>fstab</filename> file, building a
    15   kernel for the new LFS system, and installing the GRUB boot loader so
    16   that the LFS system can be selected for booting at startup.</para>
     13  <para>In this chapter, we enter the building site and start constructing the
     14  LFS system in earnest. That is, we chroot into the temporary mini Linux system,
     15  make a few final preparations, and then begin installing the packages.</para>
     16
     17  <para>The installation of this software is straightforward. Although in many
     18  cases the installation instructions could be made shorter and more generic,
     19  we have opted to provide the full instructions for every package to minimize
     20  the possibilities for mistakes.  The key to learning what makes a Linux system
     21  work is to know what each package is used for and why you (or the system)
     22  may need it.</para>
     23
     24  <para>We do not recommend using optimizations.  They can make
     25  a program run slightly faster, but they may also cause compilation
     26  difficulties and problems when running the program.  If a package refuses to
     27  compile when using optimization, try to compile it without optimization and
     28  see if that fixes the problem. Even if the package does compile when using
     29  optimization, there is the risk it may have been compiled incorrectly because
     30  of the complex interactions between the code and build tools.  Also note that
     31  the <option>-march</option> and <option>-mtune</option> options using values
     32  not specified in the book have not been tested. This may cause problems with
     33  the toolchain packages (Binutils, GCC and Glibc).  The small potential gains
     34  achieved in using compiler optimizations are often outweighed by the risks.
     35  First-time builders of LFS are encouraged to build without custom
     36  optimizations. The subsequent system will still run very fast and be stable
     37  at the same time.</para>
     38
     39  <para>Before the installation instructions, each installation page provides
     40  information about the package, including a concise description of what it
     41  contains, approximately how long it will take to build, and how much disk
     42  space is required during this building process. Following the installation
     43  instructions, there is a list of programs and libraries (along with brief
     44  descriptions of these) that the package installs.</para>
     45
     46  <note><para>The SBU values and required disk space includes
     47  test suite data for all applicable packages in Chapter&nbsp;6.</para></note>
     48
     49  <sect2>
     50    <title>About libraries</title>
     51
     52    <para>In general, the LFS editors discourage building and installing static
     53    libraries.  The original purpose for most static libraries has been made
     54    obsolete in a modern Linux system.  In addition linking a static library
     55    into a program can be detrimental.  If an update to the library is needed
     56    to remove a security problem, all programs that use the static library will
     57    need to be relinked to the new library.  Since the use of static libraries
     58    is not always obvious, the relevant programs (and the procedures needed to
     59    do the linking) may not even be known.</para>
     60
     61    <para>In the procedures in Chapter&nbsp;6, we remove or disable installation of
     62    most static libraries. Usually this is done by passing a
     63    <option>--disable-static</option> option to <command>configure</command>.
     64    In other cases, alternate means are needed. In a few cases, especially
     65    glibc and gcc, the use of static libraries remains essential to the general
     66    package building process. </para>
     67
     68    <para>For a more complete discussion of libraries, see the discussion
     69    <ulink url="&blfs-root;/view/&short-version;/introduction/libraries.html">
     70    Libraries: Static or shared?</ulink> in the BLFS book.</para>
     71
     72  </sect2>
    1773
    1874</sect1>
Note: See TracChangeset for help on using the changeset viewer.