01 October 2012

250. Compiling Kernel 3.6 on Debian Testing/Wheezy

IMPORTANT: a lot of drivers need to be explicitly enabled now, in particular those related to video devices (e.g. saa*, uvcvideo)

Nothing difficult or weird about compiling your own kernel, and 3.6 is no exception. This post is pretty much identical to my previous kernel compile posts, but with 3.6 replacing 3.x.
I've successfully compiled 3.6.0, 3.6.2, 3.6.3 and 3.6.6 this way.

If you're wondering whether it's worth it, you can have a look here:
 http://www.h-online.com/open/features/What-s-new-in-Linux-3-6-1714690.html

If you've never compiled a kernel before you might need to:
sudo apt-get install kernel-package fakeroot build-essential

Then get on with it:

wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.6.3.tar.bz2
tar xvf linux-3.6.3.tar.bz2
cd linux-3.6/
cat /boot/config-`uname -r`>.config
make oldconfig

You'll get a whole bunch of questions about what to include. See the end of the post for a list.

Video device drivers
Chances are that you will want to do
make menuconfig

and enable the compilation of various video device drivers e.g. go to Device drivers, Multimedia support, star (*) Cameras/video grabbers support, which enables Video Capture Adapters. Go to Video Capture Adapters and enable e.g. V4L USB devices/USB Video Class (m) to get your webcam working. You may need to enable other things too.

 Next:

make-kpkg clean
time fakeroot make-kpkg -j3 --initrd --revision=3.6.3 --append-to-version=-amd64 kernel_image kernel_headers

Building takes a while -- about 39 minutes on an AMD II X3.

mv ../*3.6.3*.deb .
sudo dpkg -i *.deb

And you're done!


What's new:

Expose hardware/virtual IRQ mapping via debugfs (IRQ_DOMAIN_DEBUG) [N/y/?] (NEW) *
Memory Resource Controller for Control Groups (MEMCG) [N/y/?] (NEW)
HugeTLB Resource Controller for Control Groups (CGROUP_HUGETLB) [N/y/?] (NEW)
Virtual (secure) IP: tunneling (NET_IPVTI) [N/m/?] (NEW)
NFQUEUE integration with Connection Tracking (NETFILTER_NETLINK_QUEUE_CT) [N/y/?] (NEW)
CAN Identifier (NET_EMATCH_CANID) [N/m/?] (NEW)     IPset (NET_EMATCH_IPSET) [N/m/?] (NEW)
Three-wire UART (H5) protocol support (BT_HCIUART_3WIRE) [N/y/?] (NEW)
Trace all mac80211 debug messages (MAC80211_MESSAGE_TRACING) [N/y/?] (NEW)   *
Driver for Broadcom BCM8706 and BCM8727 PHYs (BCM87XX_PHY) [N/m/?] (NEW) 
rt2800pci - Include support for rt3290 devices (EXPERIMENTAL) (RT2800PCI_RT3290) [Y/n/?] (NEW) 
MELFAS MMS114 touchscreen (TOUCHSCREEN_MMS114) [N/m/?] (NEW) 
EDT FocalTech FT5x06 I2C Touchscreen support (TOUCHSCREEN_EDT_FT5X06) [N/m/?] (NEW) 
Analog Devices AD-FMCOMMS1-EBZ SPI-I2C-bridge driver (SPI_XCOMM) [N/m/?] (NEW) 
BT8XX GPIO abuser (GPIO_BT8XX) [N/m/y/?] (NEW)   
AMD 8111 GPIO driver (GPIO_AMD8111) [N/m/y/?] (NEW)  
4096-Bit Addressable 1-Wire EEPROM with PIO (DS28E04-100) (W1_SLAVE_DS28E04) [N/m/?] (NEW)
Adaptive Voltage Scaling class support (POWER_AVS) [N/y/?] (NEW) *
Honeywell Humidicon HIH-6130 humidity/temperature sensor (SENSORS_HIH6130) [N/m/?] (NEW) 
BCMA Broadcom GBIT MAC COMMON core driver (BCMA_DRIVER_GMAC_CMN) [N/y/?] (NEW)
Support Wolfson Microelectronics Arizona platform with I2C (MFD_ARIZONA_I2C) [N/m/?] (NEW)
Support Wolfson Microelectronics Arizona platform with SPI (MFD_ARIZONA_SPI) [N/m/y/?] (NEW)
Cameras/video grabbers support (MEDIA_CAMERA_SUPPORT) [N/y/?] (NEW)  
Analog TV support (MEDIA_ANALOG_TV_SUPPORT) [N/y/?] (NEW) 
Digital TV support (MEDIA_DIGITAL_TV_SUPPORT) [N/y/?] (NEW)  
AM/FM radio receivers/transmitters support (MEDIA_RADIO_SUPPORT) [N/y/?] (NEW) 
Remote Controller support (MEDIA_RC_SUPPORT) [N/y/?] (NEW) 
Enable framebuffer console under vmwgfx by default (DRM_VMWGFX_FBCON) [N/y/?] (NEW)  
User-space I/O driver support for HID subsystem (UHID) [N/m/?] (NEW)  
Lenovo ThinkPad USB Keyboard with TrackPoint (HID_LENOVO_TPKBD) [N/m/?] (NEW) 
LED support for LM3556 Chip (LEDS_LM3556) [N/m/?] (NEW)  
LED support for the BlinkM I2C RGB LED (LEDS_BLINKM) [N/m/?] (NEW) 
LED One-shot Trigger (LEDS_TRIGGER_ONESHOT) [N/m/y/?] (NEW) 
EDAC legacy sysfs (EDAC_LEGACY_SYSFS) [Y/n/?] (NEW)  
VFIO Non-Privileged userspace driver framework (VFIO) [N/m/y/?] (NEW) *
Xen platform mcelog (XEN_MCE_LOG) [N/y/?] (NEW) *
Comedi misc drivers (COMEDI_MISC_DRIVERS) [N/y/?] (NEW) *
Comedi PCI drivers (COMEDI_PCI_DRIVERS) [N/y/?] (NEW) *
Comedi PCMCIA drivers (COMEDI_PCMCIA_DRIVERS) [N/y/?] (NEW) *
Comedi USB drivers (COMEDI_USB_DRIVERS) [N/y/?] (NEW) *
CSR wireless driver (CSR_WIFI) [N/m/?] (NEW) *
Pulse-Width Modulation (PWM) Support (PWM) [N/y/?] (NEW) *
Log kernel console messages (PSTORE_CONSOLE) [N/y/?] (NEW)   
Provide swap over NFS support (NFS_SWAP) [N/y/?] (NEW) 
Notifier error injection (NOTIFIER_ERROR_INJECTION) [N/m/y/?] (NEW)
Set upper limit of TLB entries to flush one-by-one (DEBUG_TLBFLUSH) [N/y/?] (NEW)
Serpent cipher algorithm (x86_64/AVX) (CRYPTO_SERPENT_AVX_X86_64) [N/m/y/?] (NEW) 
Twofish cipher algorithm (x86_64/AVX) (CRYPTO_TWOFISH_AVX_X86_64) [N/m/y/?] (NEW)   *
TCM_VHOST fabric module (EXPERIMENTAL) (TCM_VHOST) [N/m/?] (NEW) #

Links to this post:
http://forumubuntusoftware.info/viewtopic.php?f=117&t=8832
http://linux.org.ru/forum/linux-hardware/8339795
http://www.taringa.net/comunidades/ubuntuparataringeros/6513772/_ayuda_compilar-kernel-3_6-en-crunchbang.html
http://kenan.abdullahoglu.com/index.php/bilisim
http://crunchbang.org/forums/viewtopic.php?id=24484
http://forum.teneon.de/index.php?yshout&file=home&history&n=1000

20 comments:

  1. Problems with compilation

    IHEX firmware/sb16/ima_adpcm_playback.csp
    IHEX firmware/sb16/ima_adpcm_capture.csp
    IHEX2FW firmware/atmsar11.fw
    H16TOFW firmware/matrox/g200_warp.fw
    H16TOFW firmware/matrox/g400_warp.fw
    make[1]: Залишаю каталог "/home/abodnya/linux-3.6.2"
    /usr/bin/make -j3 EXTRAVERSION=-i386 ARCH=i386 \
    -C Documentation/lguest
    make: *** Documentation/lguest: No such file or directory. Зупинка.
    make: *** [debian/stamp/build/kernel] Помилка 2

    real 47m6.752s
    user 65m12.329s
    sys 6m19.436s

    ReplyDelete
    Replies
    1. You're building a 32 bit kernel, so have a look at the end of this post: http://verahill.blogspot.com.au/2012/02/debian-testing-building-your-own-linux.html

      Basically, you need to create a symmlink to make up for the missing Documentation/lguest, so in the root of the kernel source:
      ln -s Documentation/virtual/lguest Documentation/lguest

      Delete
  2. Previously, I have Wheezy with kernel version 3.2.0-3-686-pae. My USb webcam works fine.

    I managed to upgrade according to your steps & kernel becomes version 3.6.0-amd64. My USB webcam no longer working & there is no video0 in /dev. However, lsusb still able to see the camera connected

    Pls help

    ReplyDelete
    Replies
    1. Recompile the kernel (or compile 3.6.2) but make sure to enable the compilation of v4l devices. Before you launch the compile, do 'make menuconfig', go to Device Drivers/Multimedia Support/Video Capture adapters/V4L USB Devices/ and pick your device(s).
      If you're not sure which driver you need, boot into your old kernel and find out using lsmod.
      You may also need to force loading of the module by adding it to /etc/modules

      Delete
  3. Yes, it is working.

    Thank you

    ReplyDelete
  4. Hi
    Just wanted to give you a huge thanks for all the work you are putting in to this blog, just managed to compile 3.6.6 with your help. Linux noob trying to learn as much as i can about this wonderful system. Thank you and keep up the good work!

    ReplyDelete
  5. Hi thanks for your guide i followed it and upon sudo dpgk -i *.deb i get the error message:

    Examining /etc/kernel/header_postinst.d.
    run-parts: executing /etc/kernel/header_postinst.d/dkms 3.6.8-amd64 /boot/vmlinuz-3.6.8-amd64
    Error! Your kernel headers for kernel 3.6.8-amd64 cannot be found.
    Please install the linux-headers-3.6.8-amd64 package,
    or use the --kernelsourcedir option to tell DKMS where it's located

    i dont know what to do please halp! :)

    ReplyDelete
    Replies
    1. Silly question, but have you made sure that you compiled the headers OK and that they are in your directory?
      What does ls *.deb show?

      There should be no issues. I'll compile 3.6.8 to see if there's anything specific about it, but I wouldn't expect there to be.

      Delete
    2. I had a look at an installation of 3.6.6:
      I think you just got an error message as part of the installation, but the installation continued, right?

      It complains about missing headers because they are not installed yet -- you're after all in the process of installing them, so that's fine.

      What does
      aptitude search 3.6.8
      show? Did everything install?

      Delete
  6. Hi thanks for the quick answering!

    Yes in /usr/src there is the 3.6.8-amd64 directory with all the files in it.

    iche@bookbohook:/usr/src$ ls
    fglrx-12-6+point linux-headers-3.2.0-4-amd64 linux-headers-3.6.8-amd64 kernels linux-headers-3.2.0-4-common linux-kbuild-3.2

    ls *.deb shows:

    iche@bookbohook:~/downloads/linux-3.6.8$ ls *.deb
    linux-image-3.6.8-amd64_3.6.8_amd64.deb


    ReplyDelete
  7. no it stopped after installing the headers:

    iche@bookbohook:~/downloads/linux-3.6.8$ aptitude search 3.6.8
    i linux-headers-3.6.8-amd64 - Header files related to Linux kernel, spec

    ReplyDelete
    Replies
    1. So it looks like the headers installed fine but the image refuses to, in spite of the presence of the headers?

      I've often encountered the error message you quoted at the beginning, but the image has always installed fine anyway, so I don't know why it's not working for you.

      Any other error messages that could shed light on this?

      And why does "ls *.deb" only return "linux-image-3.6.8-amd64_3.6.8_amd64.deb"? Or did you already delete the headers package?

      Delete
  8. No, i did not delete any package. Opening the amd64_3.6.8_amd.... package with an archive manager shows only the sources are in there so it seems only the sources/headers compiled... weird. I will just try to compile again.

    Thanks very much for your help!

    ReplyDelete
    Replies
    1. Hope it works out better on the second attempt. Good luck, and report back if you figure out what went wrong the first time.

      Delete
  9. Hi i do not really know what went wrong the first time.

    Everything worked fine now on the second attempt following your steps.
    Sadly the goal I wanted to achieve (my win7 phone being recognized as mass storage) wasn't achieved. Have to go back to the configuration of kernel. I know it can work, it already worked once in linuxmint, just have to find the right config setting.

    ReplyDelete
    Replies
    1. If you still have access to a running mint kernel you can do

      cat /boot/config-`uname -r`>mintconfig

      and then use that as your starting point or just do a diff to see what's in the mint kernel which isn't in your debian kernel.

      The other alternative is to do
      make menuconfig
      (as shown above) and look for something that sounds right.

      Is it really not being recognised, or just not being auto-mounted? What does lsusb and dmesg say?

      Delete
  10. output of dmesg after plugging in the phone:

    [92400.933977] usb 1-1: new high-speed USB device number 4 using ehci_hcd
    [92401.068281] usb 1-1: New USB device found, idVendor=045e, idProduct=04ec
    [92401.068297] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=9
    [92401.068307] usb 1-1: SerialNumber: 99461300-b56a-0801-3517-630407836880

    output of lsusb:
    Bus 001 Device 004: ID 045e:04ec Microsoft Corp. Windows Phone (Zune)

    but there is no /dev/sdb or similar to mount it
    sadly i dont have the linuxmint installation anymore

    ReplyDelete
    Replies
    1. So it looks like it's being recognised. The question is whether the right driver is loaded.
      You might need to make a udev rules file (e.g. /etc/udev/rules.d/70-winphone.rules) with

      # Microsoft Windows Phone
      ATTR{idVendor}=="045e", ATTR{idProduct}=="04ec", SYMLINK+="libmtp-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"

      in it.

      Not much time to look into it today though.

      Delete
    2. For getting the .config from mint you could probably just get it from the iso. If not, then install it in a virtual machine.

      Have you got e.g. fuse installed on debian? Mint installs a lot more by default than Debian does, so it might not just be about the kernel.

      Anyway, I'm obviously just speculating at this point.

      Delete