Changeset d2ecc65 for BOOK/boot/common


Ignore:
Timestamp:
Apr 19, 2014, 10:07:08 PM (11 years ago)
Author:
Chris Staub <chris@…>
Branches:
clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
Children:
76ccba3
Parents:
03679c8
Message:

Reorganized boot section

Location:
BOOK/boot/common
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • BOOK/boot/common/changingowner.xml

    r03679c8 rd2ecc65  
    1111  <title>Changing Ownership</title>
    1212
    13   <para os="a">Currently, the <filename class="directory">${CLFS}</filename>
    14   directory and all of its subdirectories  are owned by the user
    15   <systemitem class="username">clfs</systemitem>, a user that exists only
    16   on the host system. For security reasons, the ${CLFS} root directory and
    17   all of its subdirectories should be owned by
    18   <systemitem class="username">root</systemitem>. Change the ownership
    19   for ${CLFS} and its subdirectories by running this command:</para>
     13  <para os="a">Currently, the <filename class="directory">/tools</filename>
     14  and <filename class="directory">/cross-tools</filename> directories
     15  are owned by the user <emphasis>clfs</emphasis>, a user that
     16  exists only on the host system. Although <filename
     17  class="directory">/tools</filename> and <filename
     18  class="directory">/cross-tools</filename> can be deleted once the CLFS
     19  system has been finished, they can be retained to build
     20  additional CLFS systems. If the <filename class="directory">/tools</filename>
     21  and <filename class="directory">/cross-tools</filename> directories are
     22  kept as is, the files are owned by a user ID without a corresponding
     23  account. This is dangerous because a user account created later could
     24  get this same user ID and would own these directories and all the files
     25  therein, thus exposing those files to possible malicious manipulation.</para>
    2026
    21 <screen os="b"><userinput>chown -Rv &uid-root;:&gid-root; ${CLFS}</userinput></screen>
     27  <para os="b">One possible fix for this issue might be to add the
     28  <systemitem class="username">clfs</systemitem> user to the new CLFS system
     29  later when creating the <filename>/etc/passwd</filename> file, taking care
     30  to assign it the same user and group IDs as on the host system. Alternatively,
     31  assign the contents of the <filename class="directory">/tools</filename>
     32  and <filename class="directory">/cross-tools</filename> directories to
     33  user <systemitem class="username">root</systemitem> by running the
     34  following commands:</para>
     35
     36<screen os="c"><userinput>chown -Rv 0:0 ${CLFS}/tools
     37chown -Rv 0:0 ${CLFS}/cross-tools</userinput></screen>
    2238
    2339</sect1>
  • BOOK/boot/common/createfiles.xml

    r03679c8 rd2ecc65  
    1616  the next chapter after the software has been installed.</para>
    1717
    18 <screen><userinput>ln -sv /tools/bin/{bash,cat,echo,grep,login,pwd,stty} ${CLFS}/bin
     18<screen os="b"><userinput>ln -sv /tools/bin/{bash,cat,echo,grep,login,pwd,stty} ${CLFS}/bin
    1919ln -sv /tools/bin/file ${CLFS}/usr/bin
    2020ln -sv /tools/lib/libgcc_s.so{,.1} ${CLFS}/usr/lib
    2121ln -sv /tools/lib/libstdc++.so{.6,} ${CLFS}/usr/lib
    22 sed -e 's/tools/usr/' /tools/lib/libstdc++.la > ${CLFS}/usr/lib/libstdc++.la
     22sed -e 's/tools/usr/' /tools/lib/libstdc++.la &gt; ${CLFS}/usr/lib/libstdc++.la
    2323ln -sv bash ${CLFS}/bin/sh
    24 ln -sv /run ${CLFS}/var/run</userinput></screen>
     24ln -sv ../run ${CLFS}/var/run
     25ln -sv /tools/sbin/{fsck.ext2,fsck.ext3,fsck.ext4,e2fsck} ${CLFS}/sbin
     26ln -sv /tools/sbin/init ${CLFS}/sbin
     27ln -sv /tools/etc/{login.{access,defs},limits} ${CLFS}/etc</userinput></screen>
     28
    2529
    2630  <para os="c">Historically, Linux maintains a list of the mounted file systems
  • BOOK/boot/common/creatingdirs.xml

    r03679c8 rd2ecc65  
    1111  <title>Creating Directories</title>
    1212
    13   <para os="a">It is time to create some structure in the CLFS file system. Create a
     13    <note os="a">
     14      <para>The commands in the remainder of the book should be run as
     15      the <systemitem class="username">root</systemitem> user. Check
     16      that ${CLFS} is set in the
     17      <systemitem class="username">root</systemitem> user&rsquo;s environment
     18       before proceeding.</para>
     19    </note>
     20
     21  <para os="b">It is time to create some structure in the CLFS file system. Create a
    1422  standard directory tree by issuing the following commands:</para>
    1523
    16 <screen os="b"><userinput>mkdir -pv ${CLFS}/{bin,boot,dev,{etc/,}opt,home,lib,mnt}
     24<screen os="c"><userinput>mkdir -pv ${CLFS}/{bin,boot,dev,{etc/,}opt,home,lib/firmware,mnt}
    1725mkdir -pv ${CLFS}/{proc,media/{floppy,cdrom},run/{,shm},sbin,srv,sys}
    1826mkdir -pv ${CLFS}/var/{lock,log,mail,spool}
     
    2533mkdir -pv ${CLFS}/usr/{,local/}share/man/man{1,2,3,4,5,6,7,8}</userinput></screen>
    2634
    27   <para os="c">Directories are, by default, created with permission mode 755,
     35  <para os="d">Directories are, by default, created with permission mode 755,
    2836  but this is not desirable for all directories. In the commands above,
    2937  two changes are made&mdash;one to the home directory of user
     
    3139  directories for temporary files.</para>
    3240
    33   <para os="d">The first mode change ensures that not just anybody can enter
     41  <para os="e">The first mode change ensures that not just anybody can enter
    3442  the <filename class="directory">/root</filename> directory&mdash;the
    3543  same as a normal user would do with his or her home directory. The
     
    4149  1777 bit mask.</para>
    4250
    43   <sect2 os="e">
     51  <sect2 os="f">
    4452    <title>FHS Compliance Note</title>
    4553
  • BOOK/boot/common/devices.xml

    r03679c8 rd2ecc65  
    1818    <title>Creating Initial Device Nodes</title>
    1919
    20     <note os="a">
    21       <para>The commands in the remainder of the book should be run as
    22       the <systemitem class="username">root</systemitem> user. Check
    23       that ${CLFS} is set in the
    24       <systemitem class="username">root</systemitem> user&rsquo;s environment
    25        before proceeding.</para>
    26     </note>
    27 
    2820    <para os="b">When the kernel boots the system, it requires the presence
    2921    of a few device nodes, in particular the <filename
  • BOOK/boot/common/e2fsprogs.xml

    r03679c8 rd2ecc65  
    7777    xpointer="xpointer(//*[@os='l'])"/>
    7878
    79     <para os="ad">Create needed symlinks for a bootable system:</para>
    80 
    81 <screen os="ae"><userinput>ln -sv /tools/sbin/{fsck.ext2,fsck.ext3,fsck.ext4,e2fsck} ${CLFS}/sbin</userinput></screen>
    82 
    83 
    8479  </sect2>
    8580
  • BOOK/boot/common/eudev.xml

    r03679c8 rd2ecc65  
    4646    loaded by <command>udev</command>:</para>
    4747
    48 <screen os="k"><userinput>install -dv ${CLFS}/lib/firmware</userinput></screen>
     48<screen os="k"><userinput>install -dv /tools/lib/firmware</userinput></screen>
    4949
    5050    <para os="r1">Create a dummy rule so that Eudev will name ethernet devices properly for the system.</para>
     
    6868        v4l_id, write_cd_rules, write_net_rules</seg>
    6969        <seg>libudev</seg>
    70         <seg>/etc/udev, /lib/firmware, /lib/udev, /usr/share/doc/udev</seg>
     70        <seg>/tools/etc/udev, /tools/lib/firmware, /tools/lib/udev</seg>
    7171      </seglistitem>
    7272    </segmentedlist>
  • BOOK/boot/common/introduction.xml

    r03679c8 rd2ecc65  
    1515  build the final system packages.</para>
    1616
    17   <para>There are a few additional packages that will need to be
    18   installed to allow you to boot the minimal system. They will be installed
    19   into <filename class="directory">/tools</filename>, but a few additional
    20   files and symlinks will be needed on the CLFS partition to be able to boot
    21   and log in. This will require the
    22   <systemitem class="username">clfs</systemitem> user to have write access to
    23   the rest of the CLFS partition, so you will need to temporarily change the
    24   ownership of ${CLFS} to the <systemitem class="username">clfs</systemitem> user.
    25   Run the following command as <systemitem
    26   class="username">root</systemitem>:</para>
    27 
    28 <screen><userinput>chown -v clfs ${CLFS}</userinput></screen>
    29 
    3017</sect1>
  • BOOK/boot/common/kmod.xml

    r03679c8 rd2ecc65  
    2222  <sect2 role="installation">
    2323    <title>Installation of Kmod</title>
     24
     25    <para os="s1">Tell Kmod to use <filename class="directory">/tools/lib/modules</filename>:</para>
     26
     27<screen os="s2"><userinput>cp -v libkmod/libkmod.c{,.orig}
     28sed '/dirname_default_prefix /s@/lib/modules@/tools&amp;@' \
     29    libkmod/libkmod.c.orig &gt; libkmod/libkmod.c</userinput></screen>
    2430
    2531    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
     
    6369    xpointer="xpointer(//*[@os='i'])"/>
    6470
    65 <screen os="j"><userinput>ln -sv /tools/bin/kmod ${CLFS}/bin
    66 ln -sv kmod ${CLFS}/bin/lsmod
    67 ln -sv ../bin/kmod ${CLFS}/sbin/depmod
    68 ln -sv ../bin/kmod ${CLFS}/sbin/insmod
    69 ln -sv ../bin/kmod ${CLFS}/sbin/modprobe
    70 ln -sv ../bin/kmod ${CLFS}/sbin/modinfo
    71 ln -sv ../bin/kmod ${CLFS}/sbin/rmmod</userinput></screen>
     71<screen os="j"><userinput>ln -sfv kmod /tools/bin/lsmod
     72for tool in depmod insmod modprobe modinfo rmmod; do
     73    ln -sv ../bin/kmod /tools/sbin/${tool}
     74done</userinput></screen>
    7275
    7376  </sect2>
  • BOOK/boot/common/shadow.xml

    r03679c8 rd2ecc65  
    4242sed '/PASSWD_PROGRAM/s@/bin/passwd@/tools&amp;@' config.h.orig &gt; config.h</userinput></screen>
    4343
    44     <para os="h">Compile the package:</para>
     44    <para os="h">Prevent Shadow from setting installed programs suid:</para>
    4545
    46 <screen os="i"><userinput>make</userinput></screen>
     46<screen os="i"><userinput>cp -v src/Makefile{,.orig}
     47sed 's/\(^suidu*bins = \).*/\1/' src/Makefile.orig &gt; src/Makefile</userinput></screen>
    4748
    48     <para os="j">Install the package:</para>
     49    <para os="j">Compile the package:</para>
    4950
    50 <screen os="k"><userinput>make install</userinput></screen>
     51<screen os="k"><userinput>make</userinput></screen>
    5152
    52     <para os="l">Create needed symlinks to be able to log on:</para>
     53    <para os="l">Install the package:</para>
    5354
    54 <screen os="m"><userinput>ln -sv /tools/etc/{login.{access,defs},limits} ${CLFS}/etc</userinput></screen>
     55<screen os="m"><userinput>make install</userinput></screen>
    5556
    5657  </sect2>
  • BOOK/boot/common/sysvinit.xml

    r03679c8 rd2ecc65  
    3939   <para os="e">Install the package:</para>
    4040
    41 <screen os="ad"><userinput>make -C src ROOT=/tools install
    42 ln -svf /tools/sbin/init ${CLFS}/sbin</userinput></screen>
     41<screen os="ad"><userinput>make -C src ROOT=/tools install</userinput></screen>
    4342
    4443  </sect2>
Note: See TracChangeset for help on using the changeset viewer.