5

I am compiling the latest kernel cloned from Linus's git repository for a challenge. Here are the steps I followed,
1. Installed cross compilation tools

sudo apt-get install git build-essential kernel-package fakeroot libncurses5-dev  

2. cloned the latest git repository

$ git clone https://github.com/torvalds/linux.git  

3. Copied the current build configuration to the root of the source tree and updated the configuration file.

yes '' | make oldconfig  

4. make clean
5. Made the linux image and header .deb files

make -j `getconf _NPROCESSORS_ONLN` deb-pkg LOCALVERSION=-custom  

After a few minutes of compilation, it shows the error

dpkg-genchanges: warning: package linux-firmware-image-4.2.0-rc3-custom listed in files list but not in control info
dpkg-genchanges: warning: package linux-headers-4.2.0-rc3-custom listed in files list but not in control info
dpkg-genchanges: warning: package linux-headers-4.3.0-rc1-eudyptula listed in files list but not in control info
dpkg-genchanges: warning: package linux-image-4.2.0-rc3-custom-dbg listed in files list but not in control info
dpkg-genchanges: warning: package linux-image-4.3.0-rc1-eudyptula listed in files list but not in control info
dpkg-genchanges: warning: package linux-image-4.2.0-rc3-custom listed in files list but not in control info
dpkg-genchanges: warning: package linux-image-4.3.0-rc1-eudyptula-dbg listed in files list but not in control info
dpkg-genchanges: warning: package linux-firmware-image-4.3.0-rc1-eudyptula listed in files list but not in control info
dpkg-genchanges: error: package linux-image-4.2.0-rc3-custom-dbg has section kernel in control file but debug in files list
scripts/package/Makefile:91: recipe for target 'deb-pkg' failed
make[1]: *** [deb-pkg] Error 255
Makefile:1226: recipe for target 'deb-pkg' failed
make: *** [deb-pkg] Error 2 

I think the error has occurred in the making of .deb package. I really don't understand the error message

 linux-image-4.2.0-rc3-custom-dbg has section kernel in control file but debug in files list  

What does it really means?. Please help!

5

First, the yes '' | make oldconfig step is more easily done by way of make olddefconfig.

Having said that,

What happens is that the kernel's Makefile generates a number of files inside a debian/ directory which are not completely following the spec. Combined with a gradual stricter enforcement of this spec in the build tools over the years, means that a hack which used to work in the past (generating .deb packages which aren't listed in debian/control, or which are listed but whose details differ) don't work anymore these days.

Personally, I recommend against the make deb-pkg method of building a Debian package of a vanilla kernel. If you want to do that, a method which works better IME is to use the kernel-package package which is part of Debian proper:

apt install kernel-package fakeroot
cd /path/to/git/checkout
make defconfig
make-kpkg --rootcmd fakeroot kernel_image

This should get you a package (with the .config file you created) that you can install on your Debian system.

  • "make-kpkg --rootcmd fakeroot make-kpkg kernel_image" shows error "Error: Unknown target make-kpkg use --targets to display help on valid targets". So I used "fakeroot make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers". Now it's compiled succesfully. I installed all the generated deb packages using "dpkg -i *.deb" but the new kernel is not booting up ! – ebin Oct 7 '15 at 18:04
  • That probably means you need to switch some .config options; Debian assumes a few things, some of which may not be part of the default configuration. This is a different problem, however, so I would suggest you ask a new question about that (and that you add some details about the failure to boot...) – Wouter Verhelst Oct 8 '15 at 12:47
  • Updated to remove my mistake... – Wouter Verhelst Oct 19 '15 at 6:06
  • @WouterVerheist Can you answer this question ? unix.stackexchange.com/questions/238469/… – ebin Nov 4 '15 at 16:11
0

I was seeing the same problem as you, and solved it by cherry-picking this patch into my tree:

It looks like it could also be solved by doing

rm -f debian/files

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.