smart-os/mk_strip.sh

49 lines
853 B
Bash
Raw Normal View History

2022-07-28 23:43:44 +08:00
#!/bin/sh
2022-07-31 18:36:44 +08:00
# 导入公共环境
. ./common.sh
2022-07-28 23:43:44 +08:00
strip_dir() {
for file in `ls $1`
do
if [ -d $1"/"$file ]; then
strip_dir $1"/"$file
else
if [ -x $1"/"$file ]; then
case "$file" in
*.a);;
*.la);;
*)strip $1"/"$file; continue;;
esac
fi
case "$file" in
*.a) strip -g -S -d $1"/"$file;;
*.so) strip $1"/"$file;;
*.so.*) strip $1"/"$file;;
*);;
esac
fi
done
}
# strip glibc
2022-07-31 18:36:44 +08:00
rm -rf ${glibc_install}/usr/share
strip_dir ${glibc_install}
2022-07-28 23:43:44 +08:00
# strip busybox
2022-07-31 18:36:44 +08:00
rm -rf ${busybox_install}/linuxrc
strip ${busybox_install}/bin/busybox
2022-07-28 23:43:44 +08:00
# strip gcc
2022-07-31 01:54:15 +08:00
#rm -rf work/libgcc_install/usr/share
2022-07-31 18:36:44 +08:00
strip_dir ${gcc_install}
2022-07-28 23:43:44 +08:00
# strip binutils
2022-07-31 01:54:15 +08:00
#rm -rf work/binutils_install/usr/share
2022-07-31 18:36:44 +08:00
strip_dir ${binutils_install}
2022-07-28 23:43:44 +08:00
2022-09-26 20:56:15 +08:00
# strip xfce
if [ "${with_xfce}" = true ]; then
strip_dir ${xfce_install}
fi