aboutsummaryrefslogtreecommitdiffstats
path: root/chapter6/cleanup.sh
blob: 0eb80a2e506e3eed2bd24c45f575b4abe16a23c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash

if [ -f "${LFS}/sources/chapter6/cleanup" ]; then
	printf "%b" "  ${IGRN}Cleanup already performed${RST}\n"
else

	printf "%b" "${GRN}Cleaning up ${YLW}${LFS}${RST}... "

	{
	find "${LFS}"/usr/lib -name \*.la -delete 
	find "${LFS}"/usr/libexec -name \*.la -delete 

	rm -rfv "${LFS}"/usr/share/doc 
	rm -rfv "${LFS}"/usr/share/info 
	rm -rfv "${LFS}"/usr/share/man 

	strip --strip-debug "${LFS}"/usr/lib/*
	strip --strip-unneeded "${LFS}"/usr/bin/*
	strip --strip-unneeded "${LFS}"/usr/sbin/*
	strip --strip-unneeded "${LFS}"/tools/bin/*

} >"${LFS}"/sources/log/chapter6/cleanup.log 2>&1

	printf "%b" "${IGRN}OK${RST}\n"
	touch "${LFS}"/sources/chapter6/cleanup 
fi