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 https://github.com/RMerl/asuswrt-merlin/wiki/Compile-Firmware-from-source-using-Ubuntu 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"
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"
make kernel
It's time to extract video modules and make an archive
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/2.6.36.4brcmarm/modules.alias \
./opt/lib/modules/2.6.36.4brcmarm/modules.dep \
./opt/lib/modules/2.6.36.4brcmarm/kernel/drivers/input/input-core.ko \
./opt/lib/modules/2.6.36.4brcmarm/kernel/drivers/usb/core/usbcore.ko \
./opt/lib/modules/2.6.36.4brcmarm/kernel/drivers/media/video/
chmod 777 ./uvc_modules.tgz
Now you have an archive with fresh modules on your Ubuntu Desktop :)
Enjoy...