]>
git.ipfire.org Git - thirdparty/dracut.git/blob - modules.d/40network/net-genrules.sh
3 # pxelinux provides macaddr '-' separated, but we need ':'
7 macaddr
=$
(for i
in ${macaddr} ; do echo -n $i:; done)
12 # Don't continue if we don't need network
13 [ -z "$netroot" ] && return;
17 # bridge: attempt only the defined interface
18 if [ -e /tmp
/bridge.info
]; then
23 # BOOTIF says everything, use only that one
24 BOOTIF
=$
(getarg
'BOOTIF=')
25 if [ -n "$BOOTIF" ] ; then
26 BOOTIF
=$
(fix_bootif
"$BOOTIF")
27 printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/ifup $env{INTERFACE}"\n' "$BOOTIF"
29 # If we have to handle multiple interfaces, handle only them.
30 elif [ -n "$IFACES" ] ; then
31 for iface
in $IFACES ; do
32 printf 'ACTION=="add", SUBSYSTEM=="net", KERNEL=="%s", RUN+="/sbin/ifup $env{INTERFACE}"\n' "$iface"
35 # Default: We don't know the interface to use, handle all
37 printf 'ACTION=="add", SUBSYSTEM=="net", RUN+="/sbin/ifup $env{INTERFACE}"\n'
40 # Udev event 'online' only gets fired from ifup/dhclient-script.
41 # No special rules required
42 printf 'ACTION=="online", SUBSYSTEM=="net", RUN+="/sbin/netroot $env{INTERFACE}"\n'
43 } > /etc
/udev
/rules.d
/60-net.rules