Compile Kernel Modules

As mentioned before, you have to create the SynoBuildConf/build, SynoBuildConf/install, and SynoBuildConf/depends before using Package Toolkit.

In this chapter, we will use platform 6281 as our example.


First, you will need to download the GPL source code of your platform. You can download the source code from this link.

After downloading the Synology GPL kernel source code, move the file to your toolkit folder.


There is nothing special about the depends file. The following is the depends file for the 6281 platform.



Before compiling the kernel modules, you will need to set up the config file first.

In the kernel source code, there are configuration files for different platforms. The configuration files are listed below:

CPU Configuration File Arch Linux
Marvell 6281
Marvell 6282
synoconfigs/88f6281 ARM 2.6.32
Marvell Armada 370 synoconfigs/armada370 ARM 3.2.40
Marvell Armada 375 synoconfigs/armada375 ARM 3.2.40
Marvell Armada XP synoconfigs/armadaxp ARM 3.2.40
Annapurnalabs, Alpine AL212/AL314/AL514 synoconfigs/alpine (DS715, DS1515, DS2015xs)
synoconfigs/alpine4k (DS215+, DS416)
ARM 3.2.40
Mindspeed, Comcerto, C2000 synoconfigs/comcerto2k ARM 3.2.40
Freescale QorIQ (P1022) synoconfigs/ppcQorIQ PowerPC 2.6.32
Intel Atom D525, D510, D410, D425 synoconfigs/x86_64 x86 3.2.40
Intel Atom D2700 synoconfigs/cedarview x86 3.2.40
Intel SoC CE5335 synoconfigs/evansport x86 3.2.40
Intel Core i3 synoconfigs/bromolow x86 3.2.40

Please copy the proper configuration file to .config, and run make oldconfig and make menuconfig to select your kernel modules. According to the platforms you would like to compile, you will have to set the proper ARCH and CROSS_COMPILE into environment variables.

The following is a sample script that will compile the linux kernel modules for the 6281 platform.

# Copyright (c) 2000-2015 Synology Inc. All rights reserved.
# SynoBuildConf/build

case ${MakeClean} in
        [ -f Makefile ] && make distclean

case ${CleanOnly} in

# prepare config files
cp -f synoconfigs/88f6281 .config
make ARCH=${ARCH} CC=${CC} oldconfig

# start compile kernel modules
echo "=====Build Synology Linux kernel 2.6 Modules ====="
make ARCH=${ARCH} CC=${CC} LD="${LD}" ${MAKE_FLAGS} modules

# create table
./scripts/ create-table


Unlike the previous example, this example will not pack the whole kernel module into one single spk file. Instead, it will install the kernel modules in /images/modules under the chroot environment. As a result, the installation script below is slightly different from the previous example.

# Copyright (c) 2000-2015 Synology Inc. All rights reserved.
# SynoBuildConf/install


PrepareDirs() {
    [ -d "${MODULES_DIR}" ] || mkdir -p ${MODULES_DIR}
    rm -f ${ImageDir}/modules/*

InstallModules() {
    make ARCH=${ARCH} CC=${CC} LD="${LD}" INSTALL_MOD_PATH=$MODULES_DIR modules_install 

main() {

main "$@"

Compile Kernel Modules:

Lastly, run the following commands to compile and install the kernel modules to the destination folder.

/toolkit/pkgscripts/ -p 6281 -c linux-2.6.32

After the build process, you can check the result in /toolkit/ds.6281-6.0/image/modules.

Verify the Result:

You can copy the kernel module you need for your DSM system and run the following command to install the module.

insmod ${module_name}

Use the following command to verify that your module has been installed properly.

lsmod | grep ${module_name}