u-src 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/sh
  2. # This file is part of UPM. 
  3. # Copyright (c) 2016 ali abdul ghani <blade.vp2020@gmail.com>
  4. # UPM is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation, either version 3 of the License, or
  7. # (at your option) any later version. 
  8. # UPM is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12.  
  13. # You should have received a copy of the GNU General Public License
  14. # along with UPM. If not, see <http://www.gnu.org/licenses/>.
  15. if test $# = 0
  16. then
  17. echo E: Invalid operation
  18. exit
  19. fi
  20. if echo "$1" | grep -q "tar.bz2"; then
  21. tar -xvjf $1
  22. re=${1%????????}
  23. else
  24. tar -xvzf $1
  25. re=${1%???????}
  26. fi
  27. fdir=($pwd)
  28. cd $re
  29. e=${re:0:5}
  30. if echo "$1" | grep -q "linux"; then
  31. make olddefconfig
  32. make
  33. sudo make modules_install install
  34. else
  35. chmod +x configure
  36. sudo ./configure
  37. make
  38. sudo make install
  39. fi
  40. cd $fdir
  41. rm -R $re