Blame SOURCES/remove-buildids.sh

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