summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/install.sh22
-rwxr-xr-xscripts/sdl_check.sh19
2 files changed, 41 insertions, 0 deletions
diff --git a/scripts/install.sh b/scripts/install.sh
new file mode 100755
index 00000000..5435f4fc
--- /dev/null
+++ b/scripts/install.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+#
+# Install necessary softwares for Ubuntu.
+
+apt-get update
+apt-get install -y \
+ gcc-multilib \
+ git \
+ g++ \
+ python3-pip \
+ ninja-build \
+ unifdef \
+ p7zip-full \
+ tofrodos \
+ gawk \
+ cmake \
+ software-properties-common
+
+python3 -m pip install --upgrade pip
+pip3 install artifacts-keyring
+pip3 install gcovr==4.1 $INDEX_URL
+
diff --git a/scripts/sdl_check.sh b/scripts/sdl_check.sh
new file mode 100755
index 00000000..77eeb5ce
--- /dev/null
+++ b/scripts/sdl_check.sh
@@ -0,0 +1,19 @@
+# !/bin/bash
+dir_list="common common_smp common_modules ports ports_module ports_smp samples"
+exclude_list="-path TX"
+file_list=$(find $dir_list \( $exclude_list \) -prune -o -type f -name '*.[ch]' -print)
+cd $(dirname `realpath $0`)/..
+echo "Checking for unexpected usage of memcpy..."
+echo ""
+echo "Excluding:"
+echo $exclude_list | grep -P "[^\s]*/[^\s]*" -o
+echo ""
+echo "Result:"
+grep -i "memcpy(" -i $file_list -n | grep -i "use case of .* is verified" -v
+if [ "$?" -eq "1" ];
+then
+ echo "CLEAN"
+ exit 0
+else
+ exit 1
+fi \ No newline at end of file