Synology usage series 23 – Compile kernel modules for firmware 2.2-0944


Here are my procedures to compile kernel modules for DS207+ , using firmware 2.2.

Operation System for compilation: Ubuntu 11.10 Desktop Version

Sample modules to compile: tun driver

  1. Open a terminal
  2. sudo as root

    # sudo su
    # cd

  3. Download the required ncurses API

    # apt-get install libncurses5 libncurses5-dev

  4. Create a directory

    # mkdir /root/fw0944

  5. Download the 0944 GPL source and the toolchain for processor MV 5281 from sourceforge.net.

    # cd /root/fw0944
    # wget http://nchc.dl.sourceforge.net/project/dsgpl/Synology%20NAS%20GPL%20Source/944branch/synogpl-944b.tbz
    # wget http://nchc.dl.sourceforge.net/project/dsgpl/Tool%20Chain/Marvell%2088F5281%20Linux%202.6.15/gcc343_glibc232_88f5281.tar.gz

  6. Decompress the gpl and toolchain package.

    # tar zvjf synogpl-944b.tbz
    # tar zxpf gc343_glibc232_88f5281.tar.gz -C /usr/local

  7. Edit the Makefile, edit the CC, ARCH and CROSS_COMPILE variable

    # vi source/linux-2.6.15/Makefile
    ARCH = arm
    CROSS_COMPILE = /usr/local/arm-marvell-linux-gnu/bin/arm-marvell-linux-gnu-
    #CC ?= $(CROSS_COMPILE)gcc
    CC = $(CROSS_COMPILE)gcc

    **NOTE: if there is a question mark in front of ‘=’, REMOVE IT!!

  8. Setup and loading the kernel config GUI

    # cd /root/fw0944/source/linux-2.6.15

    # cp 88f5281-config .config

    # make ARCH=arm menuconfig

  9. To compile a module, lookup and highlight the feature and then press ‘M’

    TUN/TAP driver for example:

    device drivers > Network device support > Universal TUN/TAP device driver support
    (press m)

    Synology - Compile TUN/TAP device driver on ubuntu 9 desktop

    Synology - Compile TUN/TAP device driver on ubuntu 9 desktop

  10. Exit the GUI, and start compile the kernel modules.

    # make ARCH=arm modules

  11. The compiled tun driver can be found at /root/fw0944/source/linux-2.6.15/drivers/net/tun.ko




8 thoughts


  1. Hi Ray,

    Your blog is very very interesting for ds207+ users like me !
    Great job !

    Please where could I found your last tun.ko ?

    Thanks per advance.

    Kind regards,

    Ben

  2. Hi,

    Your blog is very very interesting anf useful for me … but
    I have DS410
    Linux xxxxxxx 2.6.24 #1157 Mon Apr 19 21:31:45 CST 2010 ppc unknown
    and I am trying tu run openVPN server in bridge mode
    the only thing I sill miss is bridge.ko module compiled for 2.6.24
    Could please you help me with compiling or describe how to do it?

    many many thx

  3. Hello, thank you for your great tut.

    I tried to compile bridge.ko for my syno ds210 (2.6.32.2 kernel)

    OK, compile was successful, now the problem is, i can’t load it

    ds> insmod bridge.ko
    insmod: error inserting ‘bridge.ko’: -1 Unknown symbol in module
    ds>

    dmesg says

    [875441.360000] bridge: Unknown symbol br_handle_frame_hook
    [875441.370000] bridge: Unknown symbol stp_proto_register
    [875441.390000] bridge: Unknown symbol stp_proto_unregister
    [876480.740000] bridge: Unknown symbol br_handle_frame_hook
    [876480.750000] bridge: Unknown symbol stp_proto_register
    [876480.770000] bridge: Unknown symbol stp_proto_unregister

    any hints?

    Greetings from Switzerland

    • it looks like the linux kernel does not have bridge support, you may need to compile and replace the factory kernel. Replacing factory kernel is a high risk operation and it can brick the NAS if you are not completely understand the operation. Synology forum have some information regarding this

      http://forum.synology.com/enu/viewtopic.php?f=55&t=6809

      I did run custom kernel on some PC linux box, but I don’t have plan doing this on any of my NAS box, so I’m not going to write any article here regarding this.

      good luck

Leave a Reply

Your email address will not be published. Required fields are marked *