You don't need to rebuild the entire kernel but just a single module (uvcvideo), here is an example on debian stretch :
- Get source and headers for your current kernel :
apt-get install linux-source-4.9 linux-headers-amd64
- Untar and configure :
cp -v /usr/src/linux-headers-$(uname -r)/Module.symvers .
- Apply patch : https://lkml.org/lkml/2018/5/8/1117
- Build the kernel module an install it :
make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
make -C /lib/modules/$(uname -r)/build M=$(pwd) modules_install
- Load new module
modprobe -f uvcvideo
- Extra Step
delete /lib/modules/4.9.0-6-amd64/extra/uvcvideo.ko if you want to go back to original kernel module
If you are using Ubuntu 16.04 or 17.10 and want to help verifying the fix for the webcam so that it is included in the next round of updates, please follow the instructions in the following message:
I already verified the patch for Ubuntu 18.04, so if you are using this version you should get an update for the kernel that includes the patch in the coming days.
The update is already in the Ubuntu "proposed" repository, and has been verified for 18.04 and 17.10. But it still has not been "released" so it is not yet in the normal updates. It is expected to be soon. For 16.04 it looks like an additional commit is needed, but it is also expected to be out soon. This is the relevant bug report:
So, I followed these instructions exactly. When I rebooted my laptop, the webcam worked!
However, at the next update, apt wants to replace these kernels with a newer version, which again breaks the camera. So, are there only two options: latest kernel and no webcam, or pin this older kernel and have a webcam?
I just acquired a Dell XPS 13 and I'm having some trouble with the webcam as well. The USB device is actually listed by the USB bus, but it is not detected by the uvcvideo device driver (which I think is the right one for this device). I'm using the ubuntu 16.04 preinstalled by Dell. I can see you have a solution for this, so can you please share with me the link?
This has now made it to the Ubuntu Kernels as of yesterday (11th June) so the Webcam support should be fixed with just an apt dist-upgrade in:
Maybe the Solution of this post should be updated to reflect this.