2 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3 # ex: ts=8 sw=4 sts=4 et filetype=sh
9 for _program in ip arping dhclient ; do
10 if ! type -P $_program >/dev/null; then
11 derror "Could not find program \"$_program\" required by network."
20 [ -d /etc/sysconfig/network-scripts/ ] && echo ifcfg
25 # Include wired net drivers, excluding wireless
28 local _net_drivers='eth_type_trans|register_virtio_device'
29 local _unwanted_drivers='/(wireless|isdn|uwb)/'
30 # subfunctions inherit following FDs
31 local _merge=8 _side2=9
35 [[ $_fname =~ $_unwanted_drivers ]] && continue
37 *.ko) _fcont="$(< $_fname)" ;;
38 *.ko.gz) _fcont="$(gzip -dc $_fname)" ;;
39 *.ko.xz) _fcont="$(xz -dc $_fname)" ;;
41 [[ $_fcont =~ $_net_drivers
42 && ! $_fcont =~ iw_handler_get_spy ]] \
51 echo "$_f2" 1>&${_side2}
53 done | nmf1 1>&${_merge}
55 # Use two parallel streams to filter alternating modules.
57 eval "( ( rotor ) ${_side2}>&1 | nmf1 ) ${_merge}>&1"
58 [[ $debug ]] && set -x
61 { find_kernel_modules_by_path drivers/net; find_kernel_modules_by_path drivers/s390/net; } \
62 | net_module_filter | instmods
66 instmods bridge stp llc
74 dracut_install ip arping tr dhclient
75 dracut_install -o brctl ifenslave
76 inst "$moddir/ifup" "/sbin/ifup"
77 inst "$moddir/netroot" "/sbin/netroot"
78 inst "$moddir/dhclient-script" "/sbin/dhclient-script"
79 inst "$moddir/net-lib.sh" "/lib/net-lib.sh"
80 inst_simple "$moddir/dhclient.conf" "/etc/dhclient.conf"
81 inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
82 inst_hook pre-udev 60 "$moddir/net-genrules.sh"
83 inst_hook cmdline 91 "$moddir/dhcp-root.sh"
84 inst_hook cmdline 96 "$moddir/parse-bond.sh"
85 inst_hook cmdline 97 "$moddir/parse-bridge.sh"
86 inst_hook cmdline 98 "$moddir/parse-ip-opts.sh"
87 inst_hook cmdline 99 "$moddir/parse-ifname.sh"
88 inst_hook pre-pivot 10 "$moddir/kill-dhclient.sh"
92 for _dir in "$usrlibdir/tls/$_arch" "$usrlibdir/tls" "$usrlibdir/$_arch" \
93 "$usrlibdir" "$libdir"; do
94 for _i in "$_dir"/libnss_dns.so.* "$_dir"/libnss_mdns4_minimal.so.*; do
95 [ -e "$_i" ] && dracut_install "$_i"