mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-12-27 02:24:47 +08:00
new coverity scripts
This commit is contained in:
parent
d8dba632be
commit
89dd574f53
4 changed files with 84 additions and 41 deletions
35
.coverity.conf.sample
Normal file
35
.coverity.conf.sample
Normal file
|
@ -0,0 +1,35 @@
|
|||
COVLOGIN=myemail@corp.com
|
||||
COVTOKEN=aAbBcCdDeEfFgGhHiIjJkK
|
||||
COVBINDIR="/opt/cov-analysis-linux64-2019.03/bin"
|
||||
# Nickname included in scan description:
|
||||
NICKNAME=myself
|
||||
|
||||
COVDIR=cov-int
|
||||
COVBUILD="cov-build --dir $COVDIR"
|
||||
|
||||
# Depending if your kernel > 4.8.x, you might need to activate this to run Coverity executables
|
||||
# (but latest tools with kernel 5.2 run fine)
|
||||
#sysctl vsyscall=emulate
|
||||
|
||||
export PATH="$PATH:$COVBINDIR"
|
||||
|
||||
function pre_build_hook() {
|
||||
# tmp dir will be /tmp/cov-$username/
|
||||
# It's the good place if you need to redirect to elsewhere with a symlink
|
||||
return 0
|
||||
}
|
||||
|
||||
function post_build_hook() {
|
||||
return 0
|
||||
}
|
||||
|
||||
function pre_submit_hook() {
|
||||
return 0
|
||||
}
|
||||
|
||||
function post_submit_hook() {
|
||||
# Clean up build folders?
|
||||
rm -rf "$COVDIR"
|
||||
echo "Coverity build cleaned"
|
||||
return 0
|
||||
}
|
46
covbuild.sh
46
covbuild.sh
|
@ -1,36 +1,20 @@
|
|||
#!/bin/bash
|
||||
|
||||
## 2016-01-16, Iceman
|
||||
## build script for Coverity Scan of the proxmark3 source code
|
||||
set -e
|
||||
. .coverity.conf || exit 1
|
||||
|
||||
## clean up pre-compiled objects.
|
||||
pre_build_hook
|
||||
|
||||
rm -rf "$COVDIR"
|
||||
mkdir "$COVDIR"
|
||||
make clean
|
||||
$COVBUILD make -j 4 bootrom
|
||||
$COVBUILD make -j 4 fullimage
|
||||
$COVBUILD make -j 4 mfkey
|
||||
$COVBUILD make -j 4 nonce2key
|
||||
$COVBUILD make -j 4 fpga_compress
|
||||
# make sure to do client after ARM because Coverity retains one build info per file
|
||||
# and we want the client-side of the common/ analysis
|
||||
$COVBUILD make -j 4 client
|
||||
|
||||
## coverity build
|
||||
/home/user/cov-analysis-linux-2017.07/bin/cov-build --dir cov-int make all
|
||||
|
||||
## delete all previous tarballs
|
||||
rm proxmark3.all.*.tgz
|
||||
|
||||
##
|
||||
VERSION="0.1.`date --date now +%H%M`"
|
||||
TODAY="`date --date now +%Y%m%d.%H%M`"
|
||||
DESCNAME="autoMango.$TODAY"
|
||||
FILENAME=proxmark3.all.$TODAY.tgz
|
||||
|
||||
## create tarball
|
||||
tar cfz $FILENAME cov-int
|
||||
echo "Coverity build file is ready"
|
||||
|
||||
## clean up build folders
|
||||
rm -rf cov-int
|
||||
echo "Coverity build cleaned"
|
||||
|
||||
## upload tarball to Coverity.com
|
||||
curl --form token=dY262wIFmfkcRkA5Pyw0eA \
|
||||
--form email=herrmann1001@gmail.com \
|
||||
--form file=@$FILENAME \
|
||||
--form version="$VERSION" \
|
||||
--form description="$DESCNAME" \
|
||||
https://scan.coverity.com/builds?project=proxmark3_iceman_fork
|
||||
echo "tarball uploaded to Coverity for analyse"
|
||||
post_build_hook
|
||||
|
|
13
covconfig.sh
13
covconfig.sh
|
@ -1,13 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
## 20160116, iceman
|
||||
## remove old
|
||||
rm /home/user/cov-analysis-linux-2017.07/config/coverity_config.xml
|
||||
rm -rf /home/user/cov-analysis-linux-2017.07/config/gcc-config-?
|
||||
rm -rf /home/user/cov-analysis-linux-2017.07/config/g++-config-?
|
||||
|
||||
## Configure ARM , make sure you have the arm gcc in your $PATH variable.
|
||||
#/home/user/cov-analysis-linux-2017.07/bin/cov-configure -co arm-none-eabi-gcc -- -mthumb-interwork
|
||||
/home/user/cov-analysis-linux-2017.07/bin/cov-configure -co arm-none-eabi-gcc -- -std=c99 -mthumb -mthumb-interwork
|
||||
set -e
|
||||
. .coverity.conf || exit 1
|
||||
|
||||
echo "Done."
|
||||
cov-configure --template --compiler arm-none-eabi-gcc --comptype gcc
|
||||
|
|
31
covsubmit.sh
Executable file
31
covsubmit.sh
Executable file
|
@ -0,0 +1,31 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
. .coverity.conf || exit 1
|
||||
|
||||
pre_submit_hook
|
||||
|
||||
## delete all previous tarballs
|
||||
rm proxmark3.all.*.tgz
|
||||
|
||||
VERSION="0.1.$(date --date now +%H%M)"
|
||||
TODAY="$(date --date now +%Y%m%d.%H%M)"
|
||||
DESCNAME="manual_by_$NICKNAME.$TODAY"
|
||||
FILENAME="proxmark3.all.$TODAY.tgz"
|
||||
LOGFILENAME="${FILENAME/.tgz/.log}"
|
||||
|
||||
## create tarball
|
||||
tar cfz "$FILENAME" "$COVDIR" || exit $?
|
||||
echo "Coverity build file is ready"
|
||||
|
||||
## upload tarball to Coverity.com
|
||||
curl --progress-bar --fail \
|
||||
--form token="$COVTOKEN" \
|
||||
--form email="$COVLOGIN" \
|
||||
--form file="@$FILENAME" \
|
||||
--form version="$VERSION" \
|
||||
--form description="$DESCNAME" \
|
||||
https://scan.coverity.com/builds?project=Proxmark3+RRG+Iceman+repo | tee -a "${LOGFILENAME}" ; test "${PIPESTATUS[0]}" -eq 0 || exit $?
|
||||
echo "tarball uploaded to Coverity for analyse"
|
||||
|
||||
post_submit_hook
|
Loading…
Reference in a new issue