aboutsummaryrefslogtreecommitdiffstats
path: root/chapter7
diff options
context:
space:
mode:
Diffstat (limited to 'chapter7')
-rw-r--r--chapter7/cleanup.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/chapter7/cleanup.sh b/chapter7/cleanup.sh
new file mode 100644
index 0000000..b300e7e
--- /dev/null
+++ b/chapter7/cleanup.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+if [ -f "${LFS}/sources/chapter7/cleanup" ]; then
+ echo -e "${YLW}Chapter 7 ${GRN}cleanup already performed.${RST}"
+else
+
+ echo -ne "${GRN}Cleaning up ${YLW}${LFS}${RST}... "
+
+ sudo find "${LFS}"/usr/lib -name \*.la -delete >/dev/null 2>&1
+ sudo find "${LFS}"/usr/libexec -name \*.la -delete >/dev/null 2>&1
+
+ sudo rm -rf "${LFS}"/usr/share/doc >/dev/null 2>&1
+ sudo rm -rf "${LFS}"/usr/share/info >/dev/null 2>&1
+ sudo rm -rf "${LFS}"/usr/share/man >/dev/null 2>&1
+
+ sudo strip --strip-debug "${LFS}"/usr/lib/* >/dev/null 2>&1
+ sudo strip --strip-unneeded "${LFS}"/usr/bin/* >/dev/null 2>&1
+ sudo strip --strip-unneeded "${LFS}"/usr/sbin/* >/dev/null 2>&1
+ sudo strip --strip-unneeded "${LFS}"/tools/bin/* >/dev/null 2>&1
+
+ echo -e "${GRN}OK${RST}"
+ touch "${LFS}"/sources/chapter7/cleanup >/dev/null 2>&1
+fi