]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
90qemu-net: in hostonly mode, only install if network is needed
authorKairui Song <kasong@redhat.com>
Tue, 20 Oct 2020 08:47:41 +0000 (16:47 +0800)
committerHarald Hoyer <harald@hoyer.xyz>
Fri, 30 Oct 2020 09:13:37 +0000 (10:13 +0100)
Signed-off-by: Kairui Song <kasong@redhat.com>
modules.d/40network/module-setup.sh
modules.d/90qemu-net/module-setup.sh

index 3ba2f1901aed90e5e40e0bbe5f705adf7c0cdd02..af153528055066fe8f4ef10949668fd3d436257f 100755 (executable)
@@ -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
index 0e45a417f78703fc1a9bfb837c28b37dfb697dc1..f188eaa234f4035fbe886fd637751b738b1035f9 100755 (executable)
@@ -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
 }