Showing posts with label Debian. Show all posts
Showing posts with label Debian. Show all posts

Thursday, June 6, 2013

DKMS for updated e1000e driver

So, since I updated the e1000e driver, I've gotten no more errors in my messages logs.  However, it does seem that every month or two, a kernel update gets pushed to Squeeze, which un-does my driver fix.  When I worked at Dell, and we needed driver to be recompiled for any kernel that got installed, DKMS was the solution.  I rarely have to use cutting edge hardware with, umm, mature operating systems these days (I use old hardware with old operating systems), I hadn't given it much thought.  While DKMS is awesome when someone else does all the upfront work for you, trying to sort it out on one's own is significantly less fun.  I spent several hours over the course of a couple of weeks reading various things, and all of them failing to do what I wanted.  Got back to this week and finally got it sorted out.


  1. Dowload appropriate source for the e1000e driver: http://sourceforge.net/projects/e1000/files/e1000e%20stable/2.3.2/e1000e-2.3.2.tar.gz
  2. Extract archive to /usr/src.
  3. Create a dkms.conf in the /usr/src/e1000e-2.3.2 directory with the following contents:
    PACKAGE_NAME="e1000e"
    PACKAGE_VERSION="2.3.2"
    BUILT_MODULE_LOCATION[0]="src"
    BUILT_MODULE_NAME[0]="e1000e"
    DEST_MODULE_LOCATION[0]="/kernel/drivers/net/e1000e/"
    AUTOINSTALL="yes"
    MAKE[0]="BUILD_KERNEL=${kernelver} make -C src CFLAGS_EXTRA=-DDISABLE_PM"
    CLEAN[0]="make -C src clean"
    REMAKE_INITRD=yes
  4. Now just add the module via dkms:
    dkms -m e1000e -v 2.3.2 add
    dkms -m e1000e -v 2.3.2 build
    dkms -m e1000e -v 2.3.2 install


    After completion, you should restart the system to verify that the initial ramdisk got rebuilt correctly, and that the correct version of the driver is being used (modinfo e1000e).

Thursday, March 14, 2013

Updating e1000e driver in Debian Squeeze

I kept having issues with my onboard Intel NIC on my Debian Squeeze NAS, the all too common:

Detected Hardware Unit Hang:

The version of the driver is significatly old, so I downloaded the newest from Sourceforge and tried to compile it. It failed to compile do to some power management code that is not in the kernel source from Debian.  Eventually I found someone else who'd had the same problem with the igb driver and solved it just by adding a flag to make:  CFLAGS_EXTRA=-DDISABLE_PM

Did the same when building the e1000e driver, compiled smoothly, remade initramfs, rebooted, haven't seen an error since.

Sunday, July 8, 2012

Getting a SYBA Serial card working under Debian Squeeze

I have a SYBA SY-PCI15003 that I used previously to connect to a UPS under FreeBSD 7.3 (FreeNAS).  When I moved that system over to run Debian Linux Squeeze (OpenMediaVault), NUT would not detect my UPS.  I read a bunch of pages, went down a few blind alleys, and eventually just figured it out myself.  So, here's what I did to get the serial port to be usable again:

1) Is the card detected at all, yes it is:

lspci -v

04:05.0 Serial controller: NetMos Technology PCI 9865 Multi-I/O Controller (prog-if 02 [16550])
    Subsystem: Device a000:1000
    Flags: medium devsel, IRQ 17
    I/O ports at bce8 [size=8]
    Memory at df9fb000 (32-bit, non-prefetchable) [size=4K]
    Memory at df9fc000 (32-bit, non-prefetchable) [size=4K]
    Capabilities: [48] Power Management version 2

04:05.1 Serial controller: Illegal Vendor ID Device 9865 (prog-if 02 [16550])
    Subsystem: Device a000:1000
    Flags: medium devsel, IRQ 18
    I/O ports at bcf0 [size=8]
    Memory at df9fd000 (32-bit, non-prefetchable) [size=4K]
    Memory at df9fe000 (32-bit, non-prefetchable) [size=4K]
    Capabilities: [48] Power Management version 2

04:05.2 Serial controller: Illegal Vendor ID Device 9865 (prog-if 00 [8250])
    Subsystem: Device a000:0000
    Flags: medium devsel, IRQ 19
    I/O ports at bcf8 [size=8]
    I/O ports at <unassigned>
    Memory at df9ff000 (32-bit, non-prefetchable) [size=4K]
    Capabilities: [48] Power Management version 2
    Kernel driver in use: serial

 2) What does the system think IRQ/IO for the device is:

# setserial -a /dev/ttyS0
/dev/ttyS0, Line 0, UART: unknown, Port: 0x03f8, IRQ: 19
    Baud_base: 115200, close_delay: 50, divisor: 0
    closing_wait: 3000
    Flags: spd_normal skip_test

3) Since this configuration doesn't work, let's change it to point to the parent device:

setserial /dev/ttyS0 uart 16550 irq 17 port 0xbce8


The documentation for the device states that the uart is a 16550, and lspci -v gave the IRQ and the I/O port (make sure that you include the 0x before the I/O port).  After the changes its looks like this:

# setserial -a /dev/ttyS0
/dev/ttyS0, Line 0, UART: 16550, Port: 0xbce8, IRQ: 17
    Baud_base: 115200, close_delay: 50, divisor: 0
    closing_wait: 3000
    Flags: spd_normal

4) Test. I already had NUT configured for my UPS, so my testing was as easy as starting up the service and it actually finding the UPS.  There's tons of info about how to test your serial ports, so I won't go into that here.

5) Make configuration persistent.  This will depend on what distribution you're using, for Debian Squeeze, I found the easiest thing to do was use /etc/serial.conf.  Mine didn't exist, but the contents of the file are very simple, its just the arguments to setserial, in my case I could create it thusly:

# echo "/dev/ttyS0 uart 16550 irq 17 port 0xbce8" >> /etc/serial.conf

6) Reboot if you'd like, to make sure it correctly persists.

C'est fini!