]> code.ossystems Code Review - openembedded-core.git/commitdiff
qemuboot/runqemu: fully form the ip= kernel parameter
authorAlexander Kanavin <alex.kanavin@gmail.com>
Sun, 9 Jan 2022 22:27:29 +0000 (23:27 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 11 Jan 2022 10:50:22 +0000 (10:50 +0000)
New systemd is actually parsing this in systemd-network-generator
and fails if it is not fully formed. 'off' means 'static ip, do nothing':
https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/qemuboot.bbclass
meta/lib/oeqa/utils/qemurunner.py
scripts/runqemu

index 95cd1d6c4ad6f4632adeade90ed8bc5620460089..cc1cbce69d14fff538e2b28aa5e3c3d91b723a4f 100644 (file)
@@ -93,7 +93,7 @@ QB_RNG ?= "-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-p
 QB_OPT_APPEND ?= ""
 QB_NETWORK_DEVICE ?= "-device virtio-net-pci,netdev=net0,mac=@MAC@"
 QB_CMDLINE_IP_SLIRP ?= "ip=dhcp"
-QB_CMDLINE_IP_TAP ?= "ip=192.168.7.@CLIENT@::192.168.7.@GATEWAY@:255.255.255.0"
+QB_CMDLINE_IP_TAP ?= "ip=192.168.7.@CLIENT@::192.168.7.@GATEWAY@:255.255.255.0::eth0:off:8.8.8.8"
 QB_ROOTFS_EXTRA_OPT ?= ""
 QB_GRAPHICS ?= ""
 
index 03971480825b3e9ec805980b6d77ee41f9e4b493..76296d50cde472138250cee439fae0ad358310d7 100644 (file)
@@ -407,7 +407,7 @@ class QemuRunner:
                 self.logger.debug("qemu cmdline used:\n{}".format(cmdline))
             except (IndexError, ValueError):
                 # Try to get network configuration from runqemu output
-                match = re.match(r'.*Network configuration: (?:ip=)*([0-9.]+)::([0-9.]+):([0-9.]+)$.*',
+                match = re.match(r'.*Network configuration: (?:ip=)*([0-9.]+)::([0-9.]+):([0-9.]+).*',
                                  out, re.MULTILINE|re.DOTALL)
                 if match:
                     self.ip, self.server_ip, self.netmask = match.groups()
index d49f128fe47fa68f598f3099af56941183758b73..4e05c1bb15ba1a3ec6ddfb4aec8c6b011cf979f1 100755 (executable)
@@ -199,7 +199,7 @@ class BaseConfig(object):
         self.fsinfo = {}
         self.network_device = "-device e1000,netdev=net0,mac=@MAC@"
         self.cmdline_ip_slirp = "ip=dhcp"
-        self.cmdline_ip_tap = "ip=192.168.7.@CLIENT@::192.168.7.@GATEWAY@:255.255.255.0"
+        self.cmdline_ip_tap = "ip=192.168.7.@CLIENT@::192.168.7.@GATEWAY@:255.255.255.0::eth0:off:8.8.8.8"
         # Use different mac section for tap and slirp to avoid
         # conflicts, e.g., when one is running with tap, the other is
         # running with slirp.