blob: 54fd3c10041517974ceefe69f318f9a66817a869 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001#!/bin/bash
2#
Patrick Williams92b42cb2022-09-03 06:53:57 -05003# Copyright OpenEmbedded Contributors
4#
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08005# Script which can be run on new autobuilder workers to check all needed configuration is present.
6# Designed to be run in a repo where bitbake/oe-core are already present.
7#
Brad Bishopc342db32019-05-15 21:57:59 -04008# SPDX-License-Identifier: GPL-2.0-only
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08009#
10# Todo
11# Add testtools/subunit import test
12# Add python3-git test
13# Add pigz test
14# vnc tests/checkvnc?
15# test sendmail works (for QA email notification)
16# test error report submission works
17# test buildistory git repo works?
18#
19
Brad Bishop19323692019-04-05 15:28:33 -040020if [ ! -x $HOME/yocto-autobuilder-helper/scripts/checkvnc ]; then
21 echo "$HOME/yocto-autobuilder-helper should be created."
22 exit 1
23fi
24$HOME/yocto-autobuilder-helper/scripts/checkvnc
25
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080026. ./oe-init-build-env > /dev/null
27if [ "$?" != "0" ]; then
28 exit 1
29fi
30git config --global user.name > /dev/null
31if [ "$?" != "0" ]; then
32 echo "Please set git config --global user.name"
33 exit 1
34fi
35git config --global user.email > /dev/null
36if [ "$?" != "0" ]; then
37 echo "Please set git config --global user.email"
38 exit 1
39fi
Andrew Geisslereff27472021-10-29 15:35:00 -050040python3 -c "import jinja2"
41if [ "$?" != "0" ]; then
42 echo "Please ensure jinja2 is available"
43 exit 1
44fi
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080045bitbake -p
46if [ "$?" != "0" ]; then
47 echo "Bitbake parsing failed"
48 exit 1
49fi
50
51WATCHES=$(PATH="/sbin:/usr/sbin:$PATH" sysctl fs.inotify.max_user_watches -n)
52if (( $WATCHES < 65000 )); then
53 echo 'Need to increase watches (echo fs.inotify.max_user_watches=65536 | sudo tee -a /etc/sysctl.conf'
54 exit 1
55fi
Andrew Geisslerd5838332022-05-27 11:33:10 -050056OPEN_FILES=$(ulimit -n)
57if (( $OPEN_FILES < 65535 )); then
58 echo 'Increase maximum open files in /etc/security/limits.conf'
59 echo '* soft nofile 131072'
60 echo '* hard nofile 131072'
61 exit 1
62fi
63MAX_PROCESSES=$(ulimit -u)
64if (( $MAX_PROCESSES < 514542 )); then
65 echo 'Increase maximum user processes in /etc/security/limits.conf'
66 echo '* hard nproc 515294'
67 echo '* soft nproc 514543'
68 exit 1
69fi
70
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080071mkdir -p tmp/deploy/images/qemux86-64
72pushd tmp/deploy/images/qemux86-64
73if [ ! -e core-image-minimal-qemux86-64.ext4 ]; then
Andrew Geisslerd5838332022-05-27 11:33:10 -050074 wget http://downloads.yoctoproject.org/releases/yocto/yocto-4.0/machines/qemu/qemux86-64/core-image-minimal-qemux86-64.ext4
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080075fi
76if [ ! -e core-image-minimal-qemux86-64.qemuboot.conf ]; then
Andrew Geisslerd5838332022-05-27 11:33:10 -050077 wget http://downloads.yoctoproject.org/releases/yocto/yocto-4.0/machines/qemu/qemux86-64/core-image-minimal-qemux86-64.qemuboot.conf
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080078fi
79if [ ! -e bzImage-qemux86-64.bin ]; then
Andrew Geisslerd5838332022-05-27 11:33:10 -050080 wget http://downloads.yoctoproject.org/releases/yocto/yocto-4.0/machines/qemu/qemux86-64/bzImage-qemux86-64.bin
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080081fi
82popd
83bitbake qemu-helper-native
Brad Bishop19323692019-04-05 15:28:33 -040084DISPLAY=:1 runqemu serialstdio qemux86-64
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080085if [ "$?" != "0" ]; then
86 echo "Unable to use runqemu"
87 exit 1
88fi
Brad Bishop19323692019-04-05 15:28:33 -040089DISPLAY=:1 runqemu serialstdio qemux86-64 kvm
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080090if [ "$?" != "0" ]; then
91 echo "Unable to use runqemu with kvm"
92 exit 1
93fi