Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T5589: Nonstripped binaries exists in VyOS #434

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions data/live-build-config/hooks/live/99-strip-symbols.chroot
Original file line number Diff line number Diff line change
Expand Up @@ -27,34 +27,47 @@ 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

# CMD: strip --strip-debug
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

# CMD: strip --strip-unneeded
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

Expand Down
Loading