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

predefine interfaces by MAC with udev?



Hola,

Well, I think I'm onto something..
It seems that my /etc/udev/rules.d/z25_persistent-net.rules never gets
written to.
And then I discovered that /lib/udev/write_net_rules is not copied to
the ramfs image.

So I edited
/etc/initramfs-tools/hooks/udev
and added it (plus other things just incase)

cp /lib/udev/net.agent $DESTDIR/lib/udev/
cp /lib/udev/udev_run_hotplugd $DESTDIR/lib/udev/
cp /lib/udev/write_net_rules $DESTDIR/lib/udev/
cp /lib/udev/udev_run_devd $DESTDIR/lib/udev/

And it works!
/etc/udev/rules.d/z25_persistent-net.rules is populated and respected.

I'll get back if this fails under more testing. :)
Chris.




On Feb 11, 2008 4:03 PM, Jordi Pujol <jordipujolp at gmail.com> wrote:
> >
> > SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="00:01:02:f3:ef:8c",
> > NAME="eth0" #SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="
> > 00:0a:5e:5e:e0:fa", NAME="eth0"
> >
> what does mean that ?
> is a writing bug ?
>
> > I have modified /etc/initramfs-tools/hooks/udev
> >
> > #mkdir$DESTDIR/lib/udev/
> > mkdir -p $DESTDIR/lib/udev/
> > cp /lib/udev/hotplug.functions $DESTDIR/lib/udev/
> > copy_exec /lib/udev/ide.agent /lib/udev/
> > for program in /lib/udev/*_id; do
> >   copy_exec $program /lib/udev/
> > done
> >
> > now ip link sh' shows
> > eth0: 00:0a:5e:5e:e0:fa
> > eth1_rename: 00:01:02:f3:ef:8c
> > (before it just showed eth1: 00:01:02:f3:ef:8c)
>
> can be that udev can not rename eth1 because eth0 already exists ?
> two rules are needed ?
>
> SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="00:01:02:f3:ef:8c",
> NAME="eth0"
> SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="00:0a:5e:5e:e0:fa",
> NAME="eth1"
>



Reply to: