Acquiring kernel source

What’s the correct way to acquire the current machine’s kernel source? I need to build a DLKM that relies on patching the native drivers.

Another thread suggested the linux-dev bundle, however this does not include the actual source.

I cannot speak for the correct way and not sure what that might be. The Linux source RPMs can be found at https://cdn.download.clearlinux.org/releases/ under <RELVER>/clear/source/SRPMS/.

linux-5.18.*.src.rpm
linux-lts2020-5.10.*.src.rpm
linux-aws-5.15.*.src.rpm
etc.
2 Likes