How to Compile Modules for AsusWRT Routers

This is mostly for advanced users who want to compile various modules.

In this case I will show you how to compile UVC modules because on almost every kernel changes they must be recompiled.

I will use this guide as reference to build a RT-AC56U firmware

My Ubuntu username is thx and all paths in this tutorial should be replaced with your Ubuntu username, if you followed this guide exactly your username should be router (ex. /home/thx/asuswrt-merlin become /home/router/asuswrt-merlin)

To start, you have to build a firmware successfully and get a message like this:


Go to kernel directory and input "make menuconfig"

cd /home/thx/asuswrt-merlin/release/src-rt-6.x.4708/linux/linux-2.6.36
make menuconfig

Ncurses interface should show up, choose Device Drivers and press Enter


Select Multimedia support, press M then Enter


Select Video For Linux and press M


Go down and select Video capture adapters, press Y then press Enter


Select V4L USB devices, press Y then Enter


Select USB Video Class (UVC) and press M



Press ESC until you are asked: Do you wish to save your new kernel configuration?, Select Yes then press Enter


Go to build folder and type "make kernel"

cd /home/thx/asuswrt-merlin/release/src-rt-6.x.4708
make kernel

It's time to extract video modules and make an archive

cd /home/thx/Desktop
make -C /home/thx/asuswrt-merlin/release/src-rt-6.x.4708/linux/linux-2.6.36 modules_install INSTALL_MOD_PATH=/home/thx/Desktop/opt
sudo chmod 777 -R /home/thx/Desktop/opt
tar -cvzf ./uvc_modules.tgz \
./opt/lib/modules/ \
./opt/lib/modules/ \
./opt/lib/modules/ \
./opt/lib/modules/ \
chmod 777 ./uvc_modules.tgz

Now you have an archive with fresh modules on your Ubuntu Desktop  :)