diff mbox series

[V2] qemuboot.bbclass: make nameserver configurable

Message ID 20251212023645.4130495-1-Qi.Chen@windriver.com
State Accepted, archived
Commit 0e8c2582d46dc703511521386d1cc1694ae21e22
Headers show
Series [V2] qemuboot.bbclass: make nameserver configurable | expand

Commit Message

ChenQi Dec. 12, 2025, 2:36 a.m. UTC
From: Chen Qi <Qi.Chen@windriver.com>

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>
---
 meta/classes-recipe/qemuboot.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/qemuboot.bbclass b/meta/classes-recipe/qemuboot.bbclass
index 69cd12ec54..56106b1958 100644
--- a/meta/classes-recipe/qemuboot.bbclass
+++ b/meta/classes-recipe/qemuboot.bbclass
@@ -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 ?= ""