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:
parent
6d44a92258
commit
fa95db618e
11 changed files with 25 additions and 53 deletions
|
@ -27,7 +27,7 @@ deploy() {
|
||||||
|
|
||||||
make DESTDIR="$DEPLOY" install
|
make DESTDIR="$DEPLOY" install
|
||||||
|
|
||||||
${TARGET}-strip --discard-all ${DEPLOY}/bin/bash
|
strip_files ${DEPLOY}/bin/bash
|
||||||
|
|
||||||
ln -sv bash "$DEPLOY/bin/sh"
|
ln -sv bash "$DEPLOY/bin/sh"
|
||||||
|
|
||||||
|
|
|
@ -28,14 +28,8 @@ deploy() {
|
||||||
|
|
||||||
make DESTDIR="$DEPLOY" install
|
make DESTDIR="$DEPLOY" install
|
||||||
|
|
||||||
for library in ${DEPLOY}/lib/*.so; do
|
chmod 755 ${DEPLOY}/bin/db_*
|
||||||
${TARGET}-strip --strip-unneeded $library
|
strip_files ${DEPLOY}/lib/*.so ${DEPLOY}/bin/db_*
|
||||||
done
|
|
||||||
|
|
||||||
for program in ${DEPLOY}/bin/db_*; do
|
|
||||||
chmod 755 $program
|
|
||||||
${TARGET}-strip --discard-all $program
|
|
||||||
done
|
|
||||||
|
|
||||||
rm -r "$DEPLOY/docs"
|
rm -r "$DEPLOY/docs"
|
||||||
rm ${DEPLOY}/lib/*.la
|
rm ${DEPLOY}/lib/*.la
|
||||||
|
|
|
@ -35,11 +35,6 @@ deploy() {
|
||||||
# just some script that tells you to use a different command
|
# just some script that tells you to use a different command
|
||||||
rm "$DEPLOY/bin/fsck.btrfs"
|
rm "$DEPLOY/bin/fsck.btrfs"
|
||||||
|
|
||||||
for i in ${DEPLOY}/bin/*; do
|
strip_files ${DEPLOY}/bin/*
|
||||||
${TARGET}-strip --discard-all $i
|
|
||||||
done
|
|
||||||
|
|
||||||
unset -v i
|
|
||||||
|
|
||||||
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
|
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,10 +28,7 @@ deploy() {
|
||||||
|
|
||||||
rm -r $DEPLOY/man
|
rm -r $DEPLOY/man
|
||||||
|
|
||||||
${TARGET}-strip --discard-all ${DEPLOY}/bin/bunzip2
|
strip_files ${DEPLOY}/bin/*
|
||||||
${TARGET}-strip --discard-all ${DEPLOY}/bin/bzip2
|
|
||||||
${TARGET}-strip --discard-all ${DEPLOY}/bin/bzip2recover
|
|
||||||
${TARGET}-strip --discard-all ${DEPLOY}/bin/bzcat
|
|
||||||
|
|
||||||
rm "$DEPLOY/bin/bzegrep"
|
rm "$DEPLOY/bin/bzegrep"
|
||||||
rm "$DEPLOY/bin/bzfgrep"
|
rm "$DEPLOY/bin/bzfgrep"
|
||||||
|
|
|
@ -26,7 +26,7 @@ deploy() {
|
||||||
|
|
||||||
make CC=${TARGET}-gcc PREFIX="/" BINDIR="/bin" DESTDIR="$DEPLOY" install
|
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"
|
rm -r "$DEPLOY/share"
|
||||||
|
|
||||||
mkdir -p "$DEPLOY/etc"
|
mkdir -p "$DEPLOY/etc"
|
||||||
|
|
|
@ -31,7 +31,5 @@ deploy() {
|
||||||
rm -r "$DEPLOY/share/doc"
|
rm -r "$DEPLOY/share/doc"
|
||||||
rm -r "$DEPLOY/share/man"
|
rm -r "$DEPLOY/share/man"
|
||||||
|
|
||||||
for program in arpd bridge devlink genl ifstat ip lnstat nstat rdma rtacct rtmon ss tc tipc; do
|
strip_files ${DEPLOY}/bin/*
|
||||||
${TARGET}-strip --discard-all ${DEPLOY}/bin/$program
|
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,9 +25,7 @@ deploy() {
|
||||||
|
|
||||||
make DESTDIR="$DEPLOY" install
|
make DESTDIR="$DEPLOY" install
|
||||||
|
|
||||||
${TARGET}-strip --discard-all ${DEPLOY}/bin/less
|
strip_files ${DEPLOY}/bin/*
|
||||||
${TARGET}-strip --discard-all ${DEPLOY}/bin/lesskey
|
|
||||||
${TARGET}-strip --discard-all ${DEPLOY}/bin/lessecho
|
|
||||||
|
|
||||||
rm -r "$DEPLOY/share"
|
rm -r "$DEPLOY/share"
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,11 +33,7 @@ deploy() {
|
||||||
rm -r "$DEPLOY/share/man"
|
rm -r "$DEPLOY/share/man"
|
||||||
rm "$DEPLOY/bin/ncursesw6-config"
|
rm "$DEPLOY/bin/ncursesw6-config"
|
||||||
|
|
||||||
for i in ${DEPLOY}/bin/*; do
|
strip_files ${DEPLOY}/bin/*
|
||||||
${TARGET}-strip --discard-all $i
|
|
||||||
done
|
|
||||||
|
|
||||||
unset -v i
|
|
||||||
|
|
||||||
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
|
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
|
||||||
|
|
||||||
|
|
|
@ -46,21 +46,7 @@ deploy() {
|
||||||
rm -r ${DEPLOY}/share
|
rm -r ${DEPLOY}/share
|
||||||
rm -r ${DEPLOY}/etc
|
rm -r ${DEPLOY}/etc
|
||||||
|
|
||||||
for i in ${DEPLOY}/bin/*; do
|
strip_files ${DEPLOY}/bin/* ${DEPLOY}/libexec/rc/{bin,sbin}/*
|
||||||
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
|
|
||||||
|
|
||||||
mkdir -p ${DEPLOY}/etc/{conf.d,init.d,runlevels,sysctl.d}
|
mkdir -p ${DEPLOY}/etc/{conf.d,init.d,runlevels,sysctl.d}
|
||||||
mkdir -p ${DEPLOY}/etc/runlevels/{boot,sysinit,shutdown,default}
|
mkdir -p ${DEPLOY}/etc/runlevels/{boot,sysinit,shutdown,default}
|
||||||
|
|
|
@ -34,13 +34,7 @@ deploy() {
|
||||||
|
|
||||||
rm -r "$DEPLOY/share"
|
rm -r "$DEPLOY/share"
|
||||||
|
|
||||||
for i in ${DEPLOY}/bin/* ${DEPLOY}/libexec/*; do
|
strip_files ${DEPLOY}/bin/* ${DEPLOY}/libexec/*
|
||||||
if [ -f $i ]; then
|
|
||||||
${TARGET}-strip --discard-all $i
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
unset -v i
|
|
||||||
|
|
||||||
install -v -m755 "$SOURCE/contrib/ssh-copy-id" "$DEPLOY/bin"
|
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
|
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() {
|
split_dev_deploy() {
|
||||||
local lib f
|
local lib f
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue