1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-22 11:09:46 +01:00

Add utility function for manually stripping files

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
David Oberhollenzer 2018-02-15 14:24:53 +01:00
parent 6d44a92258
commit fa95db618e
11 changed files with 25 additions and 53 deletions

View file

@ -27,7 +27,7 @@ deploy() {
make DESTDIR="$DEPLOY" install
${TARGET}-strip --discard-all ${DEPLOY}/bin/bash
strip_files ${DEPLOY}/bin/bash
ln -sv bash "$DEPLOY/bin/sh"

View file

@ -28,14 +28,8 @@ deploy() {
make DESTDIR="$DEPLOY" install
for library in ${DEPLOY}/lib/*.so; do
${TARGET}-strip --strip-unneeded $library
done
for program in ${DEPLOY}/bin/db_*; do
chmod 755 $program
${TARGET}-strip --discard-all $program
done
chmod 755 ${DEPLOY}/bin/db_*
strip_files ${DEPLOY}/lib/*.so ${DEPLOY}/bin/db_*
rm -r "$DEPLOY/docs"
rm ${DEPLOY}/lib/*.la

View file

@ -35,11 +35,6 @@ deploy() {
# just some script that tells you to use a different command
rm "$DEPLOY/bin/fsck.btrfs"
for i in ${DEPLOY}/bin/*; do
${TARGET}-strip --discard-all $i
done
unset -v i
strip_files ${DEPLOY}/bin/*
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
}

View file

@ -28,10 +28,7 @@ deploy() {
rm -r $DEPLOY/man
${TARGET}-strip --discard-all ${DEPLOY}/bin/bunzip2
${TARGET}-strip --discard-all ${DEPLOY}/bin/bzip2
${TARGET}-strip --discard-all ${DEPLOY}/bin/bzip2recover
${TARGET}-strip --discard-all ${DEPLOY}/bin/bzcat
strip_files ${DEPLOY}/bin/*
rm "$DEPLOY/bin/bzegrep"
rm "$DEPLOY/bin/bzfgrep"

View file

@ -26,7 +26,7 @@ deploy() {
make CC=${TARGET}-gcc PREFIX="/" BINDIR="/bin" DESTDIR="$DEPLOY" install
${TARGET}-strip --discard-all "$DEPLOY/bin/dnsmasq"
strip_files "$DEPLOY/bin/dnsmasq"
rm -r "$DEPLOY/share"
mkdir -p "$DEPLOY/etc"

View file

@ -31,7 +31,5 @@ deploy() {
rm -r "$DEPLOY/share/doc"
rm -r "$DEPLOY/share/man"
for program in arpd bridge devlink genl ifstat ip lnstat nstat rdma rtacct rtmon ss tc tipc; do
${TARGET}-strip --discard-all ${DEPLOY}/bin/$program
done
strip_files ${DEPLOY}/bin/*
}

View file

@ -25,9 +25,7 @@ deploy() {
make DESTDIR="$DEPLOY" install
${TARGET}-strip --discard-all ${DEPLOY}/bin/less
${TARGET}-strip --discard-all ${DEPLOY}/bin/lesskey
${TARGET}-strip --discard-all ${DEPLOY}/bin/lessecho
strip_files ${DEPLOY}/bin/*
rm -r "$DEPLOY/share"
}

View file

@ -33,11 +33,7 @@ deploy() {
rm -r "$DEPLOY/share/man"
rm "$DEPLOY/bin/ncursesw6-config"
for i in ${DEPLOY}/bin/*; do
${TARGET}-strip --discard-all $i
done
unset -v i
strip_files ${DEPLOY}/bin/*
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"

View file

@ -46,21 +46,7 @@ deploy() {
rm -r ${DEPLOY}/share
rm -r ${DEPLOY}/etc
for i in ${DEPLOY}/bin/*; do
if [ -f $i ]; then
${TARGET}-strip --discard-all $i
fi
done
for i in $(find "$DEPLOY/libexec/rc/bin" -type f -print | \
xargs file | grep ELF | cut -d: -f1); do
${TARGET}-strip --discard-all $i
done
for i in $(find "$DEPLOY/libexec/rc/sbin" -type f -print | \
xargs file | grep ELF | cut -d: -f1); do
${TARGET}-strip --discard-all $i
done
strip_files ${DEPLOY}/bin/* ${DEPLOY}/libexec/rc/{bin,sbin}/*
mkdir -p ${DEPLOY}/etc/{conf.d,init.d,runlevels,sysctl.d}
mkdir -p ${DEPLOY}/etc/runlevels/{boot,sysinit,shutdown,default}

View file

@ -34,13 +34,7 @@ deploy() {
rm -r "$DEPLOY/share"
for i in ${DEPLOY}/bin/* ${DEPLOY}/libexec/*; do
if [ -f $i ]; then
${TARGET}-strip --discard-all $i
fi
done
unset -v i
strip_files ${DEPLOY}/bin/* ${DEPLOY}/libexec/*
install -v -m755 "$SOURCE/contrib/ssh-copy-id" "$DEPLOY/bin"
}

View file

@ -6,6 +6,20 @@ apply_patches() {
done
}
strip_files() {
local f
for f in $@; do
if [ ! -f "$f" ]; then
continue
fi
if file $f | grep -q -i elf; then
${TARGET}-strip --discard-all "$f"
fi
done
}
split_dev_deploy() {
local lib f