Configuration and compiling the kernel.

Seth Forshee seth.forshee at canonical.com
Tue Mar 24 12:59:30 UTC 2020


On Sun, Mar 22, 2020 at 03:53:39PM +0100, Carlo Wood wrote:
> Hello everyone.
> 
> I've spent the last three days trying to figure this out on my own,
> but https://wiki.ubuntu.com/Kernel/ is not sufficient.
> 
> I subscribed here in the hope to get some pointers on how to
> compile my own kernel. The reason I need to do this is to find
> a (the) bug in the xhci_hcd module that leads to
> 
> [150644.678555] xhci_hcd 0000:08:00.0: xHCI host not responding to stop endpoint command.
> [150644.679748] xhci_hcd 0000:08:00.0: xHCI host controller not responding, assume dead
> [150644.679756] xhci_hcd 0000:08:00.0: HC died; cleaning up
> 
> This bug has existed for a very long time and many people
> are suffering from it.
> 
> Hopefully someone here can help me with the following questions:
> 
> 1) Which repository should I be using for kernel 5.5.11 (lastest stable)?
>  
> It turned out to be impossible to find a git repository by 'ubuntu'
> featuring the latest kernel. It seems ubuntu stopped at 5.3/4. I tried
> a LOT of ubuntu git repositories, but none had tags beyond v5.4.
> The only thing related to ubuntu that I could find (when looking for
> 5.5.9 still) was: https://green666.xyz/v5.5.9/
> Which says to use
> git://git.launchpad.net/~ubuntu-kernel-test/ubuntu/+source/linux/+git/mainline-crack
> tag v5.5.9. But it does not HAVE that tag?!
> Moreover, after a while I found out that the listed git sha1 is simply
> that of the mainline kernel.
> 
> So, what I eventually did is:
> 
> $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
> $ git checkout -b xhci_test v5.5.9
> $ git am ../linux-stable-patches/????-*
> 
> where ../linux-stable-patches contains the five patches
> listed on https://green666.xyz/v5.5.9/.
> 
> Note that also git://kernel.ubuntu.com/virgin/linux.git does not contain
> a tag over v5.4 (or maybe it contained v5.3, v5.4 and v5.5 - but not
> v5.5.x). See also https://people.canonical.com/~kernel/info/kernel-version-map.html

If you're looking for the vanilla upstream stable versions, the
linux-stable tree is the best tree to use. We don't have any supported
kernels using versions beyond 5.4, but we do have a tree with Ubuntu
patches and packaging for 5.5 and 5.6:

https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/unstable

You won't find anything based on the releases from linux-stable there
though, e.g. v5.5.x, only v5.5.

> 2) How to (re)configure the kernel?
> 
> debian.master/config/amd64 contains config.common.amd64,
> config.flavour.generic and config.flavour.lowlatency.
> 
> What command should I run normally to change these?

The configs aren't that easy to navigate. They get split up so that
options common to all the kernels end up in
debian.master/config/config.common.ubuntu. Then you have a directory for
each architecture (e.g. debian.master/config/amd64) with a file for
options common to the architecture (e.g. .../config.common.amd64) and
then files for each flavour (e.g. .../config.flavour.lowlatency). The
actual config would be the concatenation of config.common.ubuntu, the
comman arch file, and the per-arch flavour file.

If you just want to do a local build without packaging, the easiest
thing to do would be something like this:

  $ cat debian.master/config/config.common.ubuntu \
        debian.master/config/amd64/config.common.amd64 \
        debian.master/config/amd64/config.flavour.lowlatency > .config
  $ make menuconfig

If you're wanting to build the .deb packages, I'd suggest that you fist
edit debian.master/etc/kernelconfig and change the "archs" list to
contain only "amd64" (this will avoid the need to install cross
toolchains to generate configs for other architectures). Then you can
generate your config as above, then run:

  $ cat .config >> debian.master/config/amd64/config.flavour.lowlatency
  $ fakeroot debian/rules clean updateconfigs

Or if you know specifically what options you want to change, you can
find them in the Ubuntu configs and manually change them, or append the
values you want to config.flavour.lowlatency and run updateconfigs.

> 3) How can I compile a single flavour?
> 
> To save time it would be nice if I could just compile
> what I need: amd64, flavour lowlatency, but with a few
> custom config changes. Should I create my own flavour file?

No, that's overkill. Just edit the configs for lowlatency like I
explained above, then you can build the binary-lowlatency target
(fakeroot debian/rules binary-lowlatency), or you can edit
debian.master/rules.d/amd64.mk and change "flavours" to only have
lowlatency and build the binary target.

Seth

> What is the command to compile that kernel and create
> all the necessary .deb files for it? From what I understand(?)
> it would be:
> 
> $ fakeroot debian/rules clean
> $ DEB_BUILD_OPTIONS=parallel=8 AUTOBUILD=1 NOEXTRAS=1 fakeroot debian/rules custom-binary-myflavour
> 
> after copying debian.master/config/amd64/config.flavour.lowlatency
> to debian/binary-custom.d and making my custom changes (according
> to https://help.ubuntu.com/community/Kernel/Compile).
> 
> But debian/binary-custom.d doesn't exist?! Neither does debian.master/*custom*
> 
> 
> Any help is much appreciated!
> Carlo Wood
> 
> -- 
> 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