]> git.ipfire.org Git - thirdparty/dracut.git/blob - modules.d/40network/module-setup.sh
fix(zfcp_rules): correct shellcheck regression when parsing ccw args
[thirdparty/dracut.git] / modules.d / 40network / module-setup.sh
1 #!/bin/bash
2
3 # called by dracut
4 check() {
5 return 255
6 }
7
8 # called by dracut
9 depends() {
10 is_qemu_virtualized && echo -n "qemu-net "
11
12 for module in connman network-manager network-legacy systemd-networkd; do
13 if dracut_module_included "$module"; then
14 network_handler="$module"
15 break
16 fi
17 done
18
19 if [ -z "$network_handler" ]; then
20 if check_module "connman"; then
21 network_handler="connman"
22 elif check_module "network-manager"; then
23 network_handler="network-manager"
24 elif check_module "systemd-networkd"; then
25 network_handler="systemd-networkd"
26 else
27 network_handler="network-legacy"
28 fi
29 fi
30 echo "kernel-network-modules $network_handler"
31 return 0
32 }
33
34 # called by dracut
35 installkernel() {
36 return 0
37 }
38
39 # called by dracut
40 install() {
41 inst_script "$moddir/netroot.sh" "/sbin/netroot"
42 inst_simple "$moddir/net-lib.sh" "/lib/net-lib.sh"
43 inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
44 inst_hook cmdline 91 "$moddir/dhcp-root.sh"
45 inst_multiple ip sed awk grep pgrep tr
46 inst_multiple -o arping arping2
47 dracut_need_initqueue
48 }