summaryrefslogtreecommitdiffstats
path: root/modules.d/40network/module-setup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'modules.d/40network/module-setup.sh')
-rwxr-xr-xmodules.d/40network/module-setup.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh
new file mode 100755
index 0000000..4c77ff3
--- /dev/null
+++ b/modules.d/40network/module-setup.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+# called by dracut
+check() {
+ return 255
+}
+
+# called by dracut
+depends() {
+ is_qemu_virtualized && echo -n "qemu-net "
+
+ for module in connman network-manager network-legacy systemd-networkd; do
+ if dracut_module_included "$module"; then
+ network_handler="$module"
+ break
+ fi
+ done
+
+ if [ -z "$network_handler" ]; then
+ if check_module "connman"; then
+ network_handler="connman"
+ elif check_module "network-manager"; then
+ network_handler="network-manager"
+ elif check_module "systemd-networkd"; then
+ network_handler="systemd-networkd"
+ else
+ network_handler="network-legacy"
+ fi
+ fi
+ echo "kernel-network-modules $network_handler"
+ return 0
+}
+
+# called by dracut
+installkernel() {
+ return 0
+}
+
+# called by dracut
+install() {
+ inst_script "$moddir/netroot.sh" "/sbin/netroot"
+ inst_simple "$moddir/net-lib.sh" "/lib/net-lib.sh"
+ inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
+ inst_hook cmdline 91 "$moddir/dhcp-root.sh"
+ inst_multiple ip sed awk grep pgrep tr
+ inst_multiple -o arping arping2
+ dracut_need_initqueue
+}