Compiling Linux Kernel modules for Synology devices
Davy 16 Jan 2012Synology NAS are very versatile. They are running a stripped version of Linux with less kernel modules, but we can overcome this by compiling and adding modules (for instance the usbserial module used by usb serial converters).
Requirements:
- a computer (or a virtual machine) running Linux (Debian, Fedora, Ubuntu, etc)
- the tool chains specific to your Synology
- the Synology NAS GPL source specific to your Synology
How to proceed:
- Unzip the tool chains in /usr/local
- Unzip the Synology NAS GPL source inside your tool chains
- Before continuing, let’s find out which Linux kernel we are running on the Synology in order to compile for the right version:
- Open the Synology NAS GPL source folder corresponding to your Synology Linux kernel
- Copy the config file created by Synology to configure the kernel
- Edit the Makefile to compile for the right architecture and use the right tool chains
- Check the config file we just copied
- Edit the config file through the user interface to add modules
- Compile all modules
- Find your modules in the corresponding subfolder (in my case drivers/usb/serial/usbserial.ko)