diff options
author | Ryan Harkin <ryan.harkin@linaro.org> | 2016-08-02 14:06:07 +0100 |
---|---|---|
committer | Ryan Harkin <ryan.harkin@linaro.org> | 2016-08-02 14:06:07 +0100 |
commit | b438db4b5c737ea8a15e3b8299b8f4fd5379792e (patch) | |
tree | 6e848e4c481cc26076eedd458daa69e26d0ecd16 | |
parent | 62c3b508684d74e4574abd9fa931c4c39333f628 (diff) |
Add platforms release scripts
Added various scripts that I use locally to maintain the platforms
releases.
Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
-rwxr-xr-x | platforms-build-everything.sh | 123 | ||||
-rwxr-xr-x | platforms-fvp-test.sh | 112 | ||||
-rwxr-xr-x | platforms-tag.sh | 86 | ||||
l--------- | platforms-wget-release.sh | 1 | ||||
-rwxr-xr-x | platforms-wget.sh | 40 |
5 files changed, 362 insertions, 0 deletions
diff --git a/platforms-build-everything.sh b/platforms-build-everything.sh new file mode 100755 index 0000000..53e4b13 --- /dev/null +++ b/platforms-build-everything.sh @@ -0,0 +1,123 @@ +#!/bin/bash + +function usage +{ + echo "$0" + echo " -b <platform name, eg juno>" +} + +function quit +{ + echo "ERROR: It doesn't look like you're in a platforms repo" + echo "ERROR: This is missing: $1" + exit +} +function clean_workspace +{ + git nukeall +} + +mandatory_dirs=( + .repo + arm-tf + build-scripts + busybox + linux + model-scripts + ramdisk + recovery + u-boot + uefi + vexpress-firmware +) + +for ((i=0;i<${#mandatory_dirs[@]};++i)); do + if [ ! -e ${mandatory_dirs[i]} ]; then + quit ${mandatory_dirs[i]} + fi +done + +# So we're probably in a platforms repo +variants=( + "-p public -t fvp -f busybox" + "-p public -t fvp -f oe" + "-p public -t fvp -f android" + "-p public -t fvp -f uefi" + "-p public -t tc2 -f busybox" + "-p public -t tc2 -f oe" + "-p public -t tc2 -f android" + "-p public -t tc2 -f uefi" + "-p public -t juno -f busybox" + "-p public -t juno -f oe" + "-p public -t juno -f android" + "-p public -t juno -f uefi" +) +fvp_ramdisk=/linaro/releases/android/reference-lcr/fvp/latest/ramdisk.img +juno_ramdisk=/linaro/releases/android/reference-lcr/juno/latest/ramdisk.img +tc2_ramdisk=/linaro/releases/android/reference-lcr/vexpress/latest/ramdisk.img + +function do_checks +{ + if [ ! -e $fvp_ramdisk ]; then + echo "You must have an FVP Android ramdisk here: $fvp_ramdisk" + exit 1 + fi + if [ ! -e $juno_ramdisk ]; then + echo "You must have an Juno Android ramdisk here: $juno_ramdisk" + exit 1 + fi + if [ ! -e $tc2_ramdisk ]; then + echo "You must have an TC2 Android ramdisk here: $tc2_ramdisk" + exit 1 + fi +} + +function do_build +{ + rm -rf output + prebuilts_dir=prebuilts/android + + for ((i=0;i<${#variants[@]};++i)); do + #if [[ ${#variants[i]} == *${boards}* ]]; then + if [ "${variants[i]}" == "fvp-android" ]; then + mkdir -p ${prebuilts_dir}/fvp + ln -sf $fvp_ramdisk ${prebuilts_dir}/fvp/ramdisk.img + elif [ "${variants[i]}" == "juno-android" ]; then + mkdir -p ${prebuilts_dir}/juno + ln -sf $juno_ramdisk ${prebuilts_dir}/juno/ramdisk.img + elif [ "${variants[i]}" == "tc2-android" ]; then + mkdir -p ${prebuilts_dir}/tc2 + ln -sf $tc2_ramdisk ${prebuilts_dir}/tc2/ramdisk.img + fi + ./build-scripts/build-all.sh ${variants[i]} + ./build-scripts/build-all.sh ${variants[i]} package + #else + #echo board \"${boards}\" not found in \"${variants[i]}\" + #fi + done +} + + + + + +# Read params +while [ "$1" != "" ]; do + case $1 in + "-h" | "-?" | "-help" | "--help" | "--h" ) + usage + exit + ;; + "-b" | "--board" ) + shift + boards=$boards $1 + ;; + *) + ;; + esac + shift +done + +do_checks +do_build +tree output diff --git a/platforms-fvp-test.sh b/platforms-fvp-test.sh new file mode 100755 index 0000000..c3610c1 --- /dev/null +++ b/platforms-fvp-test.sh @@ -0,0 +1,112 @@ +#!/bin/bash + +arch=`uname -m` + +if [ "$arch" != "x86_64" ]; then + echo "ERROR: This script if for x86 machines only" + exit 1 +fi + +function banner +{ + echo "********************************************************************************" + echo "********************************************************************************" + echo "****" + echo "**** $1" + echo "****" + echo "**** After typing shutdown into the model's shell, press CTRL-C here to kill the" + echo "**** model and run the next instance" + echo "****" + echo "********************************************************************************" + echo "********************************************************************************" +} + +function run_test +{ + dir=$1 + str="$*" + + if [ -e $dir ]; then + banner "$str" + modelscr=./model-scripts/run_model.sh + if [ ! -e "$modelscr" ]; then + modelscr=$dir/run_model.sh + if [ ! -e "$modelscr" ]; then + echo "ERROR: model script not found" + exit 1 + fi + fi + cmd="$modelscr $dir" + echo Using model command: $cmd + export NET=1 + export MACADDR=00:02:F7:EF:67:E6 + export VARS=nor.fd + $cmd + if [ "$MODEL" == "$FOUNDATION_MODEL" ]; then + str="foundation" + else + str="aemv8" + fi + log=$dir/${str}-`date +%s%N`.log + echo Saving log to $log + cp /home/ryan/logs/rtsm-5000.log $log + fi +} + +if [ "$1" == "flexlm" ] +then + # Start the flexlm tunnel for the AEMv8 models + echo "Starting the flexlm tunnel in a new window" + gnome-terminal --title "flexlm tunnel" --geometry="40x6" -e "script -c \"ssh -L 8224:localhost:8224 -L 18224:localhost:18224 -N ryan.harkin@flexlm.linaro.org -v\"" & + + sleep 3 + echo "Now do some testing" +fi + +AEMV8_MODEL=${AEMV8_MODEL:-/linaro/fastmodels/FVP_Base_AEMv8A-AEMv8A/models/Linux64_GCC-4.1/FVP_Base_AEMv8A-AEMv8A} +FOUNDATION_MODEL=${FOUNDATION_MODEL:-/linaro/fastmodels/Foundation_v8pkg/models/Linux64_GCC-4.1/Foundation_v8} + +OE_DISK=${OE_DISK:-/linaro/releases/openembedded/juno-lsk/latest/lamp.img} +ANDROID_DISK=${ANDROID_DISK:-/linaro/releases/android/reference-lcr/fvp/latest/fvp.img} + +export CACHE_STATE_MODELLED=0 + + +# Do foundation model tests first +export MODEL=$FOUNDATION_MODEL + +export DISK= +run_test output/fvp-uefi/uefi "Foundation Model - UEFI" +run_test fvp-uefi "Foundation Model - UEFI" +run_test output/public/output.fvp/fvp-uefi/uefi "Foundation Model - UEFI" + +run_test fvp-latest-busybox-uboot "Foundation Model - Latest - BusyBox - U-Boot" +run_test fvp-lsk-busybox-uboot "Foundation Model - LSK - BusyBox - U-Boot" +run_test output/fvp-busybox/uboot "Foundation Model - BusyBox - U-Boot" +run_test output/public/output.fvp/fvp-busybox/uboot "Foundation Model - BusyBox - U-Boot" + +export DISK=$OE_DISK +run_test output/fvp-oe/uboot "Foundation Model - OpenEmbedded - U-Boot" +run_test fvp-latest-oe-uboot "Foundation Model - OpenEmbedded - U-Boot" +run_test output/public/output.fvp/fvp-oe/uboot "Foundation Model - OpenEmbedded - U-Boot" +export MODEL=$AEMV8_MODEL + +export DISK= +run_test output/fvp-uefi/uefi "AEMv8 Model - UEFI" +run_test fvp-uefi "AEMv8 Model - UEFI" +run_test output/public/output.fvp/fvp-uefi/uefi "AEMv8 Model - UEFI" + +run_test fvp-latest-busybox-uboot "AEMv8 Model - Latest - BusyBox - U-Boot" +run_test fvp-lsk-busybox-uboot "AEMv8 Model - LSK - BusyBox - U-Boot" +run_test output/fvp-busybox/uboot "AEMv8 Model - BusyBox - U-Boot" +run_test output/public/output.fvp/fvp-busybox/uboot "AEMv8 Model - BusyBox - U-Boot" + +export DISK=$OE_DISK +run_test output/fvp-oe/uboot "AEMv8 Model - OpenEmbedded - U-Boot" +run_test fvp-latest-oe-uboot "AEMv8 Model - OpenEmbedded - U-Boot" +run_test output/public/output.fvp/fvp-oe/uboot "AEMv8 Model - OpenEmbedded - U-Boot" + +export DISK=$ANDROID_DISK +run_test fvp-lsk-android-uboot "AEMv8 Model - Android - U-Boot" +run_test output/fvp-android/uboot "AEMv8 Model - Android - U-Boot" +run_test output/public/output.fvp/fvp-android/uboot "AEMv8 Model - Android - U-Boot" diff --git a/platforms-tag.sh b/platforms-tag.sh new file mode 100755 index 0000000..9bc51fa --- /dev/null +++ b/platforms-tag.sh @@ -0,0 +1,86 @@ +#!/bin/bash +tag=$1 +remote=working + +function quit +{ + echo "ERROR: It doesn't look like you're in a platforms repo" + echo "ERROR: This is missing: $1" + exit +} + +mandatory_dirs=( + .repo + arm-tf + build-scripts + busybox + linux + model-scripts + ramdisk + recovery + u-boot + uefi + vexpress-firmware +) + +for ((i=0;i<${#mandatory_dirs[@]};++i)); do + if [ ! -e ${mandatory_dirs[i]} ]; then + quit ${mandatory_dirs[i]} + fi +done + + +# list of dirs I want to tag +dirs=( + build-scripts + model-scripts + ramdisk + recovery + u-boot + uefi/edk2 + uefi/edk2/OpenPlatformPkg + tools/uefi-tools + vexpress-firmware + /linaro/g.l.o/landing-teams/working/arm/manifest.git +) + +for ((i=0;i<${#dirs[@]};++i)); do + echo dir: ${dirs[i]} + pushd ${dirs[i]} > /dev/null + git rem | grep $remote > /dev/null + ret=$? + if [ "$ret" != "0" ] + then + echo ${dirs[i]} does not have a remote called $remote + exit + fi + + # Now do the tagging + git tag -l $tag + count=`git tag -l $tag | wc -l` + if [ "$count" == "0" ] + then + echo "good, the tag doesn't exist" + tmptag=$tag + + # handle special cases where the tag is augmented somehow + case "${dirs[i]}" in + "recovery" ) + tmptag=`echo $tmptag | sed s#armlt#armlt-juno#` + ;; + "vexpress-firmware" ) + tmptag=`echo $tmptag | sed s#armlt#armlt-vexpress#` + ;; + esac + + echo This is the tag: $tmptag + + git tag $tmptag + git push $remote $tmptag + else + echo "drat, the tag already exists in ${dirs[i]}" + fi + # done + + popd > /dev/null +done diff --git a/platforms-wget-release.sh b/platforms-wget-release.sh new file mode 120000 index 0000000..0be26c9 --- /dev/null +++ b/platforms-wget-release.sh @@ -0,0 +1 @@ +platforms-wget.sh
\ No newline at end of file diff --git a/platforms-wget.sh b/platforms-wget.sh new file mode 100755 index 0000000..e21670e --- /dev/null +++ b/platforms-wget.sh @@ -0,0 +1,40 @@ +#!/bin/bash +url=http://snapshots.linaro.org/member-builds/armlt-platforms +ci=https://ci.linaro.org/view/member-builds/job/armlt-platforms + +me=`basename "$0"` +echo $me + +#if [ "$me" == "platforms-wget-release.sh" ] ; then +if [[ "$me" == *"release"* ]] ; then + url=${url}-release + ci=${ci}-release +fi +num=$1 +mkdir $num +pushd $num +files=( + fvp-latest-busybox-uboot.zip + fvp-lsk-busybox-uboot.zip + fvp-latest-oe-uboot.zip + fvp-lsk-android-uboot.zip + fvp-uefi.zip + juno-latest-busybox-uboot.zip + juno-latest-oe-uboot.zip + juno-lsk-android-uboot.zip + juno-uefi.zip + tc2-latest-busybox-bootmon.zip + tc2-latest-oe-bootmon.zip + tc2-lsk-android-bootmon.zip + tc2-uefi.zip + MD5SUMS +) + +for ((i=0;i<${#files[@]};++i)); do + wget ${url}/${num}/${files[i]} +done + +# Pull down the build log +wget ${ci}/${num}/consoleText + +popd |