diff mbox series

[ANNOUNCE] annotations v4 and how to deal with kernel .config

Message ID ZIL4mIJng57g33zT@righiandr-XPS-13-7390
State New
Headers show
Series [ANNOUNCE] annotations v4 and how to deal with kernel .config | expand

Commit Message

Andrea Righi June 9, 2023, 10:02 a.m. UTC
As many of you may have noticed already, some of our kernels already
migrated to the new annotations model (v4), removing any .config chunk
from their git repository.

What is annotations?
====================

Annotations is a JSON-like file (one for each kernel) that is used to
store all the kernel config options (with optional notes) for all the
kernel's supported architectures and flavours.

Starting with 22.04 (Jammy Jellyfish), Ubuntu kernels are now using
only annotations to generate their corresponding .config.

Why don't we simply use .config?
================================

Ubuntu provides a wide variety of kernels for many different
architectures and flavours, such as generic, lowlatency, cloud kernels,
kvm, etc.

Maintaining a separate .config for each of these kernels would be
extremely challenging.

Moreover, we need to make sure that certain .config options do not
change across kernel updates and rebases, in order to have a kernel
functional for the scope that it was designed for.

The main goal of annotations is to make the maintenance of multiple
kernel .config easier and more reliable.

How do I change a particular .config then?
==========================================

You have two options:

1) change all the kernel configs that you want, produce a standard
   .config and import it in annotations, specifying the appropriate
   architecture and flavour, for example:

   $ ./debian/scripts/misc/annotations --arch amd64 --flavour generic \
     --import .config

2) modify `debian.<kernel_name>/config/annotations` directly or using
   the annotations script, for example, enable X86_KERNEL_IBT on amd64,
   flavour generic:

   $ ./debian/scripts/misc/annotations --arch amd64 --flavour generic \
     --config CONFIG_X86_KERNEL_IBT --write y \
     --note "Enable Intel Indirect Branch Tracking (IBT) as a test"

Then run a `git diff` to show you the actual change(s).

For example, the following could be submitted as a valid patch to this
mailing list:

$ git diff

How to generate the .config for a specific kernel?
==================================================

To generate a standard .config for a specific architecture and flavour
run the following command (i.e., amd64, flavour generic):

  $ ./debian/scripts/misc/annotations --arch amd64 --flavour generic > .config

The generated .config will have all the config options for amd64,
flavour generic used by this particular kernel.

See also
========

 - Kernel configuration in Ubuntu
   (https://discourse.ubuntu.com/t/kernel-configuration-in-ubuntu/35857)

-Andrea
diff mbox series

Patch

diff --git a/debian.master/config/annotations b/debian.master/config/annotations
index 24cec55b1b20b..cfb2dc5eb3757 100644
--- a/debian.master/config/annotations
+++ b/debian.master/config/annotations
@@ -732,8 +732,8 @@  CONFIG_X509_CERTIFICATE_PARSER                  note<'module signing'>
 CONFIG_X86_ACPI_CPUFREQ                         policy<{'amd64': 'y'}>
 CONFIG_X86_ACPI_CPUFREQ                         note<'not autoloadable'>
 
-CONFIG_X86_KERNEL_IBT                           policy<{'amd64': 'n'}>
-CONFIG_X86_KERNEL_IBT                           note<'LP: #1980484'>
+CONFIG_X86_KERNEL_IBT                           policy<{'amd64': 'y'}>
+CONFIG_X86_KERNEL_IBT                           note<'Enable Intel Indirect Branch Tracking (IBT) as a test'>
 
 CONFIG_X86_PCC_CPUFREQ                          policy<{'amd64': 'y'}>
 CONFIG_X86_PCC_CPUFREQ                          note<'not autoloadable'>