setup-system 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. useradd bus
  45. mkdir -p git
  46. pushd git
  47. git clone https://tree.clementinecomputing.com/clementinecomputing/popufare
  48. git clone https://github.com/proxmark/proxmark3.git
  49. pushd proxmark3
  50. git pull
  51. sudo cp -rf driver/77-mm-usb-device-blacklist.rules /etc/udev/rules.d/77-mm-usb-device-blacklist.rules
  52. sudo udevadm control --reload-rules
  53. adduser pi dialout
  54. adduser bus dialout
  55. make clean && make all
  56. # Flash most recent firmware onto proxmark.
  57. # Assumes proxmark3 on /dev/ttyACM0 (`udevadm info /dev/ttyACM0` should show appropriate
  58. # proxmark information)
  59. #
  60. client/flasher /dev/ttyACM0 -b bootrom/obj/bootrom.elf armsrc/obj/fullimage.elf
  61. popd
  62. popd
  63. # setup `proxmark3` client program state
  64. #
  65. mkdir -p /home/bus/bin
  66. cp /root/git/proxmark3/client/proxmark3 /home/bus/bin
  67. cp -R /root/git/proxmark3/client/lualibs /home/bus/bin/
  68. cp -R /root/git/proxmark3/client/scripts /home/bus/bin/
  69. cp /root/git/popufare/busunit-PIU/scripts/proxmark3-lf-hid-read.lua /home/bus/bin/scripts
  70. chown -R bus:bus /home/bus