dracut/0208-no_forced_virtnet.patch
Thomas Renninger 622599ad03 Accepting request 359888 from home:dr-yak:branches:Base:System
missing "return 0" statement that breaks building of initrd on installation not running inside qemu.

See bugzilla #965477

OBS-URL: https://build.opensuse.org/request/show/359888
OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=253
2016-02-17 10:36:25 +00:00

88 lines
2.6 KiB
Diff

From: Fabian Vogt <fvogt@suse.com>
Subject: Don't include qemu network modules without reason
virtio-net without other network tools does not make sense
and causes various bugs, like bsc#960669.
This patch merges 90qemu-net into 90-kernel-network-modules.
---
modules.d/90kernel-network-modules/module-setup.sh | 24 ++++++++++++++++++++-
modules.d/90qemu-net/module-setup.sh | 1
2 files changed, 24 insertions(+), 1 deletion(-)
Index: dracut-044/modules.d/90kernel-network-modules/module-setup.sh
===================================================================
--- dracut-044.orig/modules.d/90kernel-network-modules/module-setup.sh
+++ dracut-044/modules.d/90kernel-network-modules/module-setup.sh
@@ -10,6 +10,25 @@ depends() {
return 0
}
+running_in_qemu() {
+ if type -P systemd-detect-virt >/dev/null 2>&1; then
+ vm=$(systemd-detect-virt --vm 2>&1)
+ (($? != 0)) && return 255
+ [[ $vm = "qemu" ]] && return 0
+ [[ $vm = "kvm" ]] && return 0
+ [[ $vm = "bochs" ]] && return 0
+ fi
+
+ for i in /sys/class/dmi/id/*_vendor; do
+ [[ -f $i ]] || continue
+ read vendor < $i
+ [[ "$vendor" == "QEMU" ]] && return 0
+ [[ "$vendor" == "Bochs" ]] && return 0
+ done
+
+ return 255
+}
+
# called by dracut
installkernel() {
# Include wired net drivers, excluding wireless
@@ -63,6 +82,12 @@ installkernel() {
=drivers/net/ethernet \
ecb arc4 bridge stp llc ipv6 bonding 8021q af_packet virtio_net xennet
hostonly="" instmods iscsi_ibft crc32c iscsi_boot_sysfs
+
+ if running_in_qemu; then
+ hostonly='' instmods virtio_net e1000 8139cp pcnet32 e100 ne2k_pci
+ else
+ return 0
+ fi
}
# called by dracut
Index: dracut-044/modules.d/90qemu-net/module-setup.sh
===================================================================
--- dracut-044.orig/modules.d/90qemu-net/module-setup.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-
-# called by dracut
-check() {
- if type -P systemd-detect-virt >/dev/null 2>&1; then
- vm=$(systemd-detect-virt --vm >/dev/null 2>&1)
- (($? != 0)) && return 255
- [[ $vm = "qemu" ]] && return 0
- [[ $vm = "kvm" ]] && return 0
- [[ $vm = "bochs" ]] && return 0
- fi
-
- for i in /sys/class/dmi/id/*_vendor; do
- [[ -f $i ]] || continue
- read vendor < $i
- [[ "$vendor" == "QEMU" ]] && return 0
- [[ "$vendor" == "Bochs" ]] && return 0
- done
-
- return 255
-}
-
-# called by dracut
-installkernel() {
- # qemu specific modules
- hostonly='' instmods virtio_net e1000 8139cp pcnet32 e100 ne2k_pci
-}