70-persistent-net.rules not created

jmscott at setex.ipcallback.com jmscott at setex.ipcallback.com
Tue Jan 12 19:07:07 PST 2010


On Tue, Jan 12, 2010 at 12:57:25PM -0600, Bruce Dubbs wrote:
> jmscott at setex.ipcallback.com wrote:
> 
> > regarding the following code blurb in LFS 6.5, chapter 7.13.1
> > 
> >      for NIC in /sys/class/net/* ; do
> >          INTERFACE=${NIC##*/} udevadm test --action=add $NIC
> >      done
> > 
> > i've come to the conclusion that something is missing.
> 
> Yes, there is something wrong, but it's on your system. I was able to do 
> this:

i may have found something.  i was incorrect about the udev
source not containing the word INTERFACE.
at line 664 of udev/udev-event.c the value of INTERFACE is being
conditionally added to the udev property list, which i'm pretty sure
becomes the environment exported to the script.

the condition for exporting INTERFACE is that something called
syspath contains a '/'.

i'm tracing down what syspath is now.

-j

> 
> $ for NIC in /sys/class/net/* ; do  \
>     INTERFACE=${NIC##*/}; echo $INTERFACE; done
> eth0
> lo
> sit0
> 
> I then edited /lib/udev/write_net_rules and put the following at the top 
> of the file:
> 
> echo "write_net_rules start" > xxx
> env >> xxx
> exit
> 
> I renamed /etc/udev/rules.d/70-persistent-net.rules and ran:
> 
> # INTERFACE=eth0 /sbin/udevadm test --action=add /sys/class/net/eth0
> 
> # cat xxx
> write_net_rules start
> SUBSYSTEM=net
> DEVPATH=/devices/pci0000:00/0000:00:19.0/net/eth0
> ACTION=add
> PWD=/etc/udev/rules.d
> UDEV_LOG=6
> COMMENT=PCI device 0x8086:0x10de (e1000e)
> MATCHADDR=00:25:64:38:ec:dd
> SHLVL=1
> IFINDEX=2
> INTERFACE=eth0
> MATCHIFTYPE=1
> _=/usr/bin/env
> 
> As you can see, INTERFACE was passed just fine.
> 
> I removed the edits to write_net_rules and re-ran the udevadm test 
> command and 70-persistent-net.rules was generated just fine.
> 
> > as best i can tell, the environment variable INTERFACE is not passed unqualified
> > to the dependent script /lib/udev/write_net_rules referenced in the rules file
> > /lib/udev/rules.d/75-persistent-net-generator.rules, causing the error 
> > 
> >     util_run_program: '/lib/udev/write_net_rules' (stderr) 'missing $INTERFACE'
> > 
> > so far, my opinion is that either a rule to export INTERFACE needs to be 
> > added to some rules file, which escapes me now, or this is just flat out a bug.
> > 
> > so, in the name of progress, i like to solict advice on what to do next,
> > before my hacking corrupts the still unbooted lfs filesystem.
> > since i have only one eth0 nic, is it safe to simply ignore the generation
> > of /etc/udev/rules.d/70-persistent-net.rules and move on to chapter 8?
> 
> Yes.
> 
> > won't the single nic be installed as eth0, anyway.
> 
> Yes.
>    -- Bruce
> -- 
> http://linuxfromscratch.org/mailman/listinfo/lfs-support
> FAQ: http://www.linuxfromscratch.org/lfs/faq.html
> Unsubscribe: See the above information page



More information about the lfs-support mailing list