Where I can get source code of v5.0.0-23 or the latest release of v5.0.0
Matthew Ruffell
matthew.ruffell at canonical.com
Tue Feb 4 21:57:47 UTC 2020
Hi Yinbo,
It is easiest to get the source code for various kernel versions from the
git repository.
If you clone the following repo:
$ git clone git://kernel.ubuntu.com/ubuntu/ubuntu-bionic.git
You can then examine all the different kernel versions with git tag:
$ git tag
...
Ubuntu-4.15.0-76.86
Ubuntu-4.15.0-87.87
...
Ubuntu-hwe-4.18.0-23.24_18.04.1
Ubuntu-hwe-4.18.0-25.26_18.04.1
...
Ubuntu-hwe-5.0.0-22.23_18.04.1
Ubuntu-hwe-5.0.0-24.25_18.04.1
...
Ubuntu-hwe-5.0.0-28.30_18.04.1
...
Ubuntu-hwe-5.3.0-28.30_18.04.1
Ubuntu-hwe-5.3.0-40.32_18.04.1
You can then checkout the version you want. For some reason 5.0.0-23-generic
is not tagged in the bionic git repo, so you can use the latest 5.0 kernel
for bionic HWE, which is Ubuntu-hwe-5.0.0-28.30_18.04.1
$ git checkout Ubuntu-hwe-5.0.0-28.30_18.04.1
Please note, that the bionic HWE kernel has now moved to version 5.3, as part
of the kernel support lifecycle, which you can read about here:
https://ubuntu.com/about/release-cycle
(under the "Ubuntu kernel release cycle" section).
This means there will be no more 5.0 releases for bionic. Disco is also EOL now
and will not likely get any further kernel updates.
>From there, you can make some changes and build the kernel with:
$ fakeroot debian/rules clean
$ fakeroot debian/rules prepare-generic
$ fakeroot debian/rules binary-headers binary-generic
You can also skip the debug kernel build if you want to speed things up:
Instead, use:
$ fakeroot debian/rules binary-headers binary-generic skipabi=true
skipmodule=true skipdbg=true
Now, the version in the uname string is not what is presented in the top-level
Makefile. Instead, it is taken from the version string in debian/changelog,
which for the HWE kernel, is in debian.hwe/changelog. Looking at that
file shows:
linux-hwe (5.0.0-28.30~18.04.1) bionic; urgency=medium
Which is the version number used in the build. You can change it to suit your
custom build, by changing the old entry to:
linux-hwe (5.0.0-28.30~18.04.1+mycustombuild) bionic; urgency=medium
and saving the file.
You probably don't want to build using the "usual" ways of "make menuconfig"
"make" and "make install", since these kernel trees very much revolve around
the debian/rules buildscripts.
I hope that answers some of your questions.
Thanks,
Matthew
On Wed, Feb 5, 2020 at 10:31 AM <Yinbo.Wang at microchip.com> wrote:
>
> Hi,
>
> I am currently running Ubuntu 18.04.3, with kernel version v5.0.0-23 shipped with the package. I need the relevant kernel source code for my development.
>
> I found and downloaded the diff for 5.0.0-23 from https://launchpad.net/ubuntu/+source/linux-hwe/5.0.0-23.24~18.04.1 but its SUBLEVEL (which is 15) in Makefile indicates it will be built as v5.0.15 not v5.0.0-23. I am very confused here, could you explain?
>
> If I use “apt source” command as below, I always get 5.3.0 package, which is not what I want, how can I fix it?
>
>
>
> $ apt-get source linux-image-5.0.0-23-generic
>
> Reading package lists... Done
>
> Picking 'linux-signed-hwe' as source package instead of 'linux-image-5.0.0-23-generic'
>
> Need to get 13.7 kB of source archives.
>
> Get:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/main linux-signed-hwe 5.3.0-26.28~18.04.1 (dsc) [1,862 B]
>
> Get:2 http://us.archive.ubuntu.com/ubuntu bionic-updates/main linux-signed-hwe 5.3.0-26.28~18.04.1 (tar) [11.8 kB]
>
> Fetched 13.7 kB in 0s (42.7 kB/s)
>
> dpkg-source: info: extracting linux-signed-hwe in linux-signed-hwe-5.3.0
>
> dpkg-source: info: unpacking linux-signed-hwe_5.3.0-26.28~18.04.1.tar.xz
>
>
>
> As the result, how can I get source code of v5.0.0-23 or the latest kernel source code release for v5.0.0 for Ubuntu?
>
> Thank you so much in advance for your help!
>
>
>
> Thanks,
>
> -Yinbo
>
>
>
> --
> kernel-team mailing list
> kernel-team at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
More information about the kernel-team
mailing list