forked from usb-tools/USBProxy-legacy
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ac8d58c
commit 4129b1f
Showing
11 changed files
with
292 additions
and
58 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.0.3 | ||
0.0.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
set -e | ||
set -o pipefail | ||
|
||
echo -e "[0/7] Updating package list\n" | ||
sudo apt-get update | ||
|
||
echo -e "[1/7] Installing cmake" | ||
sudo apt-get install -y cmake | ||
|
||
echo -e "[2/7] Installing libusb\n" | ||
sudo apt-get install -y libusb-1.0.0-dev | ||
|
||
echo -e "[3/7] Installing boost libs: chrono, timer, system\n" | ||
sudo apt-get install -y libboost-chrono-dev libboost-timer-dev libboost-system-dev | ||
|
||
echo -e "[4/7] Installing libzmq\n" | ||
sudo apt-get install -y libzmq3-dev | ||
|
||
echo -e "[5/7] Installing cppzmq\n" | ||
git clone https://github.com/zeromq/cppzmq.git /tmp/cppzmq || echo "Skipped clone." | ||
(cd /tmp/cppzmq && mkdir -p build && cd build && cmake -DCPPZMQ_BUILD_TESTS=off .. && sudo make -j4 install) | ||
|
||
echo -e "[6/7] Installing msgpack\n" | ||
git clone https://github.com/msgpack/msgpack-c.git /tmp/msgpack-c || echo "Skipped clone." | ||
(cd /tmp/msgpack-c && git checkout cpp_master && cmake -DMSGPACK_CXX17=ON . && sudo make install) | ||
|
||
echo -e "[7/7] Put RPi USB into client mode" | ||
set +e | ||
set +o pipefail | ||
|
||
cat /boot/config.txt | grep -q dwc2 | ||
rc=$? | ||
|
||
if [ $rc -ne 0 ]; then | ||
echo "dtoverlay=dwc2" | sudo tee -a /boot/config.txt | ||
echo "dwc2" | sudo tee -a /etc/modules | ||
|
||
echo "Changed USB c port to OTG client mode." | ||
fi | ||
|
||
echo -e "\nYou must restart the pi now for changes to usb mode to take effect!!! Use: 'sudo reboot now'\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,41 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if [ -z "$1" ]; then | ||
echo "Pass AccessKeyId as first parameter." | ||
exit 1 | ||
fi | ||
echo "This script is intended to configure the debian repository for the USB Proxy project and install the latest binary." | ||
echo "" | ||
echo "Setting up the APT repository which is hosted on S3..." | ||
|
||
if [ -z "$2" ]; then | ||
echo "Pass SecretAccessKey as second parameter." | ||
exit 1 | ||
fi | ||
read -p 'AWS Access Key: ' | ||
echo ""; | ||
ACCESS_KEY_ID=${REPLY} | ||
|
||
read -s -p 'AWS Secret Access Key (hidden input): ' | ||
echo ""; | ||
SECRET_ACCESS_KEY=${REPLY} | ||
|
||
REGION=eu-central-1 | ||
BUCKET=nesto-debian-repo-devel | ||
GPG_KEY_ID=92F91ABA4816493E | ||
PKG_NAME=nesto-usbproxy | ||
GPG_KEYSERVER=keys.openpgp.org | ||
|
||
echo "Installing tools which are needed by APT to access S3..." | ||
sudo apt-get update | ||
sudo apt-get install apt-transport-s3 | ||
echo -e "AccessKeyId = '$1'\nSecretAccessKey = '$2'\nRegion = 'eu-central-1'\nToken = ''" > /etc/apt/s3auth.conf | ||
echo "deb s3://nesto-debian-repo-devel unofficial local" >> /etc/apt/sources.list | ||
gpg --keyserver keys.openpgp.org --receive-key 92F91ABA4816493E | ||
gpg --export --armor "92F91ABA4816493E" | apt-key add - | ||
|
||
echo "Configuring the S3 transport for APT..." | ||
echo -e "AccessKeyId = '$ACCESS_KEY_ID'\nSecretAccessKey = '$SECRET_ACCESS_KEY'\nRegion = '$REGION'\nToken = ''" > /etc/apt/s3auth.conf | ||
|
||
# note: please do not use nightly for production systems | ||
echo "deb s3://$BUCKET main aws" >> /etc/apt/sources.list | ||
echo "deb s3://$BUCKET nightly aws" >> /etc/apt/sources.list | ||
|
||
echo "Setting up APT keys for our S3 repo..." | ||
gpg --keyserver "$GPG_KEYSERVER" --receive-key "$GPG_KEY_ID" | ||
gpg --export --armor "$GPG_KEY_ID" | apt-key add - | ||
|
||
echo "Updating the package list with the index from our S3 repo..." | ||
sudo apt-get update | ||
sudo apt-get install nesto-usbproxy | ||
|
||
echo "Finally installing the latest version of our application..." | ||
sudo apt-get install $PKG_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.