From: Kairui Song Date: Tue, 20 Oct 2020 08:47:41 +0000 (+0800) Subject: 90qemu-net: in hostonly mode, only install if network is needed X-Git-Tag: 051~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5698258d3022dd73045e2ffb279c799a70c3fef9;p=thirdparty%2Fdracut.git 90qemu-net: in hostonly mode, only install if network is needed Signed-off-by: Kairui Song --- diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh index 3ba2f1901..af1535280 100755 --- a/modules.d/40network/module-setup.sh +++ b/modules.d/40network/module-setup.sh @@ -8,6 +8,9 @@ check() { # called by dracut depends() { echo -n "kernel-network-modules " + + is_qemu_virtualized && echo -n "qemu-net " + if ! dracut_module_included "network-legacy" && [ -x "$dracutsysrootdir/usr/libexec/nm-initrd-generator" ] ; then echo "network-manager" else diff --git a/modules.d/90qemu-net/module-setup.sh b/modules.d/90qemu-net/module-setup.sh index 0e45a417f..f188eaa23 100755 --- a/modules.d/90qemu-net/module-setup.sh +++ b/modules.d/90qemu-net/module-setup.sh @@ -2,10 +2,15 @@ # called by dracut check() { - if [[ $hostonly ]] || [[ $mount_needs ]]; then + if [[ $hostonly ]]; then + return 255 + fi + + if [[ $mount_needs ]]; then is_qemu_virtualized && return 0 return 255 fi + return 0 }