Skip to content

Instantly share code, notes, and snippets.

@MaLaCoiD
Created February 2, 2012 06:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaLaCoiD/1721818 to your computer and use it in GitHub Desktop.
Save MaLaCoiD/1721818 to your computer and use it in GitHub Desktop.
Compiling a new kernel and CJDNS on TonidoPlug2

CJDNS on TonidoPlug2

This is a guide on how to get CJDNS working on your energy-saving TonidoPlug2

Build the new kernel

This is a step by step procedure to build the kernel that comes with your TonidoPlug2. All responsibility is yours. The software built here is to replace the kernel and modules on an existing operational sata or usb disk. Don't do this on the internal flash!

The cross compiler used in this procedure is only functional on a Linux desktop. This was done with a Debian OS. It is my current choice. Linux is linux, the procedure should be the same except for installing dependencies.

Steps

  1. Open a command line terminal.

  2. Download a cross compiler.

    wget http://www.plugcomputer.org/405/us/gplugd/tool-chain/arm-marvell-linux-gnueabi.tar.bz2

  3. Install the cross compiler in the /opt directory.

    sudo tar xvjpf arm-marvell-linux-gnueabi.tar.bz2 -C /opt/

  4. Install dependencies.

    sudo apt-get install build-essential automake autoconf libtool pkg-config intltool libncurses5-dev uboot-mkimage

  5. Make a working directory and go to it. Mine is called tonido.

    mkdir tonido cd tonido

  6. Download TonidoPlug2 kernel source code.

    wget http://www.tonidoplug.com/partners/topkick/2011/kernel/source/kernel-2.6.31-topkick1281p2-codelathe-20111122.tar.bz2

  7. Install kernel source.

    tar xvjpf kernel-2.6.31-topkick1281p2-codelathe-20111122.tar.bz2

  8. Simplify the package name and move to it.

    mv kernel-2.6.31-topkick1281p2-codelathe-20111122 kernel-2.6.31 cd kernel-2.6.31

  9. Set the environment for the build. The declarations are only valid for the life of the command shell. If you exit the shell and open a new shell to continue, you will need to set the environment again.

    export PATH=/opt/arm-marvell-linux-gnueabi/bin:$PATH export CROSS_COMPILE="arm-marvell-linux-gnueabi-" export ARCH=arm

  10. Clean up build for start fresh.

    make mrproper

  11. Create a default configuration file for the build. This is the shipped kernel, mostly. There seemed to be a few minor modifications but it's pretty much stock.

    make mv88f6281_gw_defconfig

  12. Now we are going to change the kernel or modules. This is where the stock configuration is modified. The README file in this directory tells you about different program that will make the changes. I suggest just building a stock kernel for now using the default configuration. To build a stock kernel, skip this step 12.

Enter the menu to configure different kernel features:

make menuconfig

Arrow keys navigate the menu. The kernel should already has the TUN kernel module. Verify:

Device Drivers  --->
	Network device support  --->
		Universal TUN/TAP device driver support

There should be <M> in front of Universal TUN/TAP device driver support. Exit back to main menu. It has General setup ---> at the top. Now we need to enable IPv6:

Networking support  --->
	Networking options  ---> 
		The IPv6 protocol  --->

There's probably just '< >' before 'The IPv6 protocol', so type m to enable this kernel feature. Exit back to the main menu and do one more Exit to get the prompt Do you wish to save your new kernel configuration? Hit Enter

  1. Build the kernel.

    make uImage

  2. Build the modules.

    make modules

  3. Make a directories to store the new software.

    mkdir ../current_kernel mkdir ../current_kernel/boot

  4. Store the modules.

    make INSTALL_MOD_PATH=../current_kernel modules_install

  5. Move the kernel into the new directory and change is access. cp arch/arm/boot/uImage ../current_kernel/boot/ chmod 744 ../current_kernel/boot/uImage The new kernel is at ../current_kernel/boot/uImage The new modules are at ../current_kernel/lib/modules

  6. Back up your current kernel and modules on the TonidoPlug2 by logging in as root. tp2 is the IP of your TonidoPlug2.

    ssh tp2 -l root cd /boot mv uImage uImage_stock cd /lib mv modules modules_stock exit

  7. Back on the Linux box used to cross-compile the kernel, at ~/tonido/kernel-2.6.31

    scp ../current_kernel/boot/uImage root@tp2:/boot/ scp ../current_kernel/lib/modules/ root@tp2:/lib/

  8. Check that the files copied over.

    ssh tp2 -l root ls -l /boot ls /lib/modules*

  9. Reboot your TonidoPlug2 and pray you got a gold star in Kindergarten for following directions.

    reboot

When your TonidoPlug2 comes back up, follow the standard directions for compiling CJDNS: https://github.com/cjdelisle/cjdns

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