aboutsummaryrefslogtreecommitdiffstats
path: root/chapter8/cleanup.sh
diff options
context:
space:
mode:
authorWilliam Harrington <kb0iic@berzerkula.org>2021-04-08 18:49:04 -0500
committerWilliam Harrington <kb0iic@berzerkula.org>2021-04-08 18:49:04 -0500
commitdd8ac86ccddee8f91a47fe332991105be8d3bf8e (patch)
tree71feb4025036d8efcb63b0ec40b012fbad45fdf2 /chapter8/cleanup.sh
parent6fe7cbce4bdf80bc357fa5501aa69590772cfc57 (diff)
Add shellcheck parsing directives.
Diffstat (limited to 'chapter8/cleanup.sh')
-rw-r--r--chapter8/cleanup.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/chapter8/cleanup.sh b/chapter8/cleanup.sh
index 46c152d..ed62e18 100644
--- a/chapter8/cleanup.sh
+++ b/chapter8/cleanup.sh
@@ -26,7 +26,7 @@ else
# Place debugging symbols for selected libraries in seprate files
save_lib="ld-2.33.so libc-2.33.so libpthread-2.33.so libthread_db-1.0.so"
- cd "${LFS}"/lib || exit 1
+ pushd "${LFS}"/lib || exit 1
for LIB in $save_lib; do
sudo objcopy --only-keep-debug "${LIB}" "${LIB}".dbg
@@ -34,9 +34,11 @@ else
sudo objcopy --add-gnu-debuglink="${LIB}".dbg "${LIB}"
done
+ popd || exit 1
+
save_usrlib="libquadmath.so.0.0.0 libstdc++.so.6.0.28 libitm.so.1.0.0 libatomic.so.1.2.0"
- cd "${LFS}"/usr/lib || exit 1
+ pushd "${LFS}"/usr/lib || exit 1
for LIB in $save_usrlib; do
sudo objcopy --only-keep-debug "${LIB}" "${LIB}".dbg
@@ -44,6 +46,8 @@ else
sudo objcopy --add-gnu-debuglink="${LIB}".dbg "${LIB}"
done
+ popd || exit 1
+
sudo find "${LFS}"/usr/lib -type f -name \*.a -exec strip --strip-debug {} ';'
sudo find "${LFS}"/lib -type f -name \*.so* ! -name \*dbg -exec strip --strip-unneeded {} ';'
sudo find "${LFS}"/usr/lib -type f -name \*.so* ! -name \*dbg -exec strip --strip-unneeded {} ';'