diff options
author | William Harrington <kb0iic@berzerkula.org> | 2021-03-22 13:14:24 -0500 |
---|---|---|
committer | William Harrington <kb0iic@berzerkula.org> | 2021-03-22 13:14:24 -0500 |
commit | 5ad8b99e3ab66e675836c89bb6e3b935f8506cf8 (patch) | |
tree | 965c5d8370dfcc13410baabdf9c82c5d6af47624 /chapter6/cleanup.sh | |
parent | 590fa7ebfa5f3617de0b5675cb9e4b79f03779ac (diff) |
Add optional cleanup and backup chapter6 scripts. Always nice to backup before working on tasks preparing for chroot.
Diffstat (limited to 'chapter6/cleanup.sh')
-rw-r--r-- | chapter6/cleanup.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/chapter6/cleanup.sh b/chapter6/cleanup.sh new file mode 100644 index 0000000..a457f0d --- /dev/null +++ b/chapter6/cleanup.sh @@ -0,0 +1,21 @@ +if [ -f "${LFS}/sources/chapter6/cleanup" ]; then + echo -e "${YLW}Chapter 6 ${GRN}cleanup already performed.${RST}" +else + + echo -ne "${GRN}Cleaning up ${YLW}${LFS}${RST}... " + + find ${LFS}/usr/lib -name \*.la -delete >/dev/null 2>&1 + find ${LFS}/usr/libexec -name \*.la -delete >/dev/null 2>&1 + + rm -rf /usr/share/doc >/dev/null 2>&1 + rm -rf /usr/share/info >/dev/null 2>&1 + rm -rf /usr/share/man >/dev/null 2>&1 + + strip --strip-debug ${LFS}S/usr/lib/* >/dev/null 2>&1 + strip --strip-unneeded ${LFS}/usr/bin/* >/dev/null 2>&1 + strip --strip-unneeded ${LFS}/usr/sbin/* >/dev/null 2>&1 + strip --strip-unneeded ${LFS}/tools/bin/* >/dev/null 2>&1 + + echo -e "${GRN}OK${RST}" + touch ${LFS}/sources/chapter6/cleanup >/dev/null 2>&1 +fi |