Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CONFLICT] WIP - BMX7 Module #436

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
Open
12 changes: 12 additions & 0 deletions scripts/bmx7/bmx7.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=BMX7
Wants=network.target
After=network.target

[Service]
SyslogIdentifier=BMX7
ExecStart=/usr/sbin/bmx7 debug=0 dev=wlan0 dev=wlan1 dev=eth0
Restart=always

[Install]
WantedBy=multi-user.target
34 changes: 34 additions & 0 deletions scripts/bmx7/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

sudo apt-get install libiw-dev

# Copied from https://github.com/bmx-routing/bmx7#bmx7
mkdir $BASE_DIR/tmp

(
wget https://tls.mbed.org/download/mbedtls-2.4.0-gpl.tgz -O "$BASE_DIR/tmp/mbedtls-2.4.0-gpl.tgz"
cd "$BASE_DIR/tmp" || exit
tar xzvf mbedtls-2.4.0-gpl.tgz
cd mbedtls-2.4.0 || exit
make
sudo make install
)

(
cd "$BASE_DIR/tmp" || exit
# compile bmx7 with: make EXTRA_CFLAGS="-DCRYPTLIB=MBEDTLS_2_4_0"
git clone https://github.com/bmx-routing/bmx7.git
cd bmx7 || exit
make EXTRA_CFLAGS="-DCRYPTLIB=MBEDTLS_2_4_0"
sudo make install
)

rm -rf "$BASE_DIR/tmp"

sudo cp "$BASE_DIR/bmx7.service" /etc/systemd/system/bmx7.service

sudo systemctl daemon-reload
sudo systemctl enable bmx7.service
sudo systemctl start bmx7.service
7 changes: 7 additions & 0 deletions scripts/bmx7/uninstall
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

sudo systemctl stop bmx7.service
sudo systemctl disable bmx7.service
rm -rf /etc/systemd/system/bmx7.service
sudo systemctl daemon-reload
rm -rf /usr/sbin/bmx7
1 change: 1 addition & 0 deletions scripts/install
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export WITH_SSB
export WITH_SSB_PATCHFOO
export WITH_SSB_WEB_PI
export WITH_IPFS_PI_STREAM
export WITH_BMX7

export UNATTENDED
# Run the actual installation script
Expand Down
12 changes: 12 additions & 0 deletions scripts/install2
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ case "$dialogREPLY" in
echo "Basic node"
WITH_YGGDRASIL=true
WITH_YGGDRASIL_IPTUNNEL=true
WITH_BMX7=""
WITH_MESH_POINT=""
WITH_WIFI_AP=""
WITH_FIREWALL=true
Expand All @@ -190,6 +191,7 @@ case "$dialogREPLY" in
echo "Basic IPFS node"
WITH_YGGDRASIL=true
WITH_YGGDRASIL_IPTUNNEL=true
WITH_BMX7=""
WITH_MESH_POINT=""
WITH_WIFI_AP=""
WITH_FIREWALL=true
Expand All @@ -209,6 +211,7 @@ case "$dialogREPLY" in
echo "Monitor Node"
WITH_YGGDRASIL=true
WITH_YGGDRASIL_IPTUNNEL=true
WITH_BMX7=""
WITH_MESH_POINT=""
WITH_WIFI_AP=""
WITH_FIREWALL=true
Expand All @@ -228,6 +231,7 @@ case "$dialogREPLY" in
echo "SSB Node"
WITH_YGGDRASIL=true
WITH_YGGDRASIL_IPTUNNEL=true
WITH_BMX7=""
WITH_MESH_POINT=""
WITH_WIFI_AP=""
WITH_FIREWALL=true
Expand All @@ -247,6 +251,7 @@ case "$dialogREPLY" in
echo "IPFS Camera Node"
WITH_YGGDRASIL=true
WITH_YGGDRASIL_IPTUNNEL=true
WITH_BMX7=""
WITH_MESH_POINT=""
WITH_WIFI_AP=""
WITH_FIREWALL=true
Expand All @@ -265,6 +270,7 @@ case "$dialogREPLY" in
"F")
echo "Raspberry Pi Ad-Hoc"
WITH_YGGDRASIL=true
WITH_BMX7=""
WITH_MESH_POINT=false
WITH_AD_HOC=true
WITH_WIFI_AP=false
Expand Down Expand Up @@ -304,6 +310,7 @@ askModule "WITH_YGGDRASIL" "Yggdrasil routing engine"
if [ "$WITH_YGGDRASIL" == "true" ]; then
askModule "WITH_YGGDRASIL_IPTUNNEL" "Internet Gateway over Yggdrasil"
fi
askModule "WITH_BMX7" "BMX7 routing engine"
askModule "WITH_MESH_POINT" "Mesh Point Interface"
if [ "$WITH_MESH_POINT" == false ]; then
askModule "WITH_AD_HOC" "Ad-Hoc Interface"
Expand Down Expand Up @@ -436,6 +443,11 @@ if [ "$(checkModule 'WITH_AD_HOC')" ]; then
source mesh-adhoc/install
fi

# Install bmx7
if [ "$(checkModule 'WITH_BMX7')" ]; then
source bmx7/install
fi

# WiFi Access Point on supported boards
if [ "$SUPPORT_HOSTAP" == "true" ] && [ "$(checkModule 'WITH_WIFI_AP')" ]; then
source hostapd/install
Expand Down
1 change: 1 addition & 0 deletions scripts/uninstall
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ source "$BASE_DIR/shared/nodeinfo/uninstall"
source "$BASE_DIR/nginx/uninstall"
source "$BASE_DIR/yggdrasil/uninstall"
source "$BASE_DIR/yggdrasil-iptunnel/uninstall"
source "$BASE_DIR/bmx7"

sudo systemctl daemon-reload

Expand Down