]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
qemuboot.bbclass: make nameserver configurable
authorChen Qi <Qi.Chen@windriver.com>
Fri, 12 Dec 2025 02:36:45 +0000 (10:36 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 15 Dec 2025 18:00:31 +0000 (18:00 +0000)
Instead of hardcoding '8.8.8.8' for tap interface, we introduce
QB_TAP_NAMESERVER to allow nameserver to be configured.

This helps improve runqemu user experience because users can easily
configure their nameservers to access the networks they want. Note
that this method does not change the contents of the rootfs.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/qemuboot.bbclass

index 69cd12ec5456f90561c88557cc4e7680a7c5a000..56106b1958100d030510fbef7348332cf683d1da 100644 (file)
@@ -106,7 +106,9 @@ QB_NETWORK_DEVICE ?= "-device virtio-net-pci,netdev=net0,mac=@MAC@"
 #
 QB_NO_PNI ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pni-names', '', 'net.ifnames=0', d)}"
 QB_CMDLINE_IP_SLIRP ?= "ip=dhcp"
-QB_CMDLINE_IP_TAP ?= "ip=192.168.7.@CLIENT@::192.168.7.@GATEWAY@:255.255.255.0::eth0:off:8.8.8.8 ${QB_NO_PNI}"
+# 8.8.8.8 is Google Public DNS: https://en.wikipedia.org/wiki/Google_Public_DNS
+QB_TAP_NAMESERVER ?= "8.8.8.8"
+QB_CMDLINE_IP_TAP ?= "ip=192.168.7.@CLIENT@::192.168.7.@GATEWAY@:255.255.255.0::eth0:off:${QB_TAP_NAMESERVER} ${QB_NO_PNI}"
 
 QB_ROOTFS_EXTRA_OPT ?= ""
 QB_GRAPHICS ?= ""