bootstrap.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. # Allow to continue the install, as gamemode has other useful features
  14. read -p "Would you like to continue anyway [Y/N]? " -r
  15. [[ $REPLY =~ ^[Yy]$ ]]
  16. fi
  17. # accept a prefix value as: prefix=/path ./bootstrap.sh
  18. : ${prefix:=/usr}
  19. # Echo the rest so it's obvious
  20. set -x
  21. meson --prefix=$prefix build -Dwith-systemd-user-unit-dir=/etc/systemd/user
  22. cd build
  23. ninja
  24. # Verify user wants to install
  25. set +x
  26. read -p "Install to $prefix? [Yy] " -r
  27. [[ $REPLY =~ ^[Yy]$ ]]
  28. set -x
  29. sudo ninja install
  30. # Reload systemd configuration so that it picks up the new service.
  31. systemctl --user daemon-reload