freedombone-utils-filesystem 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #!/bin/bash
  2. #
  3. # .---. . .
  4. # | | |
  5. # |--- .--. .-. .-. .-.| .-. .--.--. |.-. .-. .--. .-.
  6. # | | (.-' (.-' ( | ( )| | | | )( )| | (.-'
  7. # ' ' --' --' -' - -' ' ' -' -' -' ' - --'
  8. #
  9. # Freedom in the Cloud
  10. #
  11. # Filesystem encryption, etc
  12. #
  13. # License
  14. # =======
  15. #
  16. # Copyright (C) 2014-2016 Bob Mottram <bob@freedombone.net>
  17. #
  18. # This program is free software: you can redistribute it and/or modify
  19. # it under the terms of the GNU Affero General Public License as published by
  20. # the Free Software Foundation, either version 3 of the License, or
  21. # (at your option) any later version.
  22. #
  23. # This program is distributed in the hope that it will be useful,
  24. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  26. # GNU Affero General Public License for more details.
  27. #
  28. # You should have received a copy of the GNU Affero General Public License
  29. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  30. TOMB_REPO="https://github.com/dyne/Tomb"
  31. TOMB_COMMIT='c80ebd6d6ed77980eb5b559757e03ea13a29bdd1'
  32. function mesh_install_tomb {
  33. chroot ${rootdir} apt-get -yq install cryptsetup zsh pinentry-curses
  34. if [ ! -d ${rootdir}/$INSTALL_DIR ]; then
  35. mkdir -p ${rootdir}/$INSTALL_DIR
  36. fi
  37. git_clone $TOMB_REPO ${rootdir}/$INSTALL_DIR/tomb
  38. cd ${rootdir}/$INSTALL_DIR/tomb
  39. git checkout $TOMB_COMMIT -b $TOMB_COMMIT
  40. chroot ${rootdir} /bin/bash -x <<EOF
  41. cd $INSTALL_DIR/tomb
  42. make install
  43. EOF
  44. if [ ! -f ${rootdir}/usr/local/bin/tomb ]; then
  45. exit 93462
  46. fi
  47. }
  48. function install_tomb {
  49. if [ $INSTALLING_MESH ]; then
  50. mesh_install_tomb
  51. return
  52. fi
  53. function_check set_repo_commit
  54. set_repo_commit $INSTALL_DIR/tomb "tomb commit" "$TOMB_COMMIT" $TOMB_REPO
  55. if [ -f $COMPLETION_FILE ]; then
  56. if [[ $(is_completed $FUNCNAME) == "1" ]]; then
  57. return
  58. fi
  59. fi
  60. apt-get -yq install cryptsetup zsh pinentry-curses
  61. if [ ! -d $INSTALL_DIR ]; then
  62. mkdir -p $INSTALL_DIR
  63. fi
  64. git_clone $TOMB_REPO $INSTALL_DIR/tomb
  65. cd $INSTALL_DIR/tomb
  66. git checkout $TOMB_COMMIT -b $TOMB_COMMIT
  67. set_completion_param "tomb commit" "$TOMB_COMMIT"
  68. make install
  69. if [ ! -f /usr/local/bin/tomb ]; then
  70. exit 93462
  71. fi
  72. mark_completed $FUNCNAME
  73. }
  74. # NOTE: deliberately no exit 0