diff --git a/chapter07/stripping.xml b/chapter07/stripping.xml
index 66b20d4fc..88b44b883 100644
--- a/chapter07/stripping.xml
+++ b/chapter07/stripping.xml
@@ -16,22 +16,70 @@
a backup of the temporary tools.
+
+ The following steps are performed from outside the chroot
+ environment. That means, you have to leave the chroot environment
+ first before continuing. The reason for that is to
+
+
+
+ make sure that objects are not in use while they gets
+ manipulated.
+
+
+
+
+ get access to file system locations outside of the chroot
+ environment to store/read the backup archive which should
+ not be placed within the
+ $LFS hierarchy for
+ safety reasons.
+
+
+
+
+
+
+ Leave the chroot environment and unmount the kernel virtual file
+ systems:
+
+
+exit
+umount $LFS/dev{/pts,}
+umount $LFS/{sys,proc,run}
+
+
+ All of the following instructions are executed by
+ root. Take extra
+ care about the commands you're going to run as mistakes
+ here can modify your host system. Be aware that the
+ environment variable LFS is set for user
+ lfs by default
+ but it might not be set for
+ root. Whenever
+ commands are to be executed by root,
+ make sure you have set LFS accordingly.
+ This has been discussed in .
+
+
+
Stripping
If the LFS partition is rather small, it is beneficial to
- learn that unnecessary items can be removed.
- The executables and libraries built so far contain about 70 MB of unneeded
- debugging symbols.
+ learn that unnecessary items can be removed. The executables and
+ libraries built so far contain about 94 MB of unneeded debugging
+ symbols.
-strip --strip-debug /usr/lib/*
-strip --strip-unneeded /usr/{,s}bin/*
-strip --strip-unneeded /tools/bin/*
+ Strip off debugging symbols from binaries:
+strip --strip-debug $LFS/usr/lib/*
+strip --strip-unneeded $LFS/usr/{,s}bin/*
+strip --strip-unneeded $LFS/tools/bin/*
These commands will skip a number of files reporting that it does not
recognize their file format. Most of these are scripts instead of binaries.
Take care NOT to use
@@ -39,22 +87,22 @@ strip --strip-unneeded /tools/bin/*
ones would be destroyed and the toolchain packages would need to be
built all over again.
- To save more space, remove the documentation:
+ To save more space (about 37 MB), remove the documentation:
-rm -rf /usr/{,share}/{info,man,doc}
+rm -rf $LFS/usr/share/{info,man,doc}
The libtool .la files are only useful when linking with static
libraries. They are unneeded, and potentially harmful, when using dynamic
shared libraries, specially when using non-autotools build systems.
Remove those files now:
-find /usr/{lib,libexec} -name \*.la -delete
+find $LFS/usr/{lib,libexec} -name \*.la -delete
At this point, you should have at least 5 GB of free space on the
chroot partition that can be used to build and install Glibc and Gcc in
the next phase. If you can build and install Glibc, you can build and install
the rest too. You can check the free disk space with the command
- df -h /.
+ df -h $LFS/.
@@ -68,29 +116,27 @@ strip --strip-unneeded /tools/bin/*
backed up for later reuse. In case of fatal failures in the subsequent
chapters, it often turns out that removing everything and starting over
(more carefully) is the best option to recover. Unfortunatly, all the
- temporary tools will be removed, too. To avoid the extra time needed to redo
- something which has been built successfully, prepare a backup.
+ temporary tools will be removed, too. To avoid spending extra time to
+ redo something which has been built successfully, prepare a backup.
- Leave the chroot environment and make sure you have at least
- 600 MB free disk space (the source tarballs will be included in
- the backup archive) in the home directory of user
- lfs. Leaving the
- chroot environment is required as the backup should be stored
- outside of the $LFS directory
- but those cannot be accessed when in chroot. Leave the chroot environment
- and unmount the virtual kernel filesystems:
+ Make sure you have at least 600 MB free disk space (the source tarballs
+ will be included in the backup archive) in the home directory of user
+ root.
-exit
-umount $LFS/dev{/pts,}
-umount $LFS/{sys,proc,run}
-
- Create the backup archive:
+
+ Create the backup archive by running the following command:
+
cd $LFS &&
tar -cJpf $HOME/temp-tools.tar.xz .
+
+ Replace $HOME by a directory of your choice if you
+ do not want to have the backup stored in root's
+ home directory.
+
In case some mistakes have been made and you need to start over, you can
@@ -114,12 +160,13 @@ tar -xpf $HOME/temp-tools.tar.xz
- If you left the chroot environment either to create a backup
- or restart building using a restore, remember to mount the
- kernel virtual filesystems as described in and re-enter the
- chroot environment (see ) again before continuing.
+ If you left the chroot environment either to strip off debug
+ symbols, create a backup or restart building using a restore,
+ remember to mount the kernel virtual filesystems now again as
+ described in and re-enter
+ the chroot environment (see )
+ again before continuing.
+