| Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | #!/bin/bash | 
|  | 2 | # | 
|  | 3 | # Script which can be run on new autobuilder workers to check all needed configuration is present. | 
|  | 4 | # Designed to be run in a repo where bitbake/oe-core are already present. | 
|  | 5 | # | 
|  | 6 |  | 
|  | 7 | # | 
|  | 8 | # Todo | 
|  | 9 | # Add testtools/subunit import test | 
|  | 10 | # Add python3-git test | 
|  | 11 | # Add pigz test | 
|  | 12 | # vnc tests/checkvnc? | 
|  | 13 | # test sendmail works (for QA email notification) | 
|  | 14 | # test error report submission works | 
|  | 15 | # test buildistory git repo works? | 
|  | 16 | # | 
|  | 17 |  | 
|  | 18 | . ./oe-init-build-env > /dev/null | 
|  | 19 | if [ "$?" != "0" ]; then | 
|  | 20 | exit 1 | 
|  | 21 | fi | 
|  | 22 | git config --global user.name > /dev/null | 
|  | 23 | if [ "$?" != "0" ]; then | 
|  | 24 | echo "Please set git config --global user.name" | 
|  | 25 | exit 1 | 
|  | 26 | fi | 
|  | 27 | git config --global user.email > /dev/null | 
|  | 28 | if [ "$?" != "0" ]; then | 
|  | 29 | echo "Please set git config --global user.email" | 
|  | 30 | exit 1 | 
|  | 31 | fi | 
|  | 32 | bitbake -p | 
|  | 33 | if [ "$?" != "0" ]; then | 
|  | 34 | echo "Bitbake parsing failed" | 
|  | 35 | exit 1 | 
|  | 36 | fi | 
|  | 37 |  | 
|  | 38 | WATCHES=$(PATH="/sbin:/usr/sbin:$PATH" sysctl fs.inotify.max_user_watches -n) | 
|  | 39 | if (( $WATCHES < 65000 )); then | 
|  | 40 | echo 'Need to increase watches (echo fs.inotify.max_user_watches=65536 | sudo tee -a /etc/sysctl.conf' | 
|  | 41 | exit 1 | 
|  | 42 | fi | 
|  | 43 | mkdir -p tmp/deploy/images/qemux86-64 | 
|  | 44 | pushd tmp/deploy/images/qemux86-64 | 
|  | 45 | if [ ! -e core-image-minimal-qemux86-64.ext4 ]; then | 
|  | 46 | wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.5.1/machines/qemu/qemux86-64/core-image-minimal-qemux86-64.ext4 | 
|  | 47 | fi | 
|  | 48 | if [ ! -e core-image-minimal-qemux86-64.qemuboot.conf ]; then | 
|  | 49 | wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.5.1/machines/qemu/qemux86-64/core-image-minimal-qemux86-64.qemuboot.conf | 
|  | 50 | fi | 
|  | 51 | if [ ! -e bzImage-qemux86-64.bin ]; then | 
|  | 52 | wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.5.1/machines/qemu/qemux86-64/bzImage-qemux86-64.bin | 
|  | 53 | fi | 
|  | 54 | popd | 
|  | 55 | bitbake qemu-helper-native | 
|  | 56 | runqemu qemux86-64 | 
|  | 57 | if [ "$?" != "0" ]; then | 
|  | 58 | echo "Unable to use runqemu" | 
|  | 59 | exit 1 | 
|  | 60 | fi | 
|  | 61 | runqemu qemux86-64 kvm | 
|  | 62 | if [ "$?" != "0" ]; then | 
|  | 63 | echo "Unable to use runqemu with kvm" | 
|  | 64 | exit 1 | 
|  | 65 | fi |