Blame SOURCES/remove-buildids.sh

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