Skip to contentSkip to conversation

If QEMU parameters are extended to emulate additional network interfaces, NFS boot does not work. Based on the ip configuration provided by the runqemu-internal script the kernel is not able to use the right interface for the nfs mount.

PATCH New Adrian 1 participant 1 message Jun 25, 2014

lore
Share & tools
lore

Adrian

author
#0 lore raw

PATCH 1/1 If QEMU parameters are extended to emulate additional network interfaces, NFS boot does not work. Based on the ip configuration provided by the runqemu-internal script the kernel is not able to use the right interface for the nfs mount.

From: Adrian Freihofer <[email protected]>

Example to reproduce:
runqemu ... qemuparams="-net nic,model=virtio... -net tap, ..."

If kernel parameters are extended to get the kernel forced to use eth0 for the nfs rootfs another issue pops up. The script which creates a special config for connman fails. It creates an invalid configuration for connman which ends up in a nfs disconnection again.

[YOCTO #6356]

---
 meta/recipes-connectivity/connman/connman-conf.bb                  | 2 +-
 meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup | 2 +-
 scripts/runqemu-internal                                           | 3 +--
 3 files changed, 3 insertions(+), 4 deletions(-)
meta/recipes-connectivity/connman/connman-conf.bb +1 -1
index af72640..e69cfe3 100644
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=80
 SRC_URI_append_qemuall = "file://wired.config \
                           file://wired-setup \
                          "
-PR = "r2"
+PR = "r3"
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup +1 -1
index c46899e..c7b6dd1 100644
@@ -3,7 +3,7 @@
 CONFIGF=/var/lib/connman/wired.config
 
 # Extract wired network config from /proc/cmdline
-NET_CONF=`cat /proc/cmdline |sed -ne 's/^.*ip=\([^ ]*\):\([^ ]*\):\([^ ]*\):\([^ ]*\).*$/\1\/\4\/\3/p'`
+NET_CONF=`cat /proc/cmdline |sed -ne 's/^.*ip=\([^:]*\):\([^:]*\):\([^:]*\):\([^:]*\).*$/\1\/\4\/\3/p'`
 
 # Check if eth0 is already set via kernel cmdline
 if [ "x$NET_CONF" = "x" ]; then
scripts/runqemu-internal +1 -2
index 38745dd..7f33ee5 100755
@@ -248,8 +248,7 @@ else
         n0=$(echo $TAP | sed 's/tap//')
         n1=$(($n0 * 2 + 1))
         n2=$(($n1 + 1))
-
-        KERNEL_NETWORK_CMD="ip=192.168.7.$n2::192.168.7.$n1:255.255.255.0"
+        KERNEL_NETWORK_CMD="ip=192.168.7.$n2::192.168.7.$n1:255.255.255.0:${MACHINE}:eth0:off"
         QEMU_TAP_CMD="-net tap,vlan=0,ifname=$TAP,script=no,downscript=no"
         if [ "$KVM_ACTIVE" = "yes" ]; then
             QEMU_NETWORK_CMD="-net nic,model=virtio $QEMU_TAP_CMD,vhost=on"
Signature · 1 line
1.9.1