network: split out kernel-network-modules
[dracut.git] / modules.d / 40network / module-setup.sh
blob4bf93cc6d775a2166f2f2a092016442741fcfca1
1 #!/bin/bash
3 # called by dracut
4 check() {
5 local _program
7 require_binaries ip arping dhclient || return 1
9 return 255
12 # called by dracut
13 depends() {
14 echo "kernel-network-modules"
15 return 0
18 # called by dracut
19 installkernel() {
20 return 0
23 # called by dracut
24 install() {
25 local _arch _i _dir
26 inst_multiple ip arping dhclient sed
27 inst_multiple -o ping ping6
28 inst_multiple -o brctl
29 inst_multiple -o teamd teamdctl teamnl
30 inst_simple /etc/libnl/classid
31 inst_script "$moddir/ifup.sh" "/sbin/ifup"
32 inst_script "$moddir/netroot.sh" "/sbin/netroot"
33 inst_script "$moddir/dhclient-script.sh" "/sbin/dhclient-script"
34 inst_simple "$moddir/net-lib.sh" "/lib/net-lib.sh"
35 inst_simple -H "/etc/dhclient.conf"
36 cat "$moddir/dhclient.conf" >> "${initdir}/etc/dhclient.conf"
37 inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
38 inst_hook pre-udev 60 "$moddir/net-genrules.sh"
39 inst_hook cmdline 91 "$moddir/dhcp-root.sh"
40 inst_hook cmdline 92 "$moddir/parse-ibft.sh"
41 inst_hook cmdline 95 "$moddir/parse-vlan.sh"
42 inst_hook cmdline 96 "$moddir/parse-bond.sh"
43 inst_hook cmdline 96 "$moddir/parse-team.sh"
44 inst_hook cmdline 97 "$moddir/parse-bridge.sh"
45 inst_hook cmdline 98 "$moddir/parse-ip-opts.sh"
46 inst_hook cmdline 99 "$moddir/parse-ifname.sh"
47 inst_hook cleanup 10 "$moddir/kill-dhclient.sh"
49 _arch=$(uname -m)
51 inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \
52 {"tls/$_arch/",tls/,"$_arch/",}"libnss_mdns4_minimal.so.*"
54 dracut_need_initqueue