Blame SOURCES/remove-buildids.sh

d557d5
#!/bin/bash
d557d5
d557d5
JAVA_HOME=$1
d557d5
d557d5
# remove build id in ELF file $1
d557d5
remove_buildid() {
d557d5
   echo "Removing build id from $1"
d557d5
   objcopy --rename-section=.note.gnu.build-id=.ignore.note.gnu.build-id "$1"
d557d5
}
d557d5
d557d5
remove_buildids_in() {
d557d5
    for f in $(find $1 -type f) ; do
d557d5
        echo "$f"
d557d5
        if [ -f $f ]; then
d557d5
            file $f | grep ELF > /dev/null 2>&1
d557d5
            is_elf=$?
d557d5
            if [ $is_elf -eq 0 ] ; then
d557d5
                remove_buildid $f
d557d5
            fi
d557d5
        fi
d557d5
    done
d557d5
}
d557d5
d557d5
remove_buildids_in ${JAVA_HOME}/bin
d557d5
remove_buildids_in ${JAVA_HOME}/lib
d557d5
remove_buildids_in ${JAVA_HOME}/demo
d557d5
remove_buildids_in ${JAVA_HOME}/jre/bin
d557d5
remove_buildids_in ${JAVA_HOME}/jre/lib