2

I accidentally deleted the kernel config file found in /boot. So I have 2 questions.

Does this affect the system by any means?

and I am trying to compile the Linux kernel now and was looking to using the Ubuntu config file and build on it so where can I get a valid config file?

I am on Ubuntu 14.04 LTS using kernel 3.13

Lucio
  • 18,843

2 Answers2

2

For files provided by packages, you can always look up which package provided them and either reinstall that package or download the package file and extract the file. The config files found /boot are provided by linux-image-* packages:

$ dpkg -S /boot/config-3.13.0-26-generic 
linux-image-3.13.0-26-generic: /boot/config-3.13.0-26-generic

Note how the config files' names all follow the pattern config-$(uname -r). uname -r is the kernel release, and looks like 3.13.0-26-generic. Since dpkg stores information on which currently installed packages added which files, as long as those packages are present, even deleted files can be look up. So you can do:

dpkg -S /boot/config-$(uname -r)

which will likely show that the file is owned by linux-image-$(uname -r). And then either reinstall that kernel package:

sudo apt-get install --reinstall linux-image-$(uname -r)

Or download the package and extract it manually:

apt-get download linux-image-$(uname -r)
ar x linux-image-$(uname -r)*.deb
tar -xf data.tar.* ./boot/config-$(uname -r)

Now the config file will be in boot/ in the directory where you extracted it.

muru
  • 197,895
  • 55
  • 485
  • 740
1

I think that the config file does not any affect the system now.

It is used only build a kernel image and modules. Perhaps, when you build new kernel module, The config file can be referred.

Due to read the config file, you can look the modules the kernel includes or dynamic loads or unused.

For example, At the config file,

CONFIG_EXT3_FS=y

The ext3fs module is embedded in the kernel image.

CONFIG_EXT3_FS=m

The ext3fs module is not embedded in the kernel image, but have runtime module loading.

CONFIG_EXT3_FS=n

The ext3fs module is not used in the kernel.

xiaodongjie
  • 2,824
  • 1
  • 18
  • 37