Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 3 | # Copyright OpenEmbedded Contributors |
| 4 | # |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 5 | # 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 Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 8 | # SPDX-License-Identifier: GPL-2.0-only |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 9 | # |
| 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 Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 20 | if [ ! -x $HOME/yocto-autobuilder-helper/scripts/checkvnc ]; then |
| 21 | echo "$HOME/yocto-autobuilder-helper should be created." |
| 22 | exit 1 |
| 23 | fi |
| 24 | $HOME/yocto-autobuilder-helper/scripts/checkvnc |
| 25 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 26 | . ./oe-init-build-env > /dev/null |
| 27 | if [ "$?" != "0" ]; then |
| 28 | exit 1 |
| 29 | fi |
| 30 | git config --global user.name > /dev/null |
| 31 | if [ "$?" != "0" ]; then |
| 32 | echo "Please set git config --global user.name" |
| 33 | exit 1 |
| 34 | fi |
| 35 | git config --global user.email > /dev/null |
| 36 | if [ "$?" != "0" ]; then |
| 37 | echo "Please set git config --global user.email" |
| 38 | exit 1 |
| 39 | fi |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 40 | python3 -c "import jinja2" |
| 41 | if [ "$?" != "0" ]; then |
| 42 | echo "Please ensure jinja2 is available" |
| 43 | exit 1 |
| 44 | fi |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 45 | bitbake -p |
| 46 | if [ "$?" != "0" ]; then |
| 47 | echo "Bitbake parsing failed" |
| 48 | exit 1 |
| 49 | fi |
| 50 | |
| 51 | WATCHES=$(PATH="/sbin:/usr/sbin:$PATH" sysctl fs.inotify.max_user_watches -n) |
| 52 | if (( $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 |
| 55 | fi |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 56 | OPEN_FILES=$(ulimit -n) |
| 57 | if (( $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 |
| 62 | fi |
| 63 | MAX_PROCESSES=$(ulimit -u) |
| 64 | if (( $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 |
| 69 | fi |
| 70 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 71 | mkdir -p tmp/deploy/images/qemux86-64 |
| 72 | pushd tmp/deploy/images/qemux86-64 |
| 73 | if [ ! -e core-image-minimal-qemux86-64.ext4 ]; then |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 74 | wget http://downloads.yoctoproject.org/releases/yocto/yocto-4.0/machines/qemu/qemux86-64/core-image-minimal-qemux86-64.ext4 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 75 | fi |
| 76 | if [ ! -e core-image-minimal-qemux86-64.qemuboot.conf ]; then |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 77 | wget http://downloads.yoctoproject.org/releases/yocto/yocto-4.0/machines/qemu/qemux86-64/core-image-minimal-qemux86-64.qemuboot.conf |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 78 | fi |
| 79 | if [ ! -e bzImage-qemux86-64.bin ]; then |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 80 | wget http://downloads.yoctoproject.org/releases/yocto/yocto-4.0/machines/qemu/qemux86-64/bzImage-qemux86-64.bin |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 81 | fi |
| 82 | popd |
| 83 | bitbake qemu-helper-native |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 84 | DISPLAY=:1 runqemu serialstdio qemux86-64 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 85 | if [ "$?" != "0" ]; then |
| 86 | echo "Unable to use runqemu" |
| 87 | exit 1 |
| 88 | fi |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 89 | DISPLAY=:1 runqemu serialstdio qemux86-64 kvm |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 90 | if [ "$?" != "0" ]; then |
| 91 | echo "Unable to use runqemu with kvm" |
| 92 | exit 1 |
| 93 | fi |