You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.8 KiB

6 years ago
  1. #!/bin/bash
  2. dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
  3. pushd "$dir";
  4. if [[ $dir != /mnt/* ]];
  5. then
  6. echo
  7. echo "You need to clone the qmk_firmware repository outside the linux filesystem."
  8. echo "Otherwise the windows executables can't be run."
  9. exit 1
  10. fi
  11. while true; do
  12. echo
  13. echo "Do you want to install all toolchain dependencies needed for compiling QMK?"
  14. echo "If you don't want that, you can install the dependencies manually."
  15. read -p "(Y/N) " res
  16. case $res in
  17. [Yy]* ) ./linux_install.sh; break;;
  18. [Nn]* ) break;;
  19. * ) echo "Invalid answer";;
  20. esac
  21. done
  22. download_dir=wsl_downloaded
  23. source "$dir/win_shared_install.sh"
  24. pushd "$download_dir"
  25. while true; do
  26. echo
  27. echo "Flip need to be installed if you want to use that for programming."
  28. echo "Please install it to the default location!"
  29. read -p "Do you want to install it now? (Y/N) " res
  30. case $res in
  31. [Yy]* ) cmd.exe /c FlipInstaller.exe; break;;
  32. [Nn]* ) break;;
  33. * ) echo "Invalid answer";;
  34. esac
  35. done
  36. popd
  37. echo
  38. echo "Creating a softlink to the utils directory as ~/qmk_utils."
  39. echo "This is needed so that the the make system can find all utils it need."
  40. read -p "Press enter to continue (ctrl-c to abort)"
  41. ln -sfn "$dir" ~/qmk_utils
  42. if grep "^source ~/qmk_utils/activate_wsl.sh$" ~/.bashrc
  43. then
  44. echo
  45. echo "The line source ~/qmk_utils/activate_wsl.sh is already added to your /.bashrc"
  46. echo "Not adding it twice"
  47. else
  48. while true; do
  49. echo
  50. echo "Do you want to add 'source ~/qmk_utils/activate_wsl.sh' to the end of your"
  51. echo ".bashrc file? Without this make won't find the needed utils, so if you don't"
  52. echo "want to do it automatically, then you have to do it manually later."
  53. read -p "(Y/N)? " res
  54. case $res in
  55. [Yy]* ) echo "source ~/qmk_utils/activate_wsl.sh" >> ~/.bashrc; break;;
  56. [Nn]* ) break;;
  57. * ) echo "Invalid answer";;
  58. esac
  59. done
  60. fi
  61. while true; do
  62. echo
  63. echo "Do you want to add a symlink to the QMK repository in your home directory for"
  64. echo "convenience? This will create a folder 'qmk_firmware' in your home directory."
  65. echo "In the future you can use this folder instead of the full path on your Windows"
  66. echo "file system."
  67. read -p "(Y/N)? " res
  68. case $res in
  69. [Yy]* ) ln -sfn "$dir/.." ~/qmk_firmware; break;;
  70. [Nn]* ) break;;
  71. * ) echo "Invalid answer";;
  72. esac
  73. done
  74. echo
  75. echo "******************************************************************************"
  76. echo "Installation completed!"
  77. echo "You need to open a new bash command prompt for all the utils to work properly"
  78. echo "******************************************************************************"
  79. popd > /dev/null