0

I am trying to build Ubuntu kernel, following the instructions on ubuntu BuildYourOwnKernel.

I am interested to use git so I can easily branch and backtrack my errors. I got a version using git like so:

git clone git://kernel.ubuntu.com/ubuntu/ubuntu-xenial.git

This creates the directory ubuntu-xenial/ But unfortunately the build failed.

Running head ubuntu-xenial/Makefile

Gives:

VERSION = 4
PATCHLEVEL = 4
SUBLEVEL = 30
EXTRAVERSION =
NAME = Blurry Fish Butt

On the other hand, getting a versions using apt-get:

apt-get source linux-image-$(uname -r)

Creates linux-4.4.0/ And surprisingly, the versions differ.

Running head linux-4.4.0/Makefile

Gives:

VERSION = 4
PATCHLEVEL = 4
SUBLEVEL = 35
EXTRAVERSION =
NAME = Blurry Fish Butt

4.4.35 is not in the git.

My question is: where do I find the updated git repository of the current version?

Or at least a version that will not fail make.

  • You build a kernel incorrectly. I am writing an answer with explanations. – Pilot6 Dec 24 '16 at 18:17
-1

Your best source for kernel sources is https://www.kernel.org/
These are unmodified by Canonical.

Canonical applies various patches to the kernels they distribute for Ubuntu when they compile it. These patches can be seen in their public kernel repos by kernel release:
http://kernel.ubuntu.com/~kernel-ppa/mainline/
and examining the *.patch files under respective directories.

Whether these patches add a benefit or not is up for debate.

The following repo with help with installing newer kernels, or alternatively compiling same: https://github.com/mtompkins/linux-kernel-utilities

I recognize you are asking specific to a git repo but I believe the above provides a reasonable answer. Instead of a git pull you would download the compressed files, extract, and continue.

This would ensure you are compiling from a snapshot at a time where compilation is expected to succeed. In my view, compiling with a git source is for kernel developers as there will be expected intermediate issues between point releases.

  • 1
    Why do you thing the mainline kernels form kernel.org are "the best" for Ubuntu? – Pilot6 Dec 24 '16 at 18:22
  • @Pilot6 - because they haven't been modified by Canoncial patches as explained above. That isn't to say direct from Canonical is a bad choice. I'm just not a fan of unknown alterations to the kernel without knowing what and why. – Mark Dec 24 '16 at 18:24
  • The alterations are well known. And your mtomkins repo is really unknown. – Pilot6 Dec 24 '16 at 18:24
  • "Alterations are well known" - terribly specious comment with no value. My repo isn't a source - they are simply scripts to help the process. – Mark Dec 24 '16 at 18:25
  • You can see all commits in the Canonical repos. – Pilot6 Dec 24 '16 at 18:26
-1

You download wources from a correct place, but you build the kernel an incorrect way.

In order to get Ubuntu versioning you need to build the kernel a Debian way by

fakeroot debian/rules binary-headers binary-generic

The debian directory contains the correct .config file and the version will match the Ubuntu versions. I build kernels successfully from the ubuntu-xenial repo.

If you build using make, you get the mainline version and in most cases a wrong config.

It is hard to tell why you fail to make the kernel without any information. I build kernels without any problems from ubuntu-xenial.

apt-get gets the same sources.

  • Hello, Its possible I have done something wrong. Did you try getting the sources both ways and actually got the same version? – user1656671 Dec 24 '16 at 19:46
  • I do not have to try both ways. I can see what is there. I do some kernel development. – Pilot6 Dec 24 '16 at 20:09

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.