Ignore:
Timestamp:
09/20/2021 07:37:34 AM (3 years ago)
Author:
Thomas Trepl (Moody) <thomas@…>
Branches:
multilib
Children:
60870bc
Parents:
e680022 (diff), 7e62bbc (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge upstream

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapter07/cleanup.xml

    re680022 r716db1f  
    1010
    1111  <title>Cleaning up and Saving the Temporary System</title>
    12  
     12
    1313  <sect2>
    1414    <title>Cleaning</title>
     
    2121    <para>Second, the libtool .la files are only useful when linking with static
    2222    libraries. They are unneeded and potentially harmful when using dynamic
    23     shared libraries, specially when using non-autotools build systems.
     23    shared libraries, especially when using non-autotools build systems.
    2424    While still in chroot, remove those files now:</para>
    2525
     
    3030
    3131    <para>
    32       The current system size is now about 3 GB, however 
     32      The current system size is now about 3 GB, however
    3333      the /tools directory is no longer needed. It uses about
    3434      1 GB of disk space.  Delete it now:
     
    4141    <title>Backup</title>
    4242
     43    <para>
     44      At this point the essential programs and libraries have been created
     45      and your current LFS system is in a good state. Your system can now be
     46      backed up for later reuse. In case of fatal failures in the subsequent
     47      chapters, it often turns out that removing everything and starting over
     48      (more carefully) is the best option to recover. Unfortunately, all the
     49      temporary files will be removed, too. To avoid spending extra time to
     50      redo something which has been built successfully, creating a backup of
     51      the current LFS system may prove useful.
     52    </para>
     53
    4354    <note><para>
    4455      All the remaining steps in this section are optional. Nevertheless,
     
    4657      linkend="chapter-building-system"/>, the temporary files will be
    4758      overwritten. So it may be a good idea to do a backup of the current
    48       system as described below. 
     59      system as described below.
    4960    </para></note>
    50  
     61
    5162    <para>
    5263      The following steps are performed from outside the chroot
     
    6071    </para>
    6172
     73    <para>
     74       If you have decided to make a backup, leave the chroot environment:
     75    </para>
     76
     77<screen role="nodump"><userinput>exit</userinput></screen>
     78
    6279    <important>
    63       <para>All of the following instructions are executed by
    64         <systemitem class="username">root</systemitem>. Take extra
    65         care about the commands you're going to run as mistakes
     80      <para>
     81        All of the following instructions are executed by
     82        <systemitem class="username">root</systemitem> on your host system.
     83        Take extra care about the commands you're going to run as mistakes
    6684        here can modify your host system. Be aware that the
    67         environment variable <envar>LFS</envar>
    68         is set for user <systemitem class="username">lfs</systemitem> by default
    69         but may <emphasis>not</emphasis> be set for
    70         <systemitem class="username">root</systemitem>. Whenever
    71         commands are to be executed by <systemitem class="username">root</systemitem>,
     85        environment variable <envar>LFS</envar>
     86        is set for user <systemitem class="username">lfs</systemitem> by default
     87        but may <emphasis>not</emphasis> be set for
     88        <systemitem class="username">root</systemitem>.
     89     </para>
     90     <para>
     91        Whenever commands are to be executed by <systemitem class="username">root</systemitem>,
    7292        make sure you have set <envar>LFS</envar>.
     93     </para>
     94     <para>
    7395        This has been discussed in <xref linkend='ch-partitioning-aboutlfs'/>.
    7496      </para>
    7597    </important>
    7698
    77     <para>
    78        Now, if you are making a backup, leave the chroot environment:
    79     </para>
     99    <para>Before making a backup, unmount the virtual file systems:</para>
    80100
    81 <screen role="nodump"><userinput>exit</userinput></screen>
     101<screen role="nodump"><userinput>umount $LFS/dev/pts
     102umount $LFS/{sys,proc,run,dev}</userinput></screen>
    82103
    83104    <para>
    84       At this point the essential programs and libraries have been created
    85       and your current system is in a good state. Your system can now be
    86       backed up for later reuse. In case of fatal failures in the subsequent
    87       chapters, it often turns out that removing everything and starting over
    88       (more carefully) is the best option to recover. Unfortunately, all the
    89       temporary files will be removed, too. To avoid spending extra time to
    90       redo something which has been built successfully, prepare a backup.
     105      Make sure you have at least 1 GB free disk space (the source tarballs
     106      will be included in the backup archive) on the filesystem containing
     107      directory where you create the backup archive.
    91108    </para>
    92109
    93110    <para>
    94       Make sure you have at least 1 GB free disk space (the source tarballs
    95       will be included in the backup archive) in the home directory of user
    96       <systemitem class="username">root</systemitem>.
     111      Note that the instructions below specify the home directory of the host
     112      system's <systemitem class="username">root</systemitem> user, which is
     113      typically found on the root filesystem.
    97114    </para>
    98115
    99     <para>Before we make a backup, unmount the virtual file systems:</para>
    100 
    101 <screen role="nodump"><userinput>umount $LFS/dev{/pts,}
    102 umount $LFS/{sys,proc,run}</userinput></screen>
     116    <para>
     117      Replace <envar>$HOME</envar> by a directory of your choice if you
     118      do not want to have the backup stored in <systemitem
     119      class="username">root</systemitem>'s home directory.
     120    </para>
    103121
    104122    <para>
     
    111129          long time (over 10 minutes) even on a resonably fast system.
    112130       </para>
    113        
    114        <para>
    115           Also, ensure the <envar>LFS</envar> environment variable is set
    116           for the root user.
    117        </para>
    118131    </note>
    119132
    120 <screen role="nodump" revision="sysv"><userinput>cd $LFS 
     133<screen role="nodump" revision="sysv"><userinput>cd $LFS
    121134tar -cJpf $HOME/lfs-temp-tools-&version;.tar.xz .</userinput></screen>
    122135
    123 <screen role="nodump" revision="systemd"><userinput>cd $LFS 
     136<screen role="nodump" revision="systemd"><userinput>cd $LFS
    124137tar -cJpf $HOME/lfs-temp-tools-&versiond;.tar.xz .</userinput></screen>
    125138
    126     <para>
    127       Replace <envar>$HOME</envar> by a directory of your choice if you
    128       do not want to have the backup stored in <systemitem
    129       class="username">root</systemitem>'s home directory.
    130     </para>
    131139  </sect2>
    132140
     
    137145      In case some mistakes have been made and you need to start over, you can
    138146      use this backup to restore the system and save some recovery time.
    139       Since the sources are located under 
     147      Since the sources are located under
    140148      <filename class="directory">$LFS</filename>, they are included in the
    141149      backup archive as well, so they do not need to be downloaded again. After
     
    148156
    149157    <warning><para>The following commands are extremly dangerous.  If
    150     you run <command>rm -rf ./*</command> as the root user and you 
    151     do not change to the $LFS directory or the <envar>LFS</envar> 
    152     environment variable is not set for the root user, it will destroy 
     158    you run <command>rm -rf ./*</command> as the root user and you
     159    do not change to the $LFS directory or the <envar>LFS</envar>
     160    environment variable is not set for the root user, it will destroy
    153161    your entire host system.  YOU ARE WARNED.</para></warning>
    154162
    155 <screen role="nodump" revision="sysv"><computeroutput>cd $LFS 
    156 rm -rf ./* 
     163<screen role="nodump" revision="sysv"><computeroutput>cd $LFS
     164rm -rf ./*
    157165tar -xpf $HOME/lfs-temp-tools-&version;.tar.xz</computeroutput></screen>
    158166
    159 <screen role="nodump" revision="systemd"><computeroutput>cd $LFS 
    160 rm -rf ./* 
     167<screen role="nodump" revision="systemd"><computeroutput>cd $LFS
     168rm -rf ./*
    161169tar -xpf $HOME/lfs-temp-tools-&versiond;.tar.xz</computeroutput></screen>
    162170
     
    176184       </para>
    177185    </important>
    178    
     186
    179187  </sect2>
    180188
Note: See TracChangeset for help on using the changeset viewer.