KVER=$(uname -r)
sudo apt-get install linux-headers-${KVER} linux-source-${KVER}
cd /usr/src/linux-source-${KVER}
sudo tar -xf linux-source-${KVER}.tar.bz2
cd linux-source-${KVER}
sudo cp /boot/config-${KVER} .config
sudo make modules_prepare
cd /path/to/your/module/source
make -C /lib/modules/${KVER}/build M=$(pwd) modules
If this fails due to provider customizations, your fastest recovery is indeed a snapshot rollback, then immediately setting the kernel to 'manual' updates in your package manager to prevent recurrence.
This is a public discussion. Create a free account to answer. Takes 20 seconds. No email gates.