2

I've got an embedded/headless Debian Linux box which boots from a read-only filesystem image. The configuration is set up so that I can (seemingly) write to the filesystem, but any changes to the filesystem do not actually get written to the flash device and thus do not survive a reboot.

This box has an on-motherboard Ethernet interface (Intel 82571EB) that uses the e1000e Linux driver:

root@embedded:~# lspci -v
[...]
07:00.0 Ethernet controller: Intel Corporation 82571EB Gigabit Ethernet Controller (rev 06)
    Subsystem: Intel Corporation PRO/1000 PT Dual Port Server Adapter
    Flags: bus master, fast devsel, latency 0, IRQ 45
    Memory at fc600000 (32-bit, non-prefetchable) [size=128K]
    I/O ports at 4000 [size=32]
    Capabilities: [c8] Power Management version 2
    Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+
    Capabilities: [e0] Express Endpoint, MSI 00
    Kernel driver in use: e1000e
[...]

As a way to understand the e1000e driver a bit better (and perhaps find and fix a bug that I suspect might be lurking in it), I've compiled my own instrumented version of the e1000e.ko kernel extension file and I would like to try it out.

I can scp my e1000e_instrumented.ko file to the Linux box, but I'm not sure what the proper way is to disassociate the OS's built-in e1000e driver from the 82571EB Ethernet controller and then tell Linux to use my custom .ko file instead. (If it was a desktop-style Linux PC, I think I could do it by copying my file over the existing /lib/modules/3.8.13/kernel/drivers/net/ethernet/intel/e1000e/e1000e.ko file and then rebooting... but on this machine any changes I make will go away when I reboot the machine, so I think I need a technique that does not involve a reboot)

What is the proper way to do this in Debian Linux? As an initial test, I tried:

modprobe -r e1000e ; modprobe e1000e

... just to see if I could remove the built-in driver and then re-load it again, but doing that just kills the networking on the Linux box and doesn't bring it back.

  • Try ifdown -a ; sleep 2 ; modprobe -r e1000e ; sleep 2; modprobe e1000e ; sleep 2; ifup -a. The sleeps may not be necessary but (apart from delaying things) shouldn't cause any harm. Otherwise, plug in a screen and keyboard and maybe a mouse. – cas Nov 12 '15 at 4:20
  • alternatively, if your machine has a second NIC (that uses a different driver) you could ssh in over that while working on the e1000e. some PCI-e NICs are quite cheap, $10 or so. as are many USB NICs. would be best to use a different IP subnet (e.g. a private subnet used only by the ssh client and ssh server) on the second NIC to avoid routing complications. – cas Nov 12 '15 at 4:25
  • Thanks cas, that worked great. If you move your first comment to an answer I will mark it as the answer to this question :) – Jeremy Friesner Nov 12 '15 at 17:57
0

You need to run ifup -a to bring up the network interfaces after modprobing e1000e. Adding some small delays with sleep 2 won't hurt either.

So, try:

ifdown -a ; sleep 2 ; modprobe -r e1000e ; sleep 2; modprobe e1000e ; sleep 2; ifup -a

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.