I have installed ubuntu 20.04 on a qemu arm64 virtual machine. This is based on qemu's arm64 'virt' machine and I added a peripheral in the virtual machine. Now to test device driver, I need to build kernel module and I have to do it on my x86_64 ubuntu 20.04 machine.
Inside the VM, the uname -r command gives me 5.4.0-77-generic. I learned that I need the kernel source for this version(or is only the kernel header enough? this says I need kernel source.) . I have had trouble downloading a specific kernel version in the past and now I'm not sure how I should get this version.
From https://launchpad.net/ubuntu/focal/+source/linux-signed I can see some 5.4.0-77.86 versions under security and main but I'm not sure how these versions are different from 5.4.0-77-generic. Please anyone tell me how I can get this 5.4.0-77-generic kernel version source. Step by step instruction will be appreciated but any comment is welcome. Thanks! (The kernel.org site shows only some selected or recent versions.)
ADD :
After apt-cache search 5.4.0 I tried sudo apt install linux-cloud-tools-5.4.0-77-generic and it installs
/. /usr /usr/lib /usr/lib/linux-tools /usr/lib/linux-tools/5.4.0-77-generic /usr/share /usr/share/doc /usr/share/doc/linux-cloud-tools-5.4.0-77-generic /usr/share/doc/linux-cloud-tools-5.4.0-77-generic/copyright /usr/lib/linux-tools/5.4.0-77-generic/hv_fcopy_daemon /usr/lib/linux-tools/5.4.0-77-generic/hv_kvp_daemon /usr/lib/linux-tools/5.4.0-77-generic/hv_vss_daemon /usr/lib/linux-tools/5.4.0-77-generic/lsvmbus /usr/share/doc/linux-cloud-tools-5.4.0-77-generic/changelog.Debian.gz I don't think this contains the kernel source.