Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian User (http://www.linux-archive.org/debian-user/)
-   -   difference between kernel logs and /sys/class/net (http://www.linux-archive.org/debian-user/76286-difference-between-kernel-logs-sys-class-net.html)

"Martin Fuzzey" 04-25-2008 08:58 PM

difference between kernel logs and /sys/class/net
 
Hi all,

I have a machine running debian etch (2.6.18) with an onboard (8159)
ethernet interface and a firewire port.
By default both the kernel (as witnessed by dmesg) and /sys/class/net see
eth0 = firewire
eth1 = ethernet

If I blacklist the ieee1394, uhci1394 and eth1394 modules (or
disactivate the 1394 port in the bios) the kernel dmesg logs now show
eth0=ethernet as expected BUT /sys/class/net shows only eth1 (which is
the ethernet)

This is causing udev to assign the ethernet to eth1, even if I delete
the z25-persistent-net.rules file. This is logical since looking at
the udev scripts they scan /sys/class/net and use the devices assigned
there unless that conflicts with the current config.

I could get ethernet assigned to eth0 by editing (rather than
deleting) the persisten-net.rules file but I'm trying to create a disk
image whichj can be installed on multiple machines (and could thus
include appropriate module blacklists but not autogenerated udev rules
which depend on the final target network card MAC addreses)

In case it matters I'm not using debian installer but debootstrap +
grub to generate the disk.

any ideas appreciated,

Martin


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

"Bernardo Dal Seno" 04-27-2008 06:56 PM

difference between kernel logs and /sys/class/net
 
2008/4/25 Martin Fuzzey <mfuzzey@gmail.com>:
> I could get ethernet assigned to eth0 by editing (rather than
> deleting) the persisten-net.rules file but I'm trying to create a disk
> image whichj can be installed on multiple machines (and could thus
> include appropriate module blacklists but not autogenerated udev rules
> which depend on the final target network card MAC addreses)

You can match many parameters in udev rules, not just Mac addresses.
If your hardware mix doesn't permit you to have udev rules that are
generic enough, you can include a script in the image that runs once
at the first boot and do whatever setup you need.

Bernardo


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Martin Fuzzey 04-29-2008 08:32 PM

difference between kernel logs and /sys/class/net
 
Replying to my own post just to say I fixed it for the benefit of anyone
else that may run into this issue.

Thanks to those that replied.

The problem was that the initrd contained the persistent-net-rules from
the host system.
Trouble only occured when the the disk generation and the boot were done
on the same machine (after swapping disks).

In this case the udev in the initrd was renaming the initially detected
eth0 to eth1 (since its mac address matched)

The solution was to add a script to /usr/share/initramfs-tools/hooks to
delete the persistent-net-rules file during initrd generation (similar
to the existing udev one) in the chroot used to generate the disk.


Martin


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


All times are GMT. The time now is 10:14 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.