Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
4b907573
Commit
4b907573
authored
7 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Adding mesh support for OLSR2
parent
f0e7f97c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/freedombone-image-customise
+46
-0
46 additions, 0 deletions
src/freedombone-image-customise
src/freedombone-image-mesh
+4
-0
4 additions, 0 deletions
src/freedombone-image-mesh
src/freedombone-mesh-batman
+12
-1
12 additions, 1 deletion
src/freedombone-mesh-batman
with
62 additions
and
1 deletion
src/freedombone-image-customise
+
46
−
0
View file @
4b907573
...
...
@@ -125,6 +125,9 @@ ENABLE_ZERONET=
MESH_TEXT_EDITOR
=
'pluma'
OLSR2_REPO
=
"https://github.com/OLSR/OONF"
OLSR2_COMMIT
=
'81033251c4ee1c5699bfee9d2985112c6266ab0a'
BMX6_REPO
=
"https://github.com/bmx-routing/bmx6"
BMX6_COMMIT
=
'39dd1f2d99ac5a3fa28e92f8173c15039132e181'
...
...
@@ -668,6 +671,48 @@ mesh_shutdown_script() {
chroot
"
$rootdir
"
systemctl
enable
meshshutdown
}
install_olsr2
()
{
chroot
"
$rootdir
"
apt-get
-yq
install
cmake libnl-3-dev
git clone
$OLSR2_REPO
$rootdir
/etc/olsr2
cat
<<
EOF
>
$rootdir
/usr/bin/install_olsr2
#!/bin/bash
cd /etc/olsr2
git checkout
$OLSR2_COMMIT
-b
$OLSR2_COMMIT
cd /etc/olsr2/build
cmake ..
make
make install
EOF
chroot
"
$rootdir
"
chmod
+x /usr/bin/install_olsr2
chroot
"
$rootdir
"
/usr/bin/install_olsr2
if
[
!
-f
/usr/local/sbin/olsrd2_static
]
;
then
echo
$'Unable to build OLSR2'
exit
79835392
fi
rm
$rootdir
/usr/bin/install_olsr2
echo
'[Unit]'
>
$rootdir
/etc/systemd/system/olsr2.service
echo
'Description=OLSR2 mesh routing protocol'
>>
$rootdir
/etc/systemd/system/olsr2.service
echo
'Requires=network.target'
>>
$rootdir
/etc/systemd/system/olsr2.service
echo
'After=network.target'
>>
$rootdir
/etc/systemd/system/olsr2.service
echo
''
>>
$rootdir
/etc/systemd/system/olsr2.service
echo
'[Service]'
>>
$rootdir
/etc/systemd/system/olsr2.service
echo
'Type=forking'
>>
$rootdir
/etc/systemd/system/olsr2.service
echo
'User=root'
>>
$rootdir
/etc/systemd/system/olsr2.service
echo
'Group=root'
>>
$rootdir
/etc/systemd/system/olsr2.service
echo
'ExecStart=/usr/local/sbin/olsrd2_static wlan0'
>>
$rootdir
/etc/systemd/system/olsr2.service
echo
'ExecStop=/usr/bin/kill -15 $MAINPID'
>>
$rootdir
/etc/systemd/system/olsr2.service
echo
'PIDFile=/var/run/olsr2/pid'
>>
$rootdir
/etc/systemd/system/olsr2.service
echo
'Restart=on-failure'
>>
$rootdir
/etc/systemd/system/olsr2.service
echo
''
>>
$rootdir
/etc/systemd/system/olsr2.service
echo
'[Install]'
>>
$rootdir
/etc/systemd/system/olsr2.service
echo
'WantedBy=multi-user.target'
>>
$rootdir
/etc/systemd/system/olsr2.service
}
install_bmx6
()
{
git clone
$BMX6_REPO
$rootdir
/etc/bmx6
...
...
@@ -853,6 +898,7 @@ initialise_mesh() {
install_batman
install_bmx6
install_bmx7
install_olsr2
mesh_shutdown_script
install_vpn
install_tomb
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-image-mesh
+
4
−
0
View file @
4b907573
...
...
@@ -1423,6 +1423,10 @@ if [ -f $MESH_INSTALL_SETUP ]; then
systemctl disable bmx7
echo
$'BMX7 disabled'
>>
$INSTALL_LOG
systemctl stop olsr2
systemctl disable olsr2
echo
$'OLSR2 disabled'
>>
$INSTALL_LOG
#tomb slam all
tmp_ram_disk 100
enable_predictable_device_names
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-mesh-batman
+
12
−
1
View file @
4b907573
...
...
@@ -71,8 +71,10 @@ function stop {
systemctl stop bmx6
systemctl stop bmx7
systemctl stop olsr2
systemctl disable bmx6
systemctl disable bmx7
systemctl disable olsr2
systemctl stop dnsmasq
systemctl disable dnsmasq
...
...
@@ -206,6 +208,7 @@ function start {
sed
-i
"s|ExecStart=.*|ExecStart=/usr/sbin/bmx6 dev=
${
IFACE
}
|g"
/etc/systemd/system/bmx6.service
sed
-i
"s|ExecStart=.*|ExecStart=/usr/sbin/bmx7 dev=
${
IFACE
}
|g"
/etc/systemd/system/bmx7.service
sed
-i
"s|ExecStart=.*|ExecStart=/usr/local/sbin/olsrd2_static
${
IFACE
}
|g"
/etc/systemd/system/olsr2.service
systemctl daemon-reload
add_wifi_interface
$IFACE
$WIFI_SSID
ad-hoc
$CHANNEL
...
...
@@ -229,6 +232,7 @@ function start {
sed
-i
"s|ExecStart=.*|ExecStart=/usr/sbin/bmx6 dev=
${
IFACE
}
dev=
${
EIFACE
}
|g"
/etc/systemd/system/bmx6.service
sed
-i
"s|ExecStart=.*|ExecStart=/usr/sbin/bmx7 dev=
${
IFACE
}
dev=
${
EIFACE
}
|g"
/etc/systemd/system/bmx7.service
sed
-i
"s|ExecStart=.*|ExecStart=/usr/local/sbin/olsrd2_static
${
IFACE
}
${
EIFACE
}
|g"
/etc/systemd/system/olsr2.service
systemctl daemon-reload
else
echo
$"
$EIFACE
is not connected"
...
...
@@ -255,11 +259,18 @@ function start {
if
grep
-q
"bmx6"
$MESH_DEFAULT_PROTOCOL
;
then
systemctl
enable
bmx6
systemctl restart bmx6
else
fi
if
grep
-q
"bmx7"
$MESH_DEFAULT_PROTOCOL
;
then
systemctl
enable
bmx7
systemctl restart bmx7
fi
if
grep
-q
"olsr"
$MESH_DEFAULT_PROTOCOL
;
then
systemctl
enable
olsr2
systemctl restart olsr2
fi
systemctl restart avahi-daemon
verify
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment