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.
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
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!
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