70-persistent-net.rules not created

Bruce Dubbs bruce.dubbs at gmail.com
Tue Jan 12 10:57:25 PST 2010


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:

$ 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



More information about the lfs-support mailing list