autobuilder-worker-prereq-tests 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. # SPDX-License-Identifier: GPL-2.0-only
  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. if [ ! -x $HOME/yocto-autobuilder-helper/scripts/checkvnc ]; then
  18. echo "$HOME/yocto-autobuilder-helper should be created."
  19. exit 1
  20. fi
  21. $HOME/yocto-autobuilder-helper/scripts/checkvnc
  22. . ./oe-init-build-env > /dev/null
  23. if [ "$?" != "0" ]; then
  24. exit 1
  25. fi
  26. git config --global user.name > /dev/null
  27. if [ "$?" != "0" ]; then
  28. echo "Please set git config --global user.name"
  29. exit 1
  30. fi
  31. git config --global user.email > /dev/null
  32. if [ "$?" != "0" ]; then
  33. echo "Please set git config --global user.email"
  34. exit 1
  35. fi
  36. bitbake -p
  37. if [ "$?" != "0" ]; then
  38. echo "Bitbake parsing failed"
  39. exit 1
  40. fi
  41. WATCHES=$(PATH="/sbin:/usr/sbin:$PATH" sysctl fs.inotify.max_user_watches -n)
  42. if (( $WATCHES < 65000 )); then
  43. echo 'Need to increase watches (echo fs.inotify.max_user_watches=65536 | sudo tee -a /etc/sysctl.conf'
  44. exit 1
  45. fi
  46. mkdir -p tmp/deploy/images/qemux86-64
  47. pushd tmp/deploy/images/qemux86-64
  48. if [ ! -e core-image-minimal-qemux86-64.ext4 ]; then
  49. wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.5.1/machines/qemu/qemux86-64/core-image-minimal-qemux86-64.ext4
  50. fi
  51. if [ ! -e core-image-minimal-qemux86-64.qemuboot.conf ]; then
  52. wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.5.1/machines/qemu/qemux86-64/core-image-minimal-qemux86-64.qemuboot.conf
  53. fi
  54. if [ ! -e bzImage-qemux86-64.bin ]; then
  55. wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.5.1/machines/qemu/qemux86-64/bzImage-qemux86-64.bin
  56. fi
  57. popd
  58. bitbake qemu-helper-native
  59. DISPLAY=:1 runqemu serialstdio qemux86-64
  60. if [ "$?" != "0" ]; then
  61. echo "Unable to use runqemu"
  62. exit 1
  63. fi
  64. DISPLAY=:1 runqemu serialstdio qemux86-64 kvm
  65. if [ "$?" != "0" ]; then
  66. echo "Unable to use runqemu with kvm"
  67. exit 1
  68. fi