diff options
authorSaul Wold <>2014-03-31 10:37:38 -0700
committerRichard Purdie <>2014-04-01 10:52:09 +0100
commitc93eeecb15c4acac9226a3394c93d7e99a809d6b (patch)
parent90dc31c24adfa8e916a9c475ae1afc58ad179dfb (diff)
image.bbclass: add function to disable SSH DNS Lookup for Qemu
This function disables the reverse DNS lookup on QEMU targets to reduce the delay when using static IP address. By disabling DNS lookup we can save a great deal of time during automated testing on the autobuilder (on the order of ~400 seconds per ssh tranaction). This is seen when using the testimage, there is a delay getting logged-in from the server to target. It's enabled for all qemu imgaes by default and can be overridden by setting the SSH_DISABLE_DNS_LOOKUP variable. [YOCTO #5954] Signed-off-by: Saul Wold <> Signed-off-by: Richard Purdie <>
1 files changed, 10 insertions, 0 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 29309f55cb..ea035fe144 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -304,6 +304,16 @@ ssh_allow_empty_password () {
+# Disable DNS lookups, the SSH_DISABLE_DNS_LOOKUP can be overridden to allow
+# distros to choose not to take this change
+SSH_DISABLE_DNS_LOOKUP ?= " ssh_disable_dns_lookup ; "
+ssh_disable_dns_lookup () {
+ if [ -e ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config ]; then
+ sed -i -e 's:#UseDNS yes:UseDNS no:' ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config
+ fi
# Enable postinst logging if debug-tweaks is enabled
postinst_enable_logging () {
mkdir -p ${IMAGE_ROOTFS}${sysconfdir}/default