If the intended user is not a programmer and does not plan to do any debugging on the system software, the system size can be decreased by about 200 MB by removing the debugging symbols from binaries and libraries. This causes no inconvenience other than not being able to debug the software fully anymore.
Most people who use the command mentioned below do not experience any difficulties. However, it is easy to make a typo and render the new system unusable, so before running the strip command, it is a good idea to make a backup of the current situation.
Before performing the stripping, take special care to ensure that none of the binaries that are about to be stripped are running. If unsure whether the user entered chroot with the command given in Section 6.3, “Entering the Chroot Environment,” first exit from chroot:
logout
Then reenter it with:
chroot $HLFS /tools/bin/env -i \
HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
PATH=/bin:/usr/bin:/sbin:/usr/sbin \
/tools/bin/bash --login
Strip the libraries. Remember, stripping “unneeded” or “all” from libraries will destroy them:
/tools/bin/find /{,usr}/lib -type f \
-exec /tools/bin/strip --strip-debug '{}' ';'
Then strip the programs:
/tools/bin/strip --strip-all /{,usr/}{bin,sbin}/*
A large number of files will be reported as having their file format not recognized. These warnings can be safely ignored. These warnings indicate that those files are scripts instead of binaries.
Gawk put a couple programs in /usr/lib,
they can be completely stripped:
/tools/bin/strip --strip-all /usr/lib/awk/{grcat,pwcat}
A couple GCC programs are located in /usr/lib, they can be fully stripped:
/tools/bin/strip --strip-all \
/usr/lib/gcc/$(uname -m)-pc-linux-uclibc/4.1.2/{cc1*,collect2}