[OE-core] [PATCH v2] testimage: dont use DNS lookup for qemu based testimages

Stanacar, StefanX stefanx.stanacar at intel.com
Wed Mar 19 12:23:37 UTC 2014




On Tue, 2014-03-18 at 17:31 -0700, Saul Wold wrote:
> Signed-off-by: Saul Wold <sgw at linux.intel.com>
> ---
>  meta/classes/testimage.bbclass | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
> index 691c7f6..ee028e1 100644
> --- a/meta/classes/testimage.bbclass
> +++ b/meta/classes/testimage.bbclass
> @@ -45,6 +45,16 @@ TESTIMAGEDEPENDS_qemuall = "qemu-native:do_populate_sysroot qemu-helper-native:d
>  TESTIMAGELOCK = "${TMPDIR}/testimage.lock"
>  TESTIMAGELOCK_qemuall = ""
>  
> +IMAGE_POSTPROCESS_COMMAND_qemuall += "fix_dns_lookup_for_qemu"
> +

I might be wrong, but this won't have any effect with the default
(manual) way we use testimage. The testimage class isn't in the global
inherit, so that  IMAGE_POSTPROCESS_COMMAND won't run as the image isn't
reconstructed.

The AB does: bitbake core-image-sato on one step and then adds INHERIT
+="testimage" in local.conf in the next step and runs bitbake
core-image-sato -c testimage, no more do_rootfs here.

As it this it will only work with testimage-auto when you have
TEST_IMAGE="1" in local.conf in the first build step so you only need to
do bitbake core-image-sato and do_testimage gets run after do_rootfs,
but we don't use this. And the fix should work for running the task
manually too.

I liked v1, I don't really see what the problem was there. No mattter
the way you run our qemu images, you still have to set a proper DNS, and
have network connectivity in the image (which usually involves the host
too) so defaulting to UseDNS no for qemu images seems a sensible default
to me.

Cheers,
Stefan

> +fix_dns_lookup_for_qemu() {
> +	if [ -e ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config ]; then
> +		sed -i -e 's:#UseDNS yes:UseDNS no:' ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config
> +	fi
> +}
> +
> +EXPORT_FUNCTIONS fix_dns_lookup_for_qemu
> +
>  python do_testimage() {
>      testimage_main(d)
>  }
> -- 
> 1.8.3.1
> 



More information about the Openembedded-core mailing list