aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/autobuilder-worker-prereq-tests
blob: 358dd2beeecc8e8f93f61ed926a3483250f733d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
#
# Script which can be run on new autobuilder workers to check all needed configuration is present.
# Designed to be run in a repo where bitbake/oe-core are already present.
#

#
# Todo
# Add testtools/subunit import test
# Add python3-git test
# Add pigz test
# vnc tests/checkvnc?
# test sendmail works (for QA email notification)
# test error report submission works
# test buildistory git repo works?
#

if [ ! -x $HOME/yocto-autobuilder-helper/scripts/checkvnc ]; then
    echo "$HOME/yocto-autobuilder-helper should be created."
    exit 1
fi
$HOME/yocto-autobuilder-helper/scripts/checkvnc

. ./oe-init-build-env > /dev/null
if [ "$?" != "0" ]; then
    exit 1
fi
git config --global user.name > /dev/null
if [ "$?" != "0" ]; then
    echo "Please set git config --global user.name"
    exit 1
fi
git config --global user.email > /dev/null
if [ "$?" != "0" ]; then
    echo "Please set git config --global user.email"
    exit 1
fi
bitbake -p
if [ "$?" != "0" ]; then
    echo "Bitbake parsing failed"
    exit 1
fi

WATCHES=$(PATH="/sbin:/usr/sbin:$PATH" sysctl fs.inotify.max_user_watches -n)
if (( $WATCHES < 65000 )); then
    echo 'Need to increase watches (echo fs.inotify.max_user_watches=65536 | sudo tee -a /etc/sysctl.conf'
    exit 1
fi
mkdir -p tmp/deploy/images/qemux86-64
pushd tmp/deploy/images/qemux86-64
if [ ! -e core-image-minimal-qemux86-64.ext4 ]; then
    wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.5.1/machines/qemu/qemux86-64/core-image-minimal-qemux86-64.ext4
fi
if [ ! -e core-image-minimal-qemux86-64.qemuboot.conf ]; then
    wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.5.1/machines/qemu/qemux86-64/core-image-minimal-qemux86-64.qemuboot.conf
fi
if [ ! -e bzImage-qemux86-64.bin ]; then
    wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.5.1/machines/qemu/qemux86-64/bzImage-qemux86-64.bin
fi
popd
bitbake qemu-helper-native
DISPLAY=:1 runqemu serialstdio qemux86-64
if [ "$?" != "0" ]; then
    echo "Unable to use runqemu"
    exit 1
fi
DISPLAY=:1 runqemu serialstdio qemux86-64 kvm
if [ "$?" != "0" ]; then
    echo "Unable to use runqemu with kvm"
    exit 1
fi