autobuilder-worker-prereq-tests 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #!/bin/bash
  2. #
  3. # Copyright OpenEmbedded Contributors
  4. #
  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. #
  8. # SPDX-License-Identifier: GPL-2.0-only
  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. if [ ! -x $HOME/yocto-autobuilder-helper/scripts/checkvnc ]; then
  20. echo "$HOME/yocto-autobuilder-helper should be created."
  21. exit 1
  22. fi
  23. $HOME/yocto-autobuilder-helper/scripts/checkvnc
  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
  38. python3 -c "import jinja2"
  39. if [ "$?" != "0" ]; then
  40. echo "Please ensure jinja2 is available"
  41. exit 1
  42. fi
  43. bitbake -p
  44. if [ "$?" != "0" ]; then
  45. echo "Bitbake parsing failed"
  46. exit 1
  47. fi
  48. WATCHES=$(PATH="/sbin:/usr/sbin:$PATH" sysctl fs.inotify.max_user_watches -n)
  49. if (( $WATCHES < 65000 )); then
  50. echo 'Need to increase watches (echo fs.inotify.max_user_watches=65536 | sudo tee -a /etc/sysctl.conf'
  51. exit 1
  52. fi
  53. OPEN_FILES=$(ulimit -n)
  54. if (( $OPEN_FILES < 65535 )); then
  55. echo 'Increase maximum open files in /etc/security/limits.conf'
  56. echo '* soft nofile 131072'
  57. echo '* hard nofile 131072'
  58. exit 1
  59. fi
  60. MAX_PROCESSES=$(ulimit -u)
  61. if (( $MAX_PROCESSES < 514542 )); then
  62. echo 'Increase maximum user processes in /etc/security/limits.conf'
  63. echo '* hard nproc 515294'
  64. echo '* soft nproc 514543'
  65. exit 1
  66. fi
  67. mkdir -p tmp/deploy/images/qemux86-64
  68. pushd tmp/deploy/images/qemux86-64
  69. if [ ! -e core-image-minimal-qemux86-64.ext4 ]; then
  70. wget http://downloads.yoctoproject.org/releases/yocto/yocto-4.0/machines/qemu/qemux86-64/core-image-minimal-qemux86-64.ext4
  71. fi
  72. if [ ! -e core-image-minimal-qemux86-64.qemuboot.conf ]; then
  73. wget http://downloads.yoctoproject.org/releases/yocto/yocto-4.0/machines/qemu/qemux86-64/core-image-minimal-qemux86-64.qemuboot.conf
  74. fi
  75. if [ ! -e bzImage-qemux86-64.bin ]; then
  76. wget http://downloads.yoctoproject.org/releases/yocto/yocto-4.0/machines/qemu/qemux86-64/bzImage-qemux86-64.bin
  77. fi
  78. popd
  79. bitbake qemu-helper-native
  80. DISPLAY=:1 runqemu serialstdio qemux86-64
  81. if [ "$?" != "0" ]; then
  82. echo "Unable to use runqemu"
  83. exit 1
  84. fi
  85. DISPLAY=:1 runqemu serialstdio qemux86-64 kvm
  86. if [ "$?" != "0" ]; then
  87. echo "Unable to use runqemu with kvm"
  88. exit 1
  89. fi