How to get the correct .config file to compile the Linux kernel kernel specific to my hardware?

I tried to use make defconfigto compile the kernel, but, as expected, it could not boot. I was wondering which kernel .config file is used by kernel manufacturers such as Canonical for Ubuntu, which the kernel can load right out of the box. Of course, I'm still a newbie and am setting up various options, a bit out of my league at present.

In particular, I am looking to download the basic "hello world!" module to my running kernel 2.6.32.41. To do this, I will need to compile the kernel source with the same .config file that was used for the running kernel.

+5
source share
4 answers

, , " ", , Ubuntu , /boot/ , config. , uname -r, , , .

+5

​​ CONFIG_IKCONFIG_PROC, /proc/config.gz:

$ zcat /proc/config.gz >my_config

my_config .config make config, , ( , , , ). ​​ , .

Distros , , . , ​​ (, ). - ​​defconfig, , .

+14

option1:

cd /usr/src/linux-headers-3.2.0-29;

.config

sudo make oldconfig; 
vi .config

option2:

zcat /proc/config.gz > my_config

OPTION3:

echo /boot/config* > my_config
+5

"defconfig" - x86 x86_64, , , . , Lenovo, - , bugzilla, .

, , , /boot. Fedora. " " " ", . U . , " apt-cache" Ubuntu 10.04 :

linux-headers-2.6.38 - Header files related to Linux kernel, specifically,
linux-libc-dev - Linux Kernel Headers for development

Ubuntu usually patched the kernel (kernel.org) to have its own kernel. If you loaded the stock kernel and tried to use the / boot configuration file (or sometimes you can find the currently loaded configuration file as /proc/config.gz, for example Backtrack Ubuntu based on 10.04 LTS), then u might need to do " make oldconfig "with the current configuration file named" .config ". "make oldconfig" will then use .config to create a new .config that is compatible with the kernel source.

0
source

All Articles