Linux – Find kernel with specific commit

linuxlinux-kernel

I have recently bought an Acer Aspire E1-572 with NetXtreme BCM57786 Gigabit Ethernet network card. The problem is that currently I cannot see it in ifconfig, but I can see it with lshw:

  *-network UNCLAIMED
       description: Ethernet controller
       product: NetXtreme BCM57786 Gigabit Ethernet PCIe
       vendor: Broadcom Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: 01
       width: 64 bits
       clock: 33MHz
       capabilities: pm vpd msi msix pciexpress bus_master cap_list
       configuration: latency=0
       resources: memory:b0410000-b041ffff memory:b0420000-b042ffff memory:b0430000-b04307ff

Shortly, I have found this bug: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1242610
and it seems to be exactly my problem. It seems to be solved in this commit http://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/drivers/net/ethernet/broadcom/tg3.c?id=68273712a19e9107a498a371532b3b3eb6dbb14c

I am using Ubuntu 12.04 so there's a probability that (at some point) the patch will be backported, but I would really like to find (if there is any) a [preferably] stable kernel version that would contain this patch so I would be able to use my eth0.

How would I find a kernel binary that contains a specific commit? Or find whether a specific kernel binary has a given commit?

UPDATE

# uname -a
Linux laptop 3.8.0-33-generic #48~precise1-Ubuntu SMP Thu Oct 24 16:31:16 UTC 2013 i686 i686 i386 GNU/Linux

I installed it using:

apt-get install linux-generic-lts-raring

Best Answer

According to the git commit history, the particular commit you identified as containing the fix you needed was merged to the mainline kernel in v3.13-rc1:

$ git describe --contains 68273712a19e9107a498a371532b3b3eb6dbb14c
v3.13-rc1~105^2~360

Unfortunately it seems unlikely that the particular patch would get included into older kernels in the stable development branch as that is generally only done to relatively small and critical fixes for security problems or significant regressions discovered in a given 3.x kernel.

That said, it isn't impossible that the fix would get picked up by distribution maintainers, or you could always apply the patch yourself and build your own kernel.

The Ubuntu kernel sources can be obtained by running:

git clone git://kernel.ubuntu.com/ubuntu/ubuntu-<release>.git

As a sidenote, you might want to install the linux-current-generic package instead of linux-generic-lts-raring as the former will on depend the most recently released generic kernel image and headers, up to 14.04 inclusive.

Related Question