size reduction of iso - 6.4G

master
phanes 2023-05-26 12:34:19 -04:00
parent 2ce0b4fb7a
commit 93f40be56e
5 changed files with 85 additions and 3 deletions

View File

@ -69,3 +69,4 @@ if [ -n "$1" ]; then
fi
# EOF
COLORTERM="truecolor"

View File

@ -44,5 +44,5 @@ echo -e "\e[31m$HORSE\e[0m"
echo
echo "Welcome to Pyrois, the build system for Dark Horse Linux."
echo
echo "LIVD CD GENERATOR"
echo "LIVE CD GENERATOR"
echo

View File

@ -489,7 +489,7 @@ if \
[ "$MODE_BUILD_GCC_PASS1" != "true" ] && \
[ "$MODE_INSTALL_GCC_PASS1" != "true" ] && \
[ "$MODE_BUILD_GCC_PASS2" != "true" ] && \
[ "$MODE_INSTALL_PASS2" != "true" ] && \
[ "$MODE_INSTALL_GCC_PASS2" != "true" ] && \
[ "$MODE_BUILD_LIBSTDCXX_PASS1" != "true" ] && \
[ "$MODE_INSTALL_LIBSTDCXX_PASS1" != "true" ] && \
[ "$MODE_BUILD_LIBSTDCXX_PASS2" != "true" ] && \

View File

@ -41,6 +41,88 @@ logprint "Deleting temporary toolchain..."
find /usr -depth -name ${T_TRIPLET}\* | xargs rm -vrf
assert_zero $?
# almost directly lifted from LFS
logprint "Stripping Debuginfo..."
save_usrlib="$(cd /usr/lib; ls ld-linux*[^g])
libc.so.6
libthread_db.so.1
libquadmath.so.0.0.0
libstdc++.so.6.0.30
libitm.so.1.0.0
libatomic.so.1.2.0"
pushd /usr/lib
for LIB in $save_usrlib; do
logprint "Stripping LIB:\t$LIB"
objcopy --only-keep-debug $LIB $LIB.dbg
cp $LIB /tmp/$LIB
assert_zero $?
strip --strip-unneeded /tmp/$LIB
assert_zero $?
objcopy --add-gnu-debuglink=$LIB.dbg /tmp/$LIB
assert_zero $?
install -vm755 /tmp/$LIB /usr/lib
assert_zero $?
done
online_usrbin="bash find strip"
online_usrlib="libbfd-2.40.so
libsframe.so.0.0.0
libhistory.so.8.2
libncursesw.so.6.4
libm.so.6
libreadline.so.8.2
libz.so.1.2.13
$(cd /usr/lib; find libnss*.so* -type f)"
for BIN in $online_usrbin; do
logprint "Stripping BIN:\t$BIN"
cp /usr/bin/$BIN /tmp/$BIN
assert_zero $?
strip --strip-unneeded /tmp/$BIN
assert_zero $?
install -vm755 /tmp/$BIN /usr/bin
assert_zero $?
done
LIB=""
for LIB in $online_usrlib; do
logprint "Stripping LIB:\t$LIB"
cp /usr/lib/$LIB /tmp/$LIB
assert_zero $?
strip --strip-unneeded /tmp/$LIB
assert_zero $?
install -vm755 /tmp/$LIB /usr/lib
assert_zero $?
done
for i in $(find /usr/lib -type f -name \*.so* ! -name \*dbg) \
$(find /usr/lib -type f -name \*.a) \
$(find /usr/{bin,sbin,libexec} -type f); do
case "$online_usrbin $online_usrlib $save_usrlib" in
*$(basename $i)* )
;;
* ) strip --strip-unneeded $i
;;
esac
done
echo; echo; echo
logprint "Cleaning /tmp/"
rm -Rf /tmp/*
assert_zero $?
logprint "Cleanup .la files..."
find /usr/lib /usr/libexec -name \*.la -delete
assert_zero $?
logprint "Removing temporary tools..."
find /usr -depth -name "${T_TRIPLET}*" -exec rm -rf {} \;
assert_zero $?
# TODO better integrate test user lifecycle
logprint "Execution of ${APPNAME} completed."

View File

@ -198,7 +198,6 @@ mode_install() {
useradd -D --gid 999
assert_zero $?
logprint "Install operation complete."
}