| Summary: | run QEMU nfs with multiple NICs | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Adrian <adrian.freihofer> |
| Component: | core | Assignee: | Adrian <adrian.freihofer> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | Medium | CC: | meta.mr.watcher, meta.watcher, poky.bs.watcher, poky.watcher, ross.burton, sgw |
| Version: | 1.6 | ||
| Target Milestone: | Future | ||
| Hardware: | All | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |
This seems to be a resasonable fix, can you please submit a proper patch to the oe-core mailing list. Thanks Seems that while it looked reasonable it did not work as expected. I am going to assign this to you to continue with, you can try the sanity testing locally by setting IMAGETEST in local.conf (please look at local.conf for details). Thanks for submitting the patch! Thank you for testing my patch. It looks like the image lost access to the nfsroot export. When I ran the test suite against current sato image with qemu emulating just one NIC everything worked fine. I would expect this (https://autobuilder.yoctoproject.org/main/builders/nightly-ipk/builds/94/steps/Running%20Sanity%20Tests_1/logs/stdio) behavior if a second NIC had been provided by qemu. But I cannot see this part of the configuration in the log file... If qemu parameters are extended to emulate more than one NIC there is a second problem which needs to be solved. But one by one... The current poky script defines: KERNEL_NETWORK_CMD="ip=192.168.7.$n2::192.168.7.$n1:255.255.255.0" From https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>:<dns0-ip>:<dns1-ip> <device> Name of network device to use. Default: If the host only has one device, it is used. Otherwise the device is determined using autoconfiguration. This is done by sending autoconfiguration requests out of all devices, and using the device that received the first reply. Conclusion: The behavior of the current poky script is undefined for qemu configurations emulationg more than one NIC. This is solved by the proposed patch. But the hassle starts when qemu parameters are extendend by a second NIC. Then connman cuts the nfs connection. Basically I consider this as a connman problem. A network manager should not touch a network interface configuration which is used to boot from nfs. I guess the right solution would be to handle this corner case in connman. However this is another story. The workaraound which solved the problem for me is a patch for the connman service file. This simply makes connman ignoring the first NIC: -ExecStart=@prefix@/sbin/connmand -n +ExecStart=@prefix@/sbin/connmand -n -I eth0 Of course, this is not a general solution. Regards, Adrian The patch http://patchwork.openembedded.org/patch/74397/ solves the issue. Enabling IMAGETEST in local.conf is now possible. The root cause for the broken image test was an invalid regular expression in connman/wired.config. The patch is very simple, but probably it needs to be rebased. I will rebase it when I upgrade my current project to poky 1.7 branch. The latest set of patches broke on the autobuilder. If you're still interested in seeing this merged please rebase your patches to master, retest, and submit. Resolved by re-implementation of runqemu in python. |
Problem: If QEMU parameters are extended to emulate additional network interfaces, NFS boot does not work. There is a simple kernel parameter extension needed to solve this issue. Example to reproduce: runqemu ... qemuparams="-net nic,model=virtio... -net tap, ..." Solution: Extend kernel parameters by "::eth0:on" Here is a patch for the file scripts/runqemu-internal. @@ -249,7 +249,7 @@ else 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::eth0:on" 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"