install-ubuntu.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 necessary build tools for android on linux
  48. ./install-ubuntu-build-android-tools.sh
  49. if [ $? -ne 0 ]
  50. then
  51. echo Error installing ubuntu android tools
  52. exit 1
  53. fi
  54. # Install the packages in the platform list
  55. ./install-ubuntu-packages.sh
  56. if [ $? -ne 0 ]
  57. then
  58. echo Error installing ubuntu packages
  59. exit 1
  60. fi
  61. # Add mountpoint for Jenkins
  62. if [ ! -d /data ]
  63. then
  64. echo Data folder does not exist. Creating it.
  65. mkdir /data
  66. chown $USER /data
  67. fi
  68. echo Packages and tools for O3DE setup complete
  69. exit 0