diff options
author | John Rigby <john.rigby@linaro.org> | 2012-07-26 03:21:10 -0600 |
---|---|---|
committer | John Rigby <john.rigby@linaro.org> | 2012-07-26 03:21:10 -0600 |
commit | f739bad0b6fe132c9bf247a9c754c25eeafe6410 (patch) | |
tree | 531501d814f46bfbe6971f0bbe86be9a83443d42 /scripts | |
parent | 33b6231fefa6998b27ae4f9a4ac28dc9ce1a8ffa (diff) |
add lava testing support
Signed-off-by: John Rigby <john.rigby@linaro.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/package_kernel | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/scripts/package_kernel b/scripts/package_kernel index 96699ce..b1b6624 100755 --- a/scripts/package_kernel +++ b/scripts/package_kernel @@ -320,6 +320,101 @@ publish_source_pkg() dput ppa:linaro-maintainers/kernel *.changes } +create_new_hwpack() +{ + url="http://snapshots.linaro.org/$distribution/hwpacks/$1/latest" + wget -q -k --no-cookies \ + --header "Cookie: redirectlicensephp=200" \ + $url \ + -O tmp.html + url=$(grep -o 'href="http:.*tar.gz">' tmp.html) + rm tmp.html + url=${url/href=\"} + url=${url/\">} + orig_hwpack=$(basename $url) + wget -N -q $url + kernel_deb=$(ls kernel_build/test_build/linux-image*.deb | grep -v dbg) + rm -rf linaro-image-tools + bzr branch lp:linaro-image-tools + new_hwpack_url=$(python ./linaro-image-tools/linaro-hwpack-replace \ + -t $orig_hwpack \ + -p $kernel_deb \ + -r linux-image \ + -n $BUILD_NUMBER) + new_hwpack_name=$(basename $new_hwpack_url) + + # save for upload + cp $new_hwpack_name out +} + +get_binary_url() +{ + url="http://snapshots.linaro.org/$distribution/images/nano/latest" + wget -q -k --no-cookies \ + --header "Cookie: redirectlicensephp=200" \ + $url \ + -O tmp.html + build=$(grep -o "linaro-$distribution-nano-.*.gz\"" tmp.html) + build=${build/.tar.gz\"} + build=${build/*-/} + url="http://snapshots.linaro.org/$distribution/images/nano/$build" + wget -q -k --no-cookies \ + --header "Cookie: redirectlicensephp=200" \ + $url \ + -O tmp.html + url=$(grep -o 'href="http:.*tar.gz">' tmp.html) + rm tmp.html + url=${url/href=\"} + url=${url/\">} + echo rootfs=$url > out/jobinfo.sh +} + +create_eula() +{ + touch out/EULA.txt +} + +lava_test() +{ + # save source pkg files to be ssh uploaded + # + rm -rf out + mkdir out + cp kernel_build/*.dsc out + cp kernel_build/*.changes out + cp kernel_build/*.tar.gz out + + # map job_flavour to hwpack_flavour + # + job_flavour=${job_flavour/-3.?} + case $job_flavour in + lt-omap) + hwpack_flavour="lt-panda" + ;; + lt-origen) + hwpack_flavour="leb-origen" + ;; + lt-u8500) + hwpack_flavour="lt-snowball" + ;; + lt-vexpress) + hwpack_flavour="lt-vexpress" + ;; + origen) + hwpack_flavour="origen" + ;; + vexpress) + hwpack_flavour="vexpress" + ;; + *) + carp "unsupported job flavour '$job_flavour'" + ;; + esac + create_new_hwpack $hwpack_flavour + get_binary_url + create_eula +} + export scriptname=$(basename $0) trap cleanup EXIT @@ -343,6 +438,7 @@ test "$JENKINS_URL" && { test "$running_standalone" && { do_merge="true" do_create_source_pkg="true" + BUILD_NUMBER=$$ } # process command line arguments @@ -358,6 +454,7 @@ while (( $# > 0 )) ; do -cfg|--cfg) echo "sourcing $2" source $2 + job_flavour=${2/.cfg/} shift ;; +([[:alpha:]_])*([[:word:]])=+([-[:word:]:/.])) @@ -409,4 +506,8 @@ test "$do_publish_source_pkg" == "true" && { cd .. } +test "$do_lava_testing" == "true" && { + lava_test +} + exit 0 |