Bryan Kadzban wrote:
> Bruce Dubbs wrote:
>> Armin K. wrote:
>>> Bruce, some guy came on the irc saying that network rules creation
>>> does not work in systemd extracted udev.
>>>
>>> <Zenther> working my way through the cvs book and get to 7.2.1.
>>> Creating stable names for network interfaces and I am getting a
>>> cat: /etc/udev/rules.d/70-persistent-net.rules: No such file or
>>> directory. Above that I see it list out my eth0 and wlan0.
>>>
>>> Can you check and/or confirm that?
>>
>>
>> I can confirm that in chroot.  I think he is referring to section
>> 7.5. That needs to be changed.  The 'udevadm test' command no longer
>> runs aux programs, e.g. /lib/udev/write_net_rules.
>>
>> However, the first time the system is booted, udevd will run the
>> rules and the 70-persistent-net.rules file will be written at that
>> time.

> Well, they finally killed it.

Yes, but we can fix that.  In the udev-lfs tarball we have the needed files:

write_net_rules
rule_generator.functions

We need to change two places in rule_generator.functions where it has
RUNDIR=$(udevadm info --run) with a constant RUNDIR=/run/udev

Then in section 7.2 (inside chroot), we need to do a couple of things:

cd ~
mkdir -p /run/udev

cat set_persistent_net_rules.sh  << EOF
#! /bin/bash

for NIC in /sys/class/net/eth* ; do
    IF=${NIC##*/}
    if [ "$IF" == "eth*" ]; then break; fi

    export INTERFACE="$IF"
    export MATCHADDR="$(cat $NIC/address)"
    export MATCHDEVID="$(cat $NIC/dev_id)"
    export MATCHIFTYPE="$(cat $NIC/type)"
    /lib/udev/write_net_rules
done
EOF

bash set_persistent_net_rules.sh
rm -rf /run/udev

We need to be careful that someone doesn't remove /run/udev after 
booting or outside of chroot.

   -- Bruce
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to