mirror of
https://github.com/pygos/build.git
synced 2024-11-22 02:59:47 +01:00
Add utility function for manually stripping files
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
parent
6d44a92258
commit
fa95db618e
11 changed files with 25 additions and 53 deletions
|
@ -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"
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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/*
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
14
util/misc.sh
14
util/misc.sh
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue