aboutsummaryrefslogtreecommitdiff
path: root/meta-linaro/recipes-extra
diff options
context:
space:
mode:
authorFathi Boudra <fathi.boudra@linaro.org>2013-10-09 12:43:00 +0300
committerFathi Boudra <fathi.boudra@linaro.org>2013-10-09 12:43:00 +0300
commitd816b7c4e551c4e0b1c90136866a92f0ae49282a (patch)
tree5a3269dc8335b13107f42b42442430d70af2f2eb /meta-linaro/recipes-extra
parented9461c9b2577b741b333e9201257dd8401f57a6 (diff)
downloadmeta-linaro-d816b7c4e551c4e0b1c90136866a92f0ae49282a.tar.gz
trinity: add recipe for version 1.2
Change-Id: Ia9adf1a19031bebda47d05f861a964463e530911 Signed-off-by: Anders Roxell <anders.roxell@linaro.org> Acked-by: Fathi Boudra <fathi.boudra@linaro.org>
Diffstat (limited to 'meta-linaro/recipes-extra')
-rw-r--r--meta-linaro/recipes-extra/trinity/files/0001-scripts-TRINITY_PATH-defaults-to.patch198
-rw-r--r--meta-linaro/recipes-extra/trinity/files/0002-scripts-change-mkdir-tmp-to-mktemp.patch169
-rw-r--r--meta-linaro/recipes-extra/trinity/files/0003-scripts-arch-dependent-to-get-the-syscall_list.patch103
-rw-r--r--meta-linaro/recipes-extra/trinity/trinity_1.2.bb46
4 files changed, 516 insertions, 0 deletions
diff --git a/meta-linaro/recipes-extra/trinity/files/0001-scripts-TRINITY_PATH-defaults-to.patch b/meta-linaro/recipes-extra/trinity/files/0001-scripts-TRINITY_PATH-defaults-to.patch
new file mode 100644
index 00000000..4ac04dc3
--- /dev/null
+++ b/meta-linaro/recipes-extra/trinity/files/0001-scripts-TRINITY_PATH-defaults-to.patch
@@ -0,0 +1,198 @@
+From 74d806c91ff7894d5c1cd8d736b87e02047c6799 Mon Sep 17 00:00:00 2001
+From: Anders Roxell <anders.roxell@linaro.org>
+Date: Tue, 8 Oct 2013 16:02:56 +0200
+Subject: [PATCH 1/3] scripts: TRINITY_PATH defaults to "."
+
+TRINITY_PATH may be changed in the enviroment
+
+Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
+---
+ scripts/analyse-dumps.sh | 4 +++-
+ scripts/clean-cores.sh | 4 +++-
+ scripts/find.sh | 8 +++++---
+ scripts/test-all-syscalls-parallel.sh | 6 ++++--
+ scripts/test-all-syscalls-sequentially.sh | 8 +++++---
+ scripts/test-multi.sh | 6 ++++--
+ scripts/test-vm.sh | 4 +++-
+ 7 files changed, 27 insertions(+), 13 deletions(-)
+
+diff --git a/scripts/analyse-dumps.sh b/scripts/analyse-dumps.sh
+index d55393c..bd45ea5 100755
+--- a/scripts/analyse-dumps.sh
++++ b/scripts/analyse-dumps.sh
+@@ -1,8 +1,10 @@
+ #!/bin/sh
+
++TRINITY_PATH=${TRINITY_PATH:-.}
++
+ for core in $(find . -name "core.*")
+ do
+- gdb -batch -n -ex 'bt' ./trinity $core > core.txt
++ gdb -batch -n -ex 'bt' $TRINITY_PATH/trinity $core > core.txt
+ SHA=$(cat core.txt| grep -v New\ LWP | sha1sum)
+ cat core.txt > core-$SHA.txt
+ rm -f core.txt
+diff --git a/scripts/clean-cores.sh b/scripts/clean-cores.sh
+index 821e06a..0b90be6 100755
+--- a/scripts/clean-cores.sh
++++ b/scripts/clean-cores.sh
+@@ -1,8 +1,10 @@
+ #!/bin/sh
+
++TRINITY_PATH=${TRINITY_PATH:-.}
++
+ # remove old cores
+ for i in `find . -name "core.*" -exec ls -l {} \; | grep -v "$(date +%b\ %e)" | awk '{ print $9 }'`; do rm -f $i; done
+
+ # Remove corrupted cores
+ find . -empty -name "core.*" -exec rm -f {} \;
+-for i in $(file core.* | grep -v trinity | awk '{ print $1 }' | sed 's/://'); do rm -f $i; done
++for i in $(file core.* | grep -v $TRINITY_PATH/trinity | awk '{ print $1 }' | sed 's/://'); do rm -f $i; done
+diff --git a/scripts/find.sh b/scripts/find.sh
+index 537160f..5528210 100755
+--- a/scripts/find.sh
++++ b/scripts/find.sh
+@@ -5,6 +5,8 @@
+ # sendmsg that only occurred after connect was called.
+ #
+
++TRINITY_PATH=${TRINITY_PATH:-.}
++
+ check_tainted()
+ {
+ if [ "$(cat /proc/sys/kernel/tainted)" != $TAINT ]; then
+@@ -27,18 +29,18 @@ while [ 1 ];
+ do
+
+
+-for sc in $(../trinity -L | grep entrypoint | grep -v AVOID | awk '{ print $4 }' | sort -u)
++for sc in $($TRINITY_PATH/trinity -L | grep entrypoint | grep -v AVOID | awk '{ print $4 }' | sort -u)
+ do
+ mkdir -p tmp.$i
+ pushd tmp.$i
+
+- if [ ! -f ../../trinity ]; then
++ if [ ! -f $TRINITY_PATH/trinity ]; then
+ echo lost!
+ pwd
+ exit
+ fi
+
+- ../../trinity -q -l off -n -c sendmsg -c $sc -C32 -N 999999
++ $TRINITY_PATH/trinity -q -l off -n -c sendmsg -c $sc -C32 -N 999999
+
+ popd
+
+diff --git a/scripts/test-all-syscalls-parallel.sh b/scripts/test-all-syscalls-parallel.sh
+index 861c156..c713cce 100755
+--- a/scripts/test-all-syscalls-parallel.sh
++++ b/scripts/test-all-syscalls-parallel.sh
+@@ -1,5 +1,7 @@
+ #!/bin/bash
+
++TRINITY_PATH=${TRINITY_PATH:-.}
++
+ if [ ! -d tmp ]; then
+ mkdir tmp
+ fi
+@@ -8,9 +10,9 @@ cd tmp
+
+ while [ 1 ];
+ do
+- for syscall in $(../trinity -L | grep entrypoint | grep -v AVOID | awk '{ print $4 }' | sort -u)
++ for syscall in $($TRINITY_PATH/trinity -L | grep entrypoint | grep -v AVOID | awk '{ print $4 }' | sort -u)
+ do
+- MALLOC_CHECK_=2 ../trinity -q -c $syscall -D &
++ MALLOC_CHECK_=2 $TRINITY_PATH/trinity -q -c $syscall -D &
+ done
+ wait
+ done
+diff --git a/scripts/test-all-syscalls-sequentially.sh b/scripts/test-all-syscalls-sequentially.sh
+index 85bcf71..6d79db4 100755
+--- a/scripts/test-all-syscalls-sequentially.sh
++++ b/scripts/test-all-syscalls-sequentially.sh
+@@ -3,6 +3,8 @@
+ # This is a useful test to run occasionally, to see which syscalls are
+ # causing trinity to segfault.
+
++TRINITY_PATH=${TRINITY_PATH:-.}
++
+ check_tainted()
+ {
+ if [ "$(cat /proc/sys/kernel/tainted)" != $TAINT ]; then
+@@ -19,18 +21,18 @@ TAINT=$(cat /proc/sys/kernel/tainted)
+
+ while [ 1 ]
+ do
+-for syscall in $(./trinity -L | grep entrypoint | grep -v AVOID | awk '{ print $4 }' | sort -u)
++for syscall in $($TRINITY_PATH/trinity -L | grep entrypoint | grep -v AVOID | awk '{ print $4 }' | sort -u)
+ do
+ chmod 755 tmp
+ pushd tmp
+
+- if [ ! -f ../trinity ]; then
++ if [ ! -f $TRINITY_PATH/trinity ]; then
+ echo lost!
+ pwd
+ exit
+ fi
+
+- MALLOC_CHECK_=2 ../trinity -q -c $syscall -N 99999 -l off -C 64
++ MALLOC_CHECK_=2 $TRINITY_PATH/trinity -q -c $syscall -N 99999 -l off -C 64
+ popd
+
+ check_tainted
+diff --git a/scripts/test-multi.sh b/scripts/test-multi.sh
+index cad297c..33db834 100755
+--- a/scripts/test-multi.sh
++++ b/scripts/test-multi.sh
+@@ -1,5 +1,7 @@
+ #!/bin/bash
+
++TRINITY_PATH=${TRINITY_PATH:-.}
++
+ check_tainted()
+ {
+ if [ "$(cat /proc/sys/kernel/tainted)" != $TAINT ]; then
+@@ -21,7 +23,7 @@ NR_PROCESSES=$(($NR_CPUS * 2))
+
+ while [ 1 ];
+ do
+- cp ../trinity .
++ cp $TRINITY_PATH/trinity .
+
+ for i in `seq 1 $NR_PROCESSES`
+ do
+@@ -33,7 +35,7 @@ do
+ mkdir -p tmp.$i
+ pushd tmp.$i
+
+- if [ ! -f ../../trinity ]; then
++ if [ ! -f $TRINITY_PATH/trinity ]; then
+ echo lost!
+ pwd
+ exit
+diff --git a/scripts/test-vm.sh b/scripts/test-vm.sh
+index 4c472ca..6b75e8d 100755
+--- a/scripts/test-vm.sh
++++ b/scripts/test-vm.sh
+@@ -1,5 +1,7 @@
+ #!/bin/bash
+
++TRINITY_PATH=${TRINITY_PATH:-.}
++
+ if [ ! -d tmp ]; then
+ mkdir tmp
+ fi
+@@ -16,7 +18,7 @@ do
+ cd tmp.$RND
+ for i in `seq 1 $NR_PROCESSES`
+ do
+- ../../trinity -q -g vm &
++ $TRINITY_PATH/trinity -q -g vm &
+ done
+ wait
+ cd ..
+--
+1.8.1.2
+
diff --git a/meta-linaro/recipes-extra/trinity/files/0002-scripts-change-mkdir-tmp-to-mktemp.patch b/meta-linaro/recipes-extra/trinity/files/0002-scripts-change-mkdir-tmp-to-mktemp.patch
new file mode 100644
index 00000000..485ade76
--- /dev/null
+++ b/meta-linaro/recipes-extra/trinity/files/0002-scripts-change-mkdir-tmp-to-mktemp.patch
@@ -0,0 +1,169 @@
+From 3146cc9a97c951669468d10dce1245d74a0b0c17 Mon Sep 17 00:00:00 2001
+From: Anders Roxell <anders.roxell@linaro.org>
+Date: Tue, 8 Oct 2013 16:45:08 +0200
+Subject: [PATCH 2/3] scripts: change mkdir tmp to mktemp
+
+Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
+---
+ scripts/find.sh | 10 ++++------
+ scripts/test-all-syscalls-parallel.sh | 8 +++-----
+ scripts/test-all-syscalls-sequentially.sh | 9 +++------
+ scripts/test-multi.sh | 12 +++++-------
+ scripts/test-vm.sh | 8 +++-----
+ 5 files changed, 18 insertions(+), 29 deletions(-)
+
+diff --git a/scripts/find.sh b/scripts/find.sh
+index 5528210..3f10c58 100755
+--- a/scripts/find.sh
++++ b/scripts/find.sh
+@@ -6,6 +6,7 @@
+ #
+
+ TRINITY_PATH=${TRINITY_PATH:-.}
++TRINITY_TMP=$(mktemp -d /tmp/trinity.XXXXXX)
+
+ check_tainted()
+ {
+@@ -15,11 +16,8 @@ check_tainted()
+ fi
+ }
+
+-if [ ! -d tmp ]; then
+- mkdir tmp
+-fi
+-chmod 755 tmp
+-cd tmp
++chmod 755 $TRINITY_TMP
++cd $TRINITY_TMP
+
+ TAINT=$(cat /proc/sys/kernel/tainted)
+
+@@ -46,7 +44,7 @@ do
+
+ check_tainted
+
+- chmod 755 ../tmp
++ chmod 755 $TRINITY_TMP
+
+ done
+
+diff --git a/scripts/test-all-syscalls-parallel.sh b/scripts/test-all-syscalls-parallel.sh
+index c713cce..312fd2a 100755
+--- a/scripts/test-all-syscalls-parallel.sh
++++ b/scripts/test-all-syscalls-parallel.sh
+@@ -1,12 +1,10 @@
+ #!/bin/bash
+
+ TRINITY_PATH=${TRINITY_PATH:-.}
++TRINITY_TMP=$(mktemp -d /tmp/trinity.XXXXXX)
+
+-if [ ! -d tmp ]; then
+- mkdir tmp
+-fi
+-chmod 755 tmp
+-cd tmp
++chmod 755 $TRINITY_TMP
++cd $TRINITY_TMP
+
+ while [ 1 ];
+ do
+diff --git a/scripts/test-all-syscalls-sequentially.sh b/scripts/test-all-syscalls-sequentially.sh
+index 6d79db4..2b726fc 100755
+--- a/scripts/test-all-syscalls-sequentially.sh
++++ b/scripts/test-all-syscalls-sequentially.sh
+@@ -4,6 +4,7 @@
+ # causing trinity to segfault.
+
+ TRINITY_PATH=${TRINITY_PATH:-.}
++TRINITY_TMP=$(mktemp -d /tmp/trinity.XXXXXX)
+
+ check_tainted()
+ {
+@@ -13,18 +14,14 @@ check_tainted()
+ fi
+ }
+
+-if [ ! -d tmp ]; then
+- mkdir tmp
+-fi
+-
+ TAINT=$(cat /proc/sys/kernel/tainted)
+
+ while [ 1 ]
+ do
+ for syscall in $($TRINITY_PATH/trinity -L | grep entrypoint | grep -v AVOID | awk '{ print $4 }' | sort -u)
+ do
+- chmod 755 tmp
+- pushd tmp
++ chmod 755 $TRINITY_TMP
++ pushd $TRINITY_TMP
+
+ if [ ! -f $TRINITY_PATH/trinity ]; then
+ echo lost!
+diff --git a/scripts/test-multi.sh b/scripts/test-multi.sh
+index 33db834..65214c3 100755
+--- a/scripts/test-multi.sh
++++ b/scripts/test-multi.sh
+@@ -1,6 +1,7 @@
+ #!/bin/bash
+
+ TRINITY_PATH=${TRINITY_PATH:-.}
++TRINITY_TMP=$(mktemp -d /tmp/trinity.XXXXXX)
+
+ check_tainted()
+ {
+@@ -10,11 +11,8 @@ check_tainted()
+ fi
+ }
+
+-if [ ! -d tmp ]; then
+- mkdir tmp
+-fi
+-chmod 755 tmp
+-cd tmp
++chmod 755 $TRINITY_TMP
++cd $TRINITY_TMP
+
+ TAINT=$(cat /proc/sys/kernel/tainted)
+
+@@ -27,7 +25,7 @@ do
+
+ for i in `seq 1 $NR_PROCESSES`
+ do
+- chmod 755 ../tmp
++ chmod 755 ../$TRINITY_TMP
+ if [ -d tmp.$i ]; then
+ chmod 755 tmp.$i
+ rm -rf tmp.$i
+@@ -53,7 +51,7 @@ do
+ sleep 1
+ check_tainted
+
+- chmod 755 ../tmp
++ chmod 755 ../$TRINITY_TMP
+
+ for i in `seq 1 $NR_PROCESSES`
+ do
+diff --git a/scripts/test-vm.sh b/scripts/test-vm.sh
+index 6b75e8d..6804c0e 100755
+--- a/scripts/test-vm.sh
++++ b/scripts/test-vm.sh
+@@ -1,12 +1,10 @@
+ #!/bin/bash
+
+ TRINITY_PATH=${TRINITY_PATH:-.}
++TRINITY_TMP=$(mktemp -d /tmp/trinity.XXXXXX)
+
+-if [ ! -d tmp ]; then
+- mkdir tmp
+-fi
+-chmod 755 tmp
+-cd tmp
++chmod 755 $TRINITY_TMP
++cd $TRINITY_TMP
+
+ NR_CPUS=`grep ^processor /proc/cpuinfo | /usr/bin/wc -l`
+ NR_PROCESSES=$(($NR_CPUS * 2))
+--
+1.8.1.2
+
diff --git a/meta-linaro/recipes-extra/trinity/files/0003-scripts-arch-dependent-to-get-the-syscall_list.patch b/meta-linaro/recipes-extra/trinity/files/0003-scripts-arch-dependent-to-get-the-syscall_list.patch
new file mode 100644
index 00000000..52be5824
--- /dev/null
+++ b/meta-linaro/recipes-extra/trinity/files/0003-scripts-arch-dependent-to-get-the-syscall_list.patch
@@ -0,0 +1,103 @@
+From b28f02ef2bf5098a43167a8c48dbcb853cd7d03a Mon Sep 17 00:00:00 2001
+From: Anders Roxell <anders.roxell@linaro.org>
+Date: Tue, 8 Oct 2013 22:26:51 +0200
+Subject: [PATCH 3/3] scripts: arch dependent to get the syscall_list
+
+ARCH may be changed in the enviroment
+
+Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
+---
+ scripts/find.sh | 11 ++++++++++-
+ scripts/test-all-syscalls-parallel.sh | 11 ++++++++++-
+ scripts/test-all-syscalls-sequentially.sh | 11 ++++++++++-
+ 3 files changed, 30 insertions(+), 3 deletions(-)
+
+diff --git a/scripts/find.sh b/scripts/find.sh
+index 3f10c58..2687918 100755
+--- a/scripts/find.sh
++++ b/scripts/find.sh
+@@ -7,6 +7,15 @@
+
+ TRINITY_PATH=${TRINITY_PATH:-.}
+ TRINITY_TMP=$(mktemp -d /tmp/trinity.XXXXXX)
++ARCH=${ARCH:-x86}
++
++$TRINITY_PATH/trinity -L | grep entrypoint | grep -v AVOID | \
++ awk '{ print $4 }' | sort -u> $TRINITY_TMP/syscall_list
++
++if [ $ARCH = "arm" ]; then
++ $TRINITY_PATH/trinity -L | grep -v AVOID | \
++ awk '{ print $2 }' | sort -u> $TRINITY_TMP/syscall_list
++fi
+
+ check_tainted()
+ {
+@@ -27,7 +36,7 @@ while [ 1 ];
+ do
+
+
+-for sc in $($TRINITY_PATH/trinity -L | grep entrypoint | grep -v AVOID | awk '{ print $4 }' | sort -u)
++for sc in $(cat $TRINITY_TMP/syscall_list)
+ do
+ mkdir -p tmp.$i
+ pushd tmp.$i
+diff --git a/scripts/test-all-syscalls-parallel.sh b/scripts/test-all-syscalls-parallel.sh
+index 312fd2a..9c19f64 100755
+--- a/scripts/test-all-syscalls-parallel.sh
++++ b/scripts/test-all-syscalls-parallel.sh
+@@ -2,13 +2,22 @@
+
+ TRINITY_PATH=${TRINITY_PATH:-.}
+ TRINITY_TMP=$(mktemp -d /tmp/trinity.XXXXXX)
++ARCH=${ARCH:-x86}
++
++$TRINITY_PATH/trinity -L | grep entrypoint | grep -v AVOID | \
++ awk '{ print $4 }' | sort -u> $TRINITY_TMP/syscall_list
++
++if [ $ARCH = "arm" ]; then
++ $TRINITY_PATH/trinity -L | grep -v AVOID | \
++ awk '{ print $2 }' | sort -u> $TRINITY_TMP/syscall_list
++fi
+
+ chmod 755 $TRINITY_TMP
+ cd $TRINITY_TMP
+
+ while [ 1 ];
+ do
+- for syscall in $($TRINITY_PATH/trinity -L | grep entrypoint | grep -v AVOID | awk '{ print $4 }' | sort -u)
++ for syscall in $(cat $TRINITY_TMP/syscall_list)
+ do
+ MALLOC_CHECK_=2 $TRINITY_PATH/trinity -q -c $syscall -D &
+ done
+diff --git a/scripts/test-all-syscalls-sequentially.sh b/scripts/test-all-syscalls-sequentially.sh
+index 2b726fc..3eea70a 100755
+--- a/scripts/test-all-syscalls-sequentially.sh
++++ b/scripts/test-all-syscalls-sequentially.sh
+@@ -5,6 +5,15 @@
+
+ TRINITY_PATH=${TRINITY_PATH:-.}
+ TRINITY_TMP=$(mktemp -d /tmp/trinity.XXXXXX)
++ARCH=${ARCH:-x86}
++
++$TRINITY_PATH/trinity -L | grep entrypoint | grep -v AVOID | \
++ awk '{ print $4 }' | sort -u> $TRINITY_TMP/syscall_list
++
++if [ $ARCH = "arm" ]; then
++ $TRINITY_PATH/trinity -L | grep -v AVOID | \
++ awk '{ print $2 }' | sort -u> $TRINITY_TMP/syscall_list
++fi
+
+ check_tainted()
+ {
+@@ -18,7 +27,7 @@ TAINT=$(cat /proc/sys/kernel/tainted)
+
+ while [ 1 ]
+ do
+-for syscall in $($TRINITY_PATH/trinity -L | grep entrypoint | grep -v AVOID | awk '{ print $4 }' | sort -u)
++for syscall in $(cat $TRINITY_TMP/syscall_list)
+ do
+ chmod 755 $TRINITY_TMP
+ pushd $TRINITY_TMP
+--
+1.8.1.2
+
diff --git a/meta-linaro/recipes-extra/trinity/trinity_1.2.bb b/meta-linaro/recipes-extra/trinity/trinity_1.2.bb
new file mode 100644
index 00000000..23648572
--- /dev/null
+++ b/meta-linaro/recipes-extra/trinity/trinity_1.2.bb
@@ -0,0 +1,46 @@
+SUMMARY = "a Linux System call fuzz teste."
+DESCRIPTION = "Trinity, a Linux System call fuzz tester."
+HOMEPAGE = "http://codemonkey.org.uk/projects/trinity/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=96094d47cfbd2cc45eb46ce0fc423c04"
+
+COMPATIBLE_HOST = "(x86_64|arm|aarch64).*-linux"
+
+SRC_URI = "http://codemonkey.org.uk/projects/trinity/trinity-${PV}.tgz \
+ file://0001-scripts-TRINITY_PATH-defaults-to.patch \
+ file://0002-scripts-change-mkdir-tmp-to-mktemp.patch \
+ file://0003-scripts-arch-dependent-to-get-the-syscall_list.patch \
+ "
+
+SRC_URI[md5sum] = "554dc54e296dcfc32a7c85937ca4e956"
+SRC_URI[sha256sum] = "71132fca0ed016dcb39a3f1d9fa16a68971e2e9eff0b94bbacdf3d7ff101b6d5"
+
+S = "${WORKDIR}/trinity-${PV}"
+
+inherit useradd
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --create-home --shell /bin/sh ${PN} "
+
+do_configure () {
+ ./configure.sh
+}
+
+# workaround random build failures
+do_compile () {
+ ${MAKE}
+}
+
+do_install () {
+ oe_runmake install DESTDIR=${D}/usr
+ install -o ${PN} -d -m 0755 ${D}/${datadir}/${PN}
+ install -o ${PN} -m 0755 ${S}/scripts/test-all-syscalls-parallel.sh ${D}/${datadir}/${PN}
+ install -o ${PN} -m 0755 ${S}/scripts/test-all-syscalls-sequentially.sh ${D}/${datadir}/${PN}
+ install -o ${PN} -m 0755 ${S}/scripts/test-multi.sh ${D}/${datadir}/${PN}
+ install -o ${PN} -m 0755 ${S}/scripts/test-vm.sh ${D}/${datadir}/${PN}
+}
+
+PACKAGES =+ "${PN}-example"
+
+FILES_${PN} = "${bindir}/trinity"
+FILES_${PN}-example = "${datadir}/${PN}"