install-ubuntu.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #!/bin/bash
  2. # Copyright (c) Contributors to the Open 3D Engine Project.
  3. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. #
  5. # SPDX-License-Identifier: Apache-2.0 OR MIT
  6. #
  7. # This script must be run as root
  8. if [[ $EUID -ne 0 ]]
  9. then
  10. echo "This script must be run as root (sudo)"
  11. exit 1
  12. fi
  13. echo Configuring environment settings
  14. # Enable coredumps - Will be written to /var/lib/apport/coredump
  15. ulimit -c unlimited
  16. # Configure NTP sync - This is necessary to prevent mtime drift between input and output files
  17. systemctl stop systemd-timesyncd
  18. systemctl disable systemd-timesyncd
  19. apt install -y chrony
  20. if [ $(curl -LI http://169.254.169.254/latest/meta-data/ -o /dev/null -w '%{http_code}\n' -s) == "200" ]; then
  21. echo EC2 instance detected. Setting NTP address to AWS NTP
  22. sed -i '1s/^/server 169.254.169.123 prefer iburst minpoll 4 maxpoll 4\n/' /etc/chrony/chrony.conf
  23. fi
  24. /etc/init.d/chrony restart
  25. echo Installing packages and tools for O3DE development
  26. # Install awscli
  27. ./install-ubuntu-awscli.sh
  28. if [ $? -ne 0 ]
  29. then
  30. echo Error installing AWSCLI
  31. exit 1
  32. fi
  33. # Install git
  34. ./install-ubuntu-git.sh
  35. if [ $? -ne 0 ]
  36. then
  37. echo Error installing Git
  38. exit 1
  39. fi
  40. # Install the necessary build tools repos
  41. ./install-ubuntu-build-tools.sh
  42. if [ $? -ne 0 ]
  43. then
  44. echo Error installing ubuntu tool repos
  45. exit 1
  46. fi
  47. # Install the packages in the platform list
  48. ./install-ubuntu-packages.sh
  49. if [ $? -ne 0 ]
  50. then
  51. echo Error installing ubuntu packages
  52. exit 1
  53. fi
  54. # Add mountpoint for Jenkins
  55. if [ ! -d /data ]
  56. then
  57. echo Data folder does not exist. Creating it.
  58. mkdir /data
  59. chown $USER /data
  60. fi
  61. echo Packages and tools for O3DE setup complete
  62. exit 0