[BeagleBoard][Debian] How to download kernel source packages.

Now that my BeagleBoard is working and accessing the Internet, I want to download the sources for the various kernels:

root@arm:/var/lib/dpkg# apt-get source linux-image-5.7.19-armv7-x28
. Reading package lists... Done
Picking 'linux-upstream' as source package instead of 'linux-image-5.7.19-armv7-x28
E: Unable to find a source package for linux-upstream

I think Robert’s scripts https://github.com/RobertCNelson/linux-dev do something similar, but was looking for a method that would allow the usage of apt-get instead of another set of external scripts.


The Generic Script is:

git clone https://github.com/RobertCNelson/linux-stable-rcn-ee
cd ./linux-stable-rcn-ee
git checkout `uname -r` -b tmp

So for linux-image-5.7.19-armv7-x28

git clone https://github.com/RobertCNelson/linux-stable-rcn-ee
cd ./linux-stable-rcn-ee
git checkout 5.7.19-armv7-x28 -b tmp

or Even:

git clone -b 5.7.19-armv7-x28 https://github.com/RobertCNelson/linux-stable-rcn-ee --depth=100

To cut down on bandwidth…

So above would download 191 MiB:

Cloning into 'linux-stable-rcn-ee'...
remote: Enumerating objects: 73061, done.
remote: Counting objects: 100% (73061/73061), done.
remote: Compressing objects: 100% (68243/68243), done.
remote: Total 73061 (delta 6999), reused 13908 (delta 4083), pack-reused 0
Receiving objects: 100% (73061/73061), 191.07 MiB | 6.49 MiB/s, done.
Resolving deltas: 100% (6999/6999), done.
Note: switching to '4297340c0106d34ff017ad9f8984065d7bc19b47'.