From patchwork Mon Jul 1 21:18:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anibal Limon X-Patchwork-Id: 168227 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp3393634ilk; Mon, 1 Jul 2019 14:18:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqytrMoYubidqMXpcXCsqWkoT6SZ7qyhxHMz3iV8ThA9Cuo2oB15Nhrs53XUrN4Hb6p08ssd X-Received: by 2002:a65:4cc4:: with SMTP id n4mr27746218pgt.307.1562015917067; Mon, 01 Jul 2019 14:18:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562015917; cv=none; d=google.com; s=arc-20160816; b=r+1UDnOCYJ0oFLQTHAxSq1EiZbTCtwa1JJquPWTYnOz2oYV1GYQjERDmWQ0cCG6LGO WJocwaK2Osrz1c29yERj00tP3x7BAuiO5ZTUkPE5GxVqKwzxq35zcZSNIGlz34FV+Bb1 uENLMqEqPpYRg3NCb7HCCDsU0ezGInGsG1HLf/mTL7sTBMdowpr+dKCZnyRdJShYITnD 500TZoVadW8GCBBvQChaOJDR5jd9BuCfQ7BXGHEEnoiwPSkmtQD6mIA0B6fDQhW4P8Th jGUPTIWjv1XlXiq0hJwQwlsCeQggBlUAAYukI314QXY0yWuePCZirVNVvjKueiHm4MUq jCPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:delivered-to; bh=duafR+Dv7Am+srn7or0D5JQwxlhsOG+M0bDJHcwPgAc=; b=e4rIEL/+yvGI/Y3qsuJn1gQ2JUqRtW11tX3LNWWxHgRGE+a+ezf+k13CulEgDGREs0 DVW0c2cuY/v3blEMyE2o+t1BG1CHGLFS89thgq3ZazTj26ezeCsxVMhhHOom+pSfAl+F xhi4fOSIwfAbenXTw5LISiOKnWJMWFig26illR776ysAMEoD8SFdTv6jMu/85AIk4CZJ rSCQ6cs3lHudBIbs0uEQg6fZHrmH1o/M+u0yo37BfDNMmu3IhTOvmrJQD3/Mwaqk3d3r N71ktBq1RlqXf8TQLTrP80jsoDdAUjwtZGzHYk9EpbV7R9ZMe3SgN+5aeJiGb0b9gdyZ iEPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KDMd+lcI; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id m11si8049778pfa.0.2019.07.01.14.18.36; Mon, 01 Jul 2019 14:18:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KDMd+lcI; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from ec2-34-214-78-129.us-west-2.compute.amazonaws.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id CF1537E7DE; Mon, 1 Jul 2019 21:18:32 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-oi1-f194.google.com (mail-oi1-f194.google.com [209.85.167.194]) by mail.openembedded.org (Postfix) with ESMTP id 0E9657E7BE for ; Mon, 1 Jul 2019 21:18:09 +0000 (UTC) Received: by mail-oi1-f194.google.com with SMTP id l12so11203122oil.1 for ; Mon, 01 Jul 2019 14:18:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sX3n5OlVTOC3e0EaTaApoiad6WeJorg8GqqVIIebXIo=; b=KDMd+lcIHBJEpqsKHr64p21kT9To9GfB1nO8ecRWpeMXUDUSf+gGGudCyVcsDevFM3 qTMcoHhwER5SucqylTfSlpF9LGyBJCCW5K7/N05zTAalBD5SnHWzGq5RNHsAVRkurloj xkLJiAQ/aFLWd3h3TjA41zE+f2I3pJOQdV+Cp/+iYBp9il8fF2kq4BZbWa4AhP53L/a8 +00Ygg4wx5yoWZ0Z3z4pYT8sXCSmoknrKhsqnWjh66ZMhovAyi7T1zsY0z+iNH8jIqW/ o6kR2x6Za75lbR3/hWfXsecnjY1wzXyKCzb/466LuWTAgzHZU8Oqm2DWP2lN1954kOrM KE/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sX3n5OlVTOC3e0EaTaApoiad6WeJorg8GqqVIIebXIo=; b=X0faSsbriZ68THduohoGomQArqv0nbajfcHDnIJgkOXB/gW8+z8klU4z5vA0U7aOF4 Vvi+4XqNWiLcnQf2IA4LB28tYLFk0Rtt+TWJd8FEajfHIQ49JATwd/ma96ufy8VzL+hm m6zNL04Bx4DQPcilK7MrTmvyRZbdMs/QChrshfjVWwYe9od8RoF5voLtDWB85k9vQi5u bovKxluofN/+fxE8JvXhyrtY28eHWkob/s6b24eixfMzH9Q7XARBZaGoDJ2bu1/A4ARN JXllU/VszMii5XZE/O1L/vZhPBp4CGWgCaD5HGglOvjXWZMnxmYF5H9tJWR0KK01Gz4/ wQ9g== X-Gm-Message-State: APjAAAUbK/lbJhNl0eWxkvAqbEgSwvaUmxW7UdpHw+BR4Io6Gie2RzoY rMDfgH16jnwSIkntrN2gwkG6yJqw0Co= X-Received: by 2002:aca:4c16:: with SMTP id z22mr905917oia.57.1562015890839; Mon, 01 Jul 2019 14:18:10 -0700 (PDT) Received: from blackbox.Home ([200.68.140.5]) by smtp.gmail.com with ESMTPSA id l15sm4460040otr.38.2019.07.01.14.18.09 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 01 Jul 2019 14:18:10 -0700 (PDT) From: =?utf-8?b?QW7DrWJhbCBMaW3Ds24=?= To: openembedded-core@lists.openembedded.org Date: Mon, 1 Jul 2019 16:18:49 -0500 Message-Id: <20190701211849.31989-3-anibal.limon@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190701211849.31989-1-anibal.limon@linaro.org> References: <20190701211849.31989-1-anibal.limon@linaro.org> MIME-Version: 1.0 Subject: [OE-core] [PATCHv2 3/3] runqemu: Add QB_KERNEL_NO_NETWORK_CONFIG variable X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org To let user choice if wants to have network configured via Kernel cmdline. Signed-off-by: Aníbal Limón --- meta/classes/qemuboot.bbclass | 3 +++ scripts/runqemu | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/meta/classes/qemuboot.bbclass b/meta/classes/qemuboot.bbclass index 15a9e63f2b..5df63a6a61 100644 --- a/meta/classes/qemuboot.bbclass +++ b/meta/classes/qemuboot.bbclass @@ -41,6 +41,8 @@ # "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no" # Note, runqemu will replace "@TAP@" with the one which is used, such as tap0, tap1 ... # +# QB_KERNEL_NO_NETWORK_CONFIG: disable auto network configuration via kernel cmdline possible values 'True' and 'False' +# # QB_SLIRP_OPT: network option for SLIRP mode, e.g., -netdev user,id=net0" # # QB_ROOTFS_OPT: used as rootfs, e.g., @@ -63,6 +65,7 @@ QB_DEFAULT_KERNEL ?= "${KERNEL_IMAGETYPE}" QB_DEFAULT_FSTYPE ?= "ext4" QB_OPT_APPEND ?= "-show-cursor" QB_NETWORK_DEVICE ?= "-device virtio-net-pci,netdev=net0,mac=@MAC@" +QB_KERNEL_NO_NETWORK_CONFIG ?= "False" # This should be kept align with ROOT_VM QB_DRIVE_TYPE ?= "/dev/sd" diff --git a/scripts/runqemu b/scripts/runqemu index 2f318e114d..ec61edfc46 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -1069,10 +1069,12 @@ class BaseConfig(object): gateway = tapnum * 2 + 1 client = gateway + 1 - if tap_idx == 0: - netconf = "192.168.7.%s::192.168.7.%s:255.255.255.0::eth%d" % (client, gateway, tap_idx) - logger.info("Network configuration: %s", netconf) - self.kernel_cmdline_script += " ip=%s" % netconf + no_network = self.get('QB_KERNEL_NO_NETWORK_CONFIG') + if no_network and not no_network.lower() == 'true': + if tap_idx == 0: + netconf = "192.168.7.%s::192.168.7.%s:255.255.255.0::eth%d" % (client, gateway, tap_idx) + logger.info("Network configuration: %s", netconf) + self.kernel_cmdline_script += " ip=%s" % netconf mac = "%s%02x" % (self.mac_tap, client) qemu_tap_opt = qemu_tap_opt.replace('@TAP@', tap, 1)