bootstrap.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/bash
  2. # Simple bootstrap script to build and run the daemon
  3. if [ "$EUID" -eq 0 ]
  4. then echo "Please don't run bootstrap.sh as root."
  5. exit
  6. fi
  7. set -e
  8. # Check for scaling governor support and warn about it
  9. if [ ! -f "/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor" ]; then
  10. echo "WARNING: CPUFreq scaling governor device file was not found at \"/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor\"."
  11. echo "This probably means that you have disabled processor scheduling features in your BIOS. See README.md (or GitHub issue #44) for more information."
  12. echo "This means GameMode's CPU governor control feature will not work (other features will still work)."
  13. if [ "$TRAVIS" != "true" ]; then
  14. # Allow to continue the install, as gamemode has other useful features
  15. read -p "Would you like to continue anyway [Y/N]? " -r
  16. [[ $REPLY =~ ^[Yy]$ ]]
  17. fi
  18. fi
  19. # accept a prefix value as: prefix=/path ./bootstrap.sh
  20. : ${prefix:=/usr}
  21. # Echo the rest so it's obvious
  22. set -x
  23. meson --prefix=$prefix build --buildtype debugoptimized -Dwith-systemd-user-unit-dir=/etc/systemd/user
  24. cd build
  25. ninja
  26. # Verify user wants to install
  27. set +x
  28. if [ "$TRAVIS" != "true" ]; then
  29. read -p "Install to $prefix? [Yy] " -r
  30. [[ $REPLY =~ ^[Yy]$ ]]
  31. fi
  32. set -x
  33. sudo ninja install
  34. # Reload systemd configuration so that it picks up the new service.
  35. systemctl --user daemon-reload