Skip to content

Commit

Permalink
Update README.md and create BUILDING.md
Browse files Browse the repository at this point in the history
  • Loading branch information
neilalexander committed Aug 31, 2017
1 parent b7a8dec commit dec3cb9
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 108 deletions.
114 changes: 114 additions & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Building vyatta-cjdns

### Compatibility

| | Architecture | Compatible | Notes |
|-----------------------|:------------:|:----------:|:-------------------------------------------------------------:|
| EdgeRouter X (ERX) | mipsel | Yes | Builds with crossbuild-essential, see below |
| EdgeRouter Lite (ERL) | mips64 | Yes | Builds with Codescape SDK as mips32, see below |
| VyOS 1.1.x | i386, amd64 | Yes | Builds with crossbuild-essential on Squeeze only, see below |

### Building for Supported Platforms

Use the provided shell scripts, which will do most of the hard work for you:
```
./build-edgerouter-x
./build-edgerouter-lite
./build-vyos
```

### Manually Building for EdgeRouter X

On 64-bit Debian Jessie, start by installing the toolchain:
```
echo "deb http://emdebian.org/tools/debian/ jessie main" >> /etc/apt/sources.list
wget http://emdebian.org/tools/debian/emdebian-toolchain-archive.key
apt-key add emdebian-toolchain-archive.key
dpkg --add-architecture mipsel
apt-get update
apt-get install -y crossbuild-essential-mipsel
```
Compile the package from the `master` branch by cloning the repository and running 'make':
```
cd vyatta-cjdns
PREFIX='mipsel-linux-gnu-' PKGARCH='mipsel' make -e
```
Alternatively, clone and compile the `crashey` branch:
```
cd vyatta-cjdns
PREFIX='mipsel-linux-gnu-' PKGARCH='mipsel' BRANCH=crashey make -e
```
The package `vyatta-cjdns.deb` will be created in the parent directory. Copy it to the EdgeRouter and install it:
```
sudo dpkg -i vyatta-cjdns.deb
```

### Manually Building for EdgeRouter Lite

On 64-bit Debian Jessie, start by installing the build-essential package:
```
apt-get update
apt-get install -y build-essential
```
So far the only proven working toolchain is the Codescape SDK 2015.01.7 (and 2015.06.05).

Download the toolchain, assuming your homedir:
```
wget http://codescape-mips-sdk.imgtec.com/components/toolchain/2015.06-05/Codescape.GNU.Tools.Package.2015.06-05.for.MIPS.MTI.Linux.CentOS-5.x86_64.tar.gz
tar xf Codescape.GNU.Tools.Package.2015.06-05.for.MIPS.MTI.Linux.CentOS-5.x86_64.tar.gz
```
Add the bin dir to your `PATH` variable:
```
PATH=$HOME/mips-mti-linux-gnu/2015.06-05/bin:$PATH
```
Clone the repository and then initiate the build by running:
```
PREFIX='mips-mti-linux-gnu-' PKGARCH='mips' make -e
```
Alternatively, clone and compile the `crashey` branch:
```
cd vyatta-cjdns
PREFIX='mips-mti-linux-gnu-' PKGARCH='mips' BRANCH=crashey make -e
```
The package `vyatta-cjdns.deb` will be created in the parent directory. Copy it to the EdgeRouter and install it:
```
sudo dpkg -i vyatta-cjdns.deb
```

### Manually Building for VyOS 1.1.7

At present VyOS 1.1.x are based on Debian Squeeze. To match the glibc version it is best to also use Debian Squeeze to target it. Future versions of VyOS (1.2.x) will be based on Debian Jessie.

Generally it is easiest to target the VyOS architecture you are using (`i386`, `amd64`) by using the same architecture in your build environment. However, you may be able to target `i386` from an `amd64` system by specifying some `CFLAGS` and `PKGARCH="i386"` to `make native`, but that process is not documented here.

On Debian Squeeze, start by installing the toolchain and dependencies:
```
echo "deb http://archive.debian.org/debian/ squeeze main non-free" >> /etc/apt/sources.list
apt-get update
apt-get install -y build-essential git
```
Build and install `python2.7`, as the `python2.6` bundled with Squeeze is not adequate:
```
wget https://www.python.org/ftp/python/2.7/Python-2.7.tgz
tar zxf Python-2.7.tgz
cd Python-2.7/
./configure
make
make install
```
Compile the package from the `master` branch by cloning the repository and running 'make native':
```
cd vyatta-cjdns
make native
```
Alternatively, clone and compile the `crashey` branch:
```
cd vyatta-cjdns
make native BRANCH=crashey
```
The package `vyatta-cjdns.deb` will be created in the parent directory. Copy it to the VyOS router and install it:
```
sudo dpkg -i vyatta-cjdns.deb
```
116 changes: 8 additions & 108 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,113 +10,15 @@ At this time this package is in very early stages of development, but the ultima

| | Architecture | Compatible | Notes |
|-----------------------|:------------:|:----------:|:-------------------------------------------------------------:|
| EdgeRouter X (ERX) | mipsel | Yes | Builds with crossbuild-essential, see below |
| EdgeRouter Lite (ERL) | mips64 | Yes | Builds with Codescape SDK as mips32, see below |
| VyOS 1.1.x | i386, amd64 | Yes | Builds with crossbuild-essential on Squeeze only, see below |
| EdgeRouter X (ERX) | mipsel | Yes | |
| EdgeRouter Lite (ERL) | mips64 | Yes | |
| VyOS 1.1.x | i386, amd64 | Yes | No support for IPv6 masquerade |

### Building for Supported Platforms
### Installation

Use the provided shell scripts, which will do most of the hard work for you:
Either download or build a release and copy it to the router, then install it:
```
./build-edgerouter-x
./build-edgerouter-lite
./build-vyos
```

### Manually Building for EdgeRouter X

On 64-bit Debian Jessie, start by installing the toolchain:
```
echo "deb http://emdebian.org/tools/debian/ jessie main" >> /etc/apt/sources.list
wget http://emdebian.org/tools/debian/emdebian-toolchain-archive.key
apt-key add emdebian-toolchain-archive.key
dpkg --add-architecture mipsel
apt-get update
apt-get install -y crossbuild-essential-mipsel
```
Compile the package from the `master` branch by cloning the repository and running 'make':
```
cd vyatta-cjdns
PREFIX='mipsel-linux-gnu-' PKGARCH='mipsel' make -e
```
Alternatively, clone and compile the `crashey` branch:
```
cd vyatta-cjdns
PREFIX='mipsel-linux-gnu-' PKGARCH='mipsel' BRANCH=crashey make -e
```
The package `vyatta-cjdns.deb` will be created in the parent directory. Copy it to the EdgeRouter and install it:
```
sudo dpkg -i vyatta-cjdns.deb
```

### Manually Building for EdgeRouter Lite

On 64-bit Debian Jessie, start by installing the build-essential package:
```
apt-get update
apt-get install -y build-essential
```
So far the only proven working toolchain is the Codescape SDK 2015.01.7 (and 2015.06.05).

Download the toolchain, assuming your homedir:
```
wget http://codescape-mips-sdk.imgtec.com/components/toolchain/2015.06-05/Codescape.GNU.Tools.Package.2015.06-05.for.MIPS.MTI.Linux.CentOS-5.x86_64.tar.gz
tar xf Codescape.GNU.Tools.Package.2015.06-05.for.MIPS.MTI.Linux.CentOS-5.x86_64.tar.gz
```
Add the bin dir to your `PATH` variable:
```
PATH=$HOME/mips-mti-linux-gnu/2015.06-05/bin:$PATH
```
Clone the repository and then initiate the build by running:
```
PREFIX='mips-mti-linux-gnu-' PKGARCH='mips' make -e
```
Alternatively, clone and compile the `crashey` branch:
```
cd vyatta-cjdns
PREFIX='mips-mti-linux-gnu-' PKGARCH='mips' BRANCH=crashey make -e
```
The package `vyatta-cjdns.deb` will be created in the parent directory. Copy it to the EdgeRouter and install it:
```
sudo dpkg -i vyatta-cjdns.deb
```

### Manually Building for VyOS 1.1.7

At present VyOS 1.1.x are based on Debian Squeeze. To match the glibc version it is best to also use Debian Squeeze to target it. Future versions of VyOS (1.2.x) will be based on Debian Jessie.

Generally it is easiest to target the VyOS architecture you are using (`i386`, `amd64`) by using the same architecture in your build environment. However, you may be able to target `i386` from an `amd64` system by specifying some `CFLAGS` and `PKGARCH="i386"` to `make native`, but that process is not documented here.

On Debian Squeeze, start by installing the toolchain and dependencies:
```
echo "deb http://archive.debian.org/debian/ squeeze main non-free" >> /etc/apt/sources.list
apt-get update
apt-get install -y build-essential git
```
Build and install `python2.7`, as the `python2.6` bundled with Squeeze is not adequate:
```
wget https://www.python.org/ftp/python/2.7/Python-2.7.tgz
tar zxf Python-2.7.tgz
cd Python-2.7/
./configure
make
make install
```
Compile the package from the `master` branch by cloning the repository and running 'make native':
```
cd vyatta-cjdns
make native
```
Alternatively, clone and compile the `crashey` branch:
```
cd vyatta-cjdns
make native BRANCH=crashey
```
The package `vyatta-cjdns.deb` will be created in the parent directory. Copy it to the VyOS router and install it:
```
sudo dpkg -i vyatta-cjdns.deb
sudo dpkg -i vyatta-cjdns-x.x.x-xxxxxx.deb
```

### Configuration
Expand Down Expand Up @@ -152,7 +54,7 @@ To configure beacons to automatically peer with other devices on your network us
```
configure
set interfaces cjdns tun0 ethernet-interface 0 bind-interface switch0
set interfaces cjdns tun0 ethernet-interface 0 beacon 2
set interfaces cjdns tun0 ethernet-interface 0 beacon listen-send
commit
```
To configure new authorized passwords for incoming connections:
Expand Down Expand Up @@ -268,8 +170,6 @@ Use the Crash Detection scheduled task above to automatically check and start cj

### Footnotes

There is very little input validation right now on the configuration, so if you enter badly-formed config then `cjdroute` will simply fail to start.

If cjdns fails to start, you can find logging output in `/tmp/cjdroute.tunX.log`, where `tunX` is the specified interface.
If cjdns fails to start, you can find logging output in `/tmp/cjdroute.tunX.log`, where `tunX` is the specified interface.

You may also need to manually adjust your firewall to allow traffic on the `bind-address` that you specified.

0 comments on commit dec3cb9

Please sign in to comment.