[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to properly import the configuration of the Buster kernel into own development ?



On 2020-08-09 at 07:14, Thomas Schmitt wrote:

> Hi,
> 
> are people here who make their own kernels and know how to import the
> configuration of the originally installed kernel ?
> 
> I got lured by
>   https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html
> into following
>   "generate a configuration based on the running kernel and the currently
>    loaded modules (make localmodconfig)"
> which was obviously a poor decision.
> 
> What should i do in order to bring the configuration of the original Buster
> kernel 4.19.0 to my experimental kernel which stems from the Buster package
> "linux-source-4.19" ?

I'm not 100% sure how things are laid out in that Debian version, but
generally speaking, what you want to do is grab the kernel config file
which was used to build your current kernel, and drop that into place in
your kernel source tree (or more specifically, your kernel *build* tree,
which can be different) under the filename '.config'.

IIRC, at one point in the past, Debian had the necessary kernel config
options enabled for this config file to be available (compressed) under
the name '/proc/config.gz'. However, in current Debian testing, that
file isn't present. (If it's there on your system, just decompress it
and skip the next three paragraphs.)

Instead, the config is available under /boot, in a filename matching the
kernel version (or at least the name of the kernel package). On my system:

$ uname -r
5.7.0-1-amd64
$ ls /boot/*`uname -r`* | grep config
/boot/config-5.7.0-1-amd64

A quick look at this latter confirms that it has what look like the
correct contents to be a kernel config file.

Just copy that to $KERNELSOURCE/.config , run your choice of Kconfig
interface (I prefer 'make menuconfig', but many seem to recommend 'make
oldconfig') to make sure it's up to date with any changes that may have
been made in the kernel source you're drawing on, and you should be good
to go.

I haven't done this with kernel source from a Debian package, but I've
done similar builds directly from upstream kernel.org source many times
via a similar methodology.

> (There seem to be some new configuration options in the source
> kernel.)

That's what the final 'make menuconfig' / 'make oldconfig' / etc. is
there for. If memory serves, 'make oldconfig' specifically asks you only
about options which aren't already answered in the existing config file.

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: