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 | # |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 6 | # SPDX-License-Identifier: GPL-2.0-only |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 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 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 18 | if [ ! -x $HOME/yocto-autobuilder-helper/scripts/checkvnc ]; then |
| 19 | echo "$HOME/yocto-autobuilder-helper should be created." |
| 20 | exit 1 |
| 21 | fi |
| 22 | $HOME/yocto-autobuilder-helper/scripts/checkvnc |
| 23 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 24 | . ./oe-init-build-env > /dev/null |
| 25 | if [ "$?" != "0" ]; then |
| 26 | exit 1 |
| 27 | fi |
| 28 | git config --global user.name > /dev/null |
| 29 | if [ "$?" != "0" ]; then |
| 30 | echo "Please set git config --global user.name" |
| 31 | exit 1 |
| 32 | fi |
| 33 | git config --global user.email > /dev/null |
| 34 | if [ "$?" != "0" ]; then |
| 35 | echo "Please set git config --global user.email" |
| 36 | exit 1 |
| 37 | fi |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 38 | python3 -c "import jinja2" |
| 39 | if [ "$?" != "0" ]; then |
| 40 | echo "Please ensure jinja2 is available" |
| 41 | exit 1 |
| 42 | fi |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 43 | bitbake -p |
| 44 | if [ "$?" != "0" ]; then |
| 45 | echo "Bitbake parsing failed" |
| 46 | exit 1 |
| 47 | fi |
| 48 | |
| 49 | WATCHES=$(PATH="/sbin:/usr/sbin:$PATH" sysctl fs.inotify.max_user_watches -n) |
| 50 | if (( $WATCHES < 65000 )); then |
| 51 | echo 'Need to increase watches (echo fs.inotify.max_user_watches=65536 | sudo tee -a /etc/sysctl.conf' |
| 52 | exit 1 |
| 53 | fi |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 54 | OPEN_FILES=$(ulimit -n) |
| 55 | if (( $OPEN_FILES < 65535 )); then |
| 56 | echo 'Increase maximum open files in /etc/security/limits.conf' |
| 57 | echo '* soft nofile 131072' |
| 58 | echo '* hard nofile 131072' |
| 59 | exit 1 |
| 60 | fi |
| 61 | MAX_PROCESSES=$(ulimit -u) |
| 62 | if (( $MAX_PROCESSES < 514542 )); then |
| 63 | echo 'Increase maximum user processes in /etc/security/limits.conf' |
| 64 | echo '* hard nproc 515294' |
| 65 | echo '* soft nproc 514543' |
| 66 | exit 1 |
| 67 | fi |
| 68 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 69 | mkdir -p tmp/deploy/images/qemux86-64 |
| 70 | pushd tmp/deploy/images/qemux86-64 |
| 71 | if [ ! -e core-image-minimal-qemux86-64.ext4 ]; then |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 72 | 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] | 73 | fi |
| 74 | if [ ! -e core-image-minimal-qemux86-64.qemuboot.conf ]; then |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 75 | 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] | 76 | fi |
| 77 | if [ ! -e bzImage-qemux86-64.bin ]; then |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 78 | 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] | 79 | fi |
| 80 | popd |
| 81 | bitbake qemu-helper-native |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 82 | DISPLAY=:1 runqemu serialstdio qemux86-64 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 83 | if [ "$?" != "0" ]; then |
| 84 | echo "Unable to use runqemu" |
| 85 | exit 1 |
| 86 | fi |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 87 | DISPLAY=:1 runqemu serialstdio qemux86-64 kvm |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 88 | if [ "$?" != "0" ]; then |
| 89 | echo "Unable to use runqemu with kvm" |
| 90 | exit 1 |
| 91 | fi |