autobuilder-worker-prereq-tests 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. python3 -c "import jinja2"
  37. if [ "$?" != "0" ]; then
  38. echo "Please ensure jinja2 is available"
  39. exit 1
  40. fi
  41. bitbake -p
  42. if [ "$?" != "0" ]; then
  43. echo "Bitbake parsing failed"
  44. exit 1
  45. fi
  46. WATCHES=$(PATH="/sbin:/usr/sbin:$PATH" sysctl fs.inotify.max_user_watches -n)
  47. if (( $WATCHES < 65000 )); then
  48. echo 'Need to increase watches (echo fs.inotify.max_user_watches=65536 | sudo tee -a /etc/sysctl.conf'
  49. exit 1
  50. fi
  51. mkdir -p tmp/deploy/images/qemux86-64
  52. pushd tmp/deploy/images/qemux86-64
  53. if [ ! -e core-image-minimal-qemux86-64.ext4 ]; then
  54. wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.5.1/machines/qemu/qemux86-64/core-image-minimal-qemux86-64.ext4
  55. fi
  56. if [ ! -e core-image-minimal-qemux86-64.qemuboot.conf ]; then
  57. wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.5.1/machines/qemu/qemux86-64/core-image-minimal-qemux86-64.qemuboot.conf
  58. fi
  59. if [ ! -e bzImage-qemux86-64.bin ]; then
  60. wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.5.1/machines/qemu/qemux86-64/bzImage-qemux86-64.bin
  61. fi
  62. popd
  63. bitbake qemu-helper-native
  64. DISPLAY=:1 runqemu serialstdio qemux86-64
  65. if [ "$?" != "0" ]; then
  66. echo "Unable to use runqemu"
  67. exit 1
  68. fi
  69. DISPLAY=:1 runqemu serialstdio qemux86-64 kvm
  70. if [ "$?" != "0" ]; then
  71. echo "Unable to use runqemu with kvm"
  72. exit 1
  73. fi