Skip to content

Instantly share code, notes, and snippets.

@rc0r
Created May 27, 2014 20:53
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rc0r/47a45e4c541e02c7e539 to your computer and use it in GitHub Desktop.
Save rc0r/47a45e4c541e02c7e539 to your computer and use it in GitHub Desktop.
rc0r's Parallella Setup Guide - Walkthrough: Headless Setup with OpenVPN support

rc0r's Parallellaboard Setup Guide

Walkthrough: Headless Setup with OpenVPN support

Headless Configuration

First get the boot partition files for the headless configuration from the parallella-bin GitHub repo:

$ git clone https://github.com/parallella/parallella-bin
$ cd parallella-bin

Install them into the boot partition of your SD card:

# Mount boot partition
$ sudo mount /dev/mmcblk0p1 /mnt

# If you get an error, try these commands, then mount again)
# sudo mknod -m 660 /dev/mmcblk0 b 179 0
# sudo mknod -m 660 /dev/mmcblk0p1 b 179 1
# sudo mknod -m 660 /dev/mmcblk0p2 b 179 2

# Make backup copies of original files
$ sudo cp /mnt/uImage /mnt/uImage.bak
$ sudo cp /mnt/parallella.bit.bin /mnt/parallella.bit.bin.bak
$ sudo cp /mnt/devicetree.dtb /mnt/devicetree.dtb.bak

# Copy headless files
$ sudo cp uImage /mnt/uImage
$ sudo cp parallella.bit.bin /mnt/parallella.bit.bin
$ sudo cp devicetree.dtb /mnt/devicetree.dtb

$ sudo sync

Then unmount and reboot the system.

$ sudo umount /mnt
$ sudo reboot

Congratulations you're now running the headless configuration without HDMI and stuff. The next step is to add TUN device support to the linux kernel. If your kernel comes with TUN device support you might skip the next steps (the default Linaro Ubuntu kernel has no TUN/TAP device support enabled). In order to modify the kernel configuration you need to get the linux kernel sources, make the necessary changes to the configuration, (re-) compile the kernel image and install it.

Kernel Configuration for TUN/TAP device support

Large parts of this section are taken from the guide by @shodruky at forums.parallella.org that gives nice step by step instructions on how to compile a linux kernel for your parallella board.

Ok, first you need to get some tools and software and of course the kernel sources from the parallella-linux-adi Github repo.

# Install build tools
$ sudo apt-get install build-essential git libncurses5-dev u-boot-tools bc

# Get kernel sources
$ git clone https://github.com/parallella/parallella-linux-adi
$ cd parallella-linux-adi

Next make sure you're on the xcomm_zynq branch (check git branch). Now it's time to prepare the kernel configuration:

$ make mrproper
$ make parallella_defconfig

With your editor of choice edit the generated .config file. And replace

# CONFIG_TUN is not set

with

CONFIG_TUN=y

If you prefer the menu based configuration you might want to use make menuconfig to edit the configuration file. Next open up Makefile in your favorite editor and change the following options to:

EXTRAVERSION = -parallella

CFLAGS_KERNEL = -fno-stack-protector

Make sure you save the changes for all the edited files.

Note: For some reason TUN/TAP device support needs to be compiled into the kernel since loading the according kernel module didn't work.

Start the compilation process:

$ make -j 2 LOADADDR=0x8000 uImage

The freshly compiled kernel image may now be installed by copying arch/arm/boot/uImage to the boot partition of the sd card (see detailed instructions in section Headless Configuration):

# mount boot partition, make backup, ...
$ sudo cp arch/arm/boot/uImage /mnt/uImage
# sync, unmount, reboot

Device Setup and OpenVPN Installation

After a reboot the tun device needs to be created:

$ sudo mkdir /dev/net
$ sudo mknod /dev/net/tun c 10 200

Finally install the openvpn software package:

$ sudo apt-get install openvpn

Now adapt your OpenVPN config files to use the newly created TUN device and you're good to go to use OpenVPN on your parallella board!

Happy networking!

@gstkenpo
Copy link

Thanks for your article. I am trying to make openvpn work on my parallella (headless). I can't boot up my board after I finished 'Kernel Configuration for TUN/TAP device support' section. May I ask why?

Thank you

@rc0r
Copy link
Author

rc0r commented Dec 31, 2014

Sorry to hear that @gstkenpo. Unfortunately I have no idea what might have gone wrong during the kernel configuration, build and installation process w/o looking further into it. Maybe there's some issue with some version of the parallela-bin sources? Did you check their repo for known issues?
On which board model did you try this out?
Is your board not booting at all or is the ethernet interface just not starting? I have got some problems with my ethernet. Sometimes it takes 5-6 reboots until I can ssh into my parallella. But IIRC this is a known issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment