setup-system 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #!/bin/bash
  2. #
  3. # Copyright (c) 2019 Clementine Computing LLC.
  4. #
  5. # This file is part of PopuFare.
  6. #
  7. # PopuFare is free software: you can redistribute it and/or modify
  8. # it under the terms of the GNU Affero General Public License as published by
  9. # the Free Software Foundation, either version 3 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # PopuFare is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU Affero General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU Affero General Public License
  18. # along with PopuFare. If not, see <https://www.gnu.org/licenses/>.
  19. #
  20. # Helper script to setup the PIU system.
  21. # Meant to be run as root.
  22. #
  23. # Remove bloat.
  24. # Note this is mainly a note as in the future,
  25. # the system will have these packages already
  26. # removed.
  27. #
  28. apt-get purge -y wolfram-engine wolframscript \
  29. scratch scratch2 \
  30. libreoffice-core libreoffice-base-core
  31. # For development
  32. #
  33. apt-get install -y vim
  34. # For HID (magstripe)
  35. #
  36. apt-get install -y python3-evdev
  37. # proxmark3 install
  38. #
  39. apt-get install -y p7zip git build-essential \
  40. libreadline5 libreadline-dev libusb-0.1-4 \
  41. libusb-dev libqt4-dev perl pkg-config wget \
  42. libncurses5-dev gcc-arm-none-eabi \
  43. libstdc++-arm-none-eabi-newlib libpcsclite-dev pcscd
  44. # video and opencv install
  45. #
  46. apt-get install -y motion v4l2loopback-utils v4l2loopback-source \
  47. python3-opencv python-opencv \
  48. libzbar-dev libzbar0 python-zbar python-qrtools zbar-tools
  49. pip install pyzbar imutils
  50. pip3 install pyzbar imutils
  51. # misc
  52. #
  53. apt-get install -y jq
  54. useradd bus
  55. mkdir -p git
  56. pushd git
  57. git clone https://tree.clementinecomputing.com/clementinecomputing/popufare
  58. git clone https://github.com/proxmark/proxmark3.git
  59. pushd proxmark3
  60. git pull
  61. sudo cp -rf driver/77-mm-usb-device-blacklist.rules /etc/udev/rules.d/77-mm-usb-device-blacklist.rules
  62. sudo udevadm control --reload-rules
  63. adduser pi dialout
  64. adduser bus dialout
  65. make clean && make all
  66. # Flash most recent firmware onto proxmark.
  67. # Assumes proxmark3 on /dev/ttyACM0 (`udevadm info /dev/ttyACM0` should show appropriate
  68. # proxmark information)
  69. #
  70. client/flasher /dev/ttyACM0 -b bootrom/obj/bootrom.elf armsrc/obj/fullimage.elf
  71. popd
  72. popd
  73. # setup `proxmark3` client program state
  74. #
  75. mkdir -p /home/bus/bin
  76. cp /root/git/proxmark3/client/proxmark3 /home/bus/bin
  77. cp -R /root/git/proxmark3/client/lualibs /home/bus/bin/
  78. cp -R /root/git/proxmark3/client/scripts /home/bus/bin/
  79. cp /root/git/popufare/busunit-PIU/scripts/proxmark3-lf-hid-read.lua /home/bus/bin/scripts
  80. chown -R bus:bus /home/bus