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.

95 lines
2.8 KiB

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