diff options
author | Christian Breunig <christian@breunig.cc> | 2023-10-09 08:17:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-09 08:17:19 +0200 |
commit | c0662f75cd8a54ed728acbc4d886bb7fca1898e7 (patch) | |
tree | c49d06cd81b100f80b7ebb4125561d792331c1e8 /data | |
parent | 168a86e1dba06d4f464a23cc7f1b79003cb777e9 (diff) | |
parent | d47424822da07d8fa7e0c7668736713549927403 (diff) | |
download | vyos-build-c0662f75cd8a54ed728acbc4d886bb7fca1898e7.tar.gz vyos-build-c0662f75cd8a54ed728acbc4d886bb7fca1898e7.zip |
Merge pull request #434 from Apachez-/T5589
T5589: Nonstripped binaries exists in VyOS
Diffstat (limited to 'data')
-rwxr-xr-x | data/live-build-config/hooks/live/99-strip-symbols.chroot | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/data/live-build-config/hooks/live/99-strip-symbols.chroot b/data/live-build-config/hooks/live/99-strip-symbols.chroot index ba3356ca..704f9cb3 100755 --- a/data/live-build-config/hooks/live/99-strip-symbols.chroot +++ b/data/live-build-config/hooks/live/99-strip-symbols.chroot @@ -27,16 +27,23 @@ STRIPDIR_UNNEEDED=" /usr/libx32 /usr/sbin " +STRIP_EXCLUDE=`dpkg-query -L libbinutils | grep '.so'` # Perform stuff. echo "Stripping symbols..." +# List excluded files. +echo "Exclude files: ${STRIP_EXCLUDE}" + # CMD: strip for DIR in ${STRIPDIR_REGULAR}; do echo "Parse dir (strip): ${DIR}" find ${DIR} -type f -exec file {} \; | grep 'not stripped' | cut -d ":" -f 1 | while read FILE; do - echo "Strip file (strip): ${FILE}" - ${STRIPCMD_REGULAR} ${FILE} + echo "${STRIP_EXCLUDE}" | grep -F -q -w "${FILE}" + if [ $? -ne 0 ]; then + echo "Strip file (strip): ${FILE}" + ${STRIPCMD_REGULAR} ${FILE} + fi done done @@ -44,8 +51,11 @@ done for DIR in ${STRIPDIR_DEBUG}; do echo "Parse dir (strip-debug): ${DIR}" find ${DIR} -type f -exec file {} \; | grep 'not stripped' | cut -d ":" -f 1 | while read FILE; do - echo "Strip file (strip-debug): ${FILE}" - ${STRIPCMD_DEBUG} ${FILE} + echo "${STRIP_EXCLUDE}" | grep -F -q -w "${FILE}" + if [ $? -ne 0 ]; then + echo "Strip file (strip-debug): ${FILE}" + ${STRIPCMD_DEBUG} ${FILE} + fi done done @@ -53,8 +63,11 @@ done for DIR in ${STRIPDIR_UNNEEDED}; do echo "Parse dir (strip-unneeded: ${DIR}" find ${DIR} -type f -exec file {} \; | grep 'not stripped' | cut -d ":" -f 1 | while read FILE; do - echo "Strip file (strip-unneeded): ${FILE}" - ${STRIPCMD_UNNEEDED} ${FILE} + echo "${STRIP_EXCLUDE}" | grep -F -q -w "${FILE}" + if [ $? -ne 0 ]; then + echo "Strip file (strip-unneeded): ${FILE}" + ${STRIPCMD_UNNEEDED} ${FILE} + fi done done |