[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#407460: USB ethernet interface renamed after installation on NSLU2 which causes the system to be inaccessible



Hi Martin

I'm CC'ing this message to debian-boot because we may like to get this
fix into RC2.

On 2/13/07, Martin Michlmayr <tbm@cyrius.com> wrote:
Anyway, I'm away from my slug for the next 3 weeks, but maybe someone
can try adding such a udev rule and the nic-modules udeb and see
whether it works.

How about the following idea for a quick and simple workaround to this
problem (it is based on something Steve suggested earlier in the
thread).

Include the ixp4xx NPE driver modules in both the official and
unofficial installer images and modify oldsys-preseed with the patch
below.

Index: oldsys-preseed
===================================================================
--- oldsys-preseed      (revision 45326)
+++ oldsys-preseed      (working copy)
@@ -37,7 +37,15 @@
                       parse_sysconf "/dev/$sysconf"
                       # The original NSLU2 uses a different name for
the network interface
                       if [ "$INTERFACE" = "ixp0" ]; then
-                               INTERFACE=eth0
+                               # IXP4xx NPE ethernet interface seems to come
+                               # up as eth0 (#407460) therefore only use eth0
+                               # for the installer if the NPE microcode is
+                               # present
+                               if [ -h /lib/firmware/NPE-B ]; then
+                                       INTERFACE=eth0
+                               else
+                                       INTERFACE=eth1
+                               fi
                       fi
                       # Use DHCP if the original IP from the
firmware has never been changed
                       if [ "$IPADDRESS" = "192.168.1.77" ]; then

Both the official and unofficial installer images work on my setup
with this patch applied.

The rational behind this workaround is that I have found that with the
NPE driver modules included in the image, the built-in Ethernet
interface comes up as eth0, regardless of whether the NPE microcode is
present. So it makes sense to use eth0 as the default installer
interface if the NPE microcode is included in the installer image, or
eth1 (the alternate Ethernet adapter) if the NPE microcode is not
included. What is nice is that the post-installation configuration is
correct (/etc/network/interfaces and udev; see the output at the end
of this email) which means that the system is accessible
post-installation.

The assumption (and therefore the possible problem) with this
workaround is that the built-in interface will always be named eth0. I
have found this to be the case with an asix based USB to Ethernet
adapter. It would be reassuring to test this assumption with an
different adapter. In the future, maybe Marco could add a udev rules
file (e.g. z30_persistent-embedded-devices or something) in the udev
deb and udeb that would have persistent device names for embedded
devices supported by Debian, e.g. for ixp4xx it could have the rule

# IXP4xx built-in Ethernet adapter
SUBSYSTEM=="net", DRIVERS=="ixp4xx_mac", NAME="eth0"

which would then guarantee that the built-in ethernet adapter would
always be named eth0 on ixp4xx platforms.

BTW, if we adopt this workaround, we will need to change

/usr/share/initramfs-tools/hooks/nslu2

which complains about the missing NPE-B microcode if the NPE driver
modules are present. For example, during the installation using the
official image (with the NPE driver modules) I see

Feb 26 04:31:13 apt-install: Warning: ixp4xx_npe ethernet driver
firmware file /lib/firmware/NPE-B not found
Feb 26 04:31:13 apt-install: Warning: This system has an ethernet
module loaded; it's not safe to
Feb 26 04:31:13 apt-install: create an initramfs image for the new
kernel without the firmware file.
Feb 26 04:31:13 apt-install:
Feb 26 04:31:13 apt-install: Unable to abort; system will probably be broken!

Let me know what you think.

Gordon

Additional output:


* Official (with NPE driver modules but no NPE microcode):

$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth1
iface eth1 inet static
       address 192.168.1.67
       netmask 255.255.255.0
       network 192.168.1.0
       broadcast 192.168.1.255
       gateway 192.168.1.1
       # dns-* options are implemented by the resolvconf package, if installed
       dns-nameservers 205.171.3.65 205.171.2.65
       dns-search example.org

$ cat /etc/udev/rules.d/z25_persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, probably run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single line.
# MAC addresses must be written in lowercase.

# USB device 13b1:0018 (asix)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:14:bf:fe:2a:4e",
NAME="eth1"


* Unofficial (with ixp4xx_* and NPE microcode):

$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
       address 192.168.1.67
       netmask 255.255.255.0
       network 192.168.1.0
       broadcast 192.168.1.255
       gateway 192.168.1.1
       # dns-* options are implemented by the resolvconf package, if installed
       dns-nameservers 205.171.3.65 205.171.2.65
       dns-search example.org

$ cat /etc/udev/rules.d/z25_persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, probably run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single line.
# MAC addresses must be written in lowercase.

# USB device 13b1:0018 (asix)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:14:bf:fe:2a:4e",
NAME="eth1"

# Unknown net device (/class/net/eth0) (ixp4xx_mac)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:14:bf:71:02:d7",
NAME="eth0"

--
Gordon Farquharson



Reply to: