smart-os/mk_strip.sh

68 lines
1.1 KiB
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-10-24 22:14:20 +08:00
# 对指定的目录进行 strip
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
2022-10-24 22:14:20 +08:00
strip_dir ${busybox_install}/bin/busybox
# strip lshw
strip_dir ${lshw_install}
# strip pciutils_install
strip_dir ${pciutils_install}
# strip lsof
strip_dir ${lsof_install}
# strip strace
strip_dir ${strace_install}
# strip openssl
strip_dir ${openssl_install}
# strip openssh
strip_dir ${openssh_install}
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