From patchwork Wed Jul 3 17:02:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anibal Limon X-Patchwork-Id: 168434 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1149602ilk; Wed, 3 Jul 2019 10:01:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+CErOQfUhQHOgTdHlCgB3OgzqoPmvtit7mdW+vWQSOwxRib8RGmB03PYoWplaWVVnYvnH X-Received: by 2002:a17:90a:35e6:: with SMTP id r93mr14054572pjb.20.1562173316951; Wed, 03 Jul 2019 10:01:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562173316; cv=none; d=google.com; s=arc-20160816; b=L3+e6EiFHHnevT/mH2pm6vj2DChWBpSKJerK/hn4Mh5NzP3SZvwbuxqquewIkN6ack fIfRQ+b7lwOO9SwyEtB5YOw1LgdM6ChBI5Abxf9C/i9af5MtCtR2Zisi2aSG7uyBXv3r loIqtcVz9OEo/zAQsZORCflvWS2Pv/EUzMv4LHyAUAsNZXf3WdJEXamc+97KO/0U8mxF wlfx9m33beQsk9MhzbcIiYIJp9SrIRudSr+qBtOgNPjw+01VsYopU8WvdbZqy+FbXpqL JgIQS10WkX61sYISisVMU35CwsqH0+traD/3DP5DF6VJ+/GotV4uxSlKV1iUO5H46x5S zpJQ== 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=4BRqVgbaAxNfBe39Tm67bXE/7+dRZKqYtDS4i74V4l0=; b=Kd4mAdx/e5VU8b4TfscQkpLTZ2TewY5vU6wFR6yXh9kReLc96vzGWLPOMspqiRCp0h DkrjzJ3C+6RVFNhAjbw/Xiwuulm77641CHvgXAG68wv1QVVUlFiGMa5KEsypowlb04mK 3JQmcBq3S+bXiRm/cEIBH+3EO0SqVwwIN4fi1vXY2dF0Lfn9oaaxp8cpRnS3+pi/YYt+ mIBbcXeQtls6tCWQ2fUoL/HtNa8P4td+P9hxpqlhq6/UAYPxsP4u1LrmuBgI3VtDvN3s RSr0d5lOEtVRB5Gup8/OzpJKvaAzgt9cCTRrmV5K1EoXCY1UDpZIdj8c2p6Cw3A0X6gB l8Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Psswu6Ov; 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 f17si2327758pjq.14.2019.07.03.10.01.56; Wed, 03 Jul 2019 10:01:56 -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=Psswu6Ov; 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 C192A7E951; Wed, 3 Jul 2019 17:01:48 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by mail.openembedded.org (Postfix) with ESMTP id 2C8697E7BF for ; Wed, 3 Jul 2019 17:01:41 +0000 (UTC) Received: by mail-pg1-f194.google.com with SMTP id c13so1555817pgg.3 for ; Wed, 03 Jul 2019 10:01:42 -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=n3Sf3uxt+HVkwYjGYPFKZ+tUCFFCpaw2GHwQqGsPFPs=; b=Psswu6OvPEqGTZAmIgvCyHvyzN9UoagI2dinuvZAyf5WglNFiXeEGUggRb3cqqbmn/ HJYWfnCvjUiRvXEu3CLMis6sWWxjGWyNMozal2wrLR/zvjEkXJH5aIExvo+EoUO9gk/m p+la7UuCwDbAC1XaGHrlbKQcLOFSe7a+DYDiE/Bk/2Kd4uEVWKyNh9S1qiqk9EMQLQ79 nIKM84UDs6JetkIgIagBFX9qNA/OP4IiUkPDnHMjXnfzRDEIIbyi+zSJUyGF5V/dqUkl oshNJwKbwuyOw7UaxEJiCenNb50t0Tqi7c5Cc5R92q7uhr2quQovLNWcNIi9PMIe/aXr FOLw== 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=n3Sf3uxt+HVkwYjGYPFKZ+tUCFFCpaw2GHwQqGsPFPs=; b=RHcJI1QF7qvpJbnlmd0q77hE+rRTKbJUhNpHHCMpbx2EMhC35mSfDw8s3xbk57BUUM up2VUBAsQOAn0yX2qWn8e/fChnrpag1pvfR+Tpe1eyKPRn0QeoVdo0chWymyePP89h6Y qigtsIV377/tEH0dALBcDdVuTx43psKS3yNfoGxJ7DuJhcZQIFuc3shZsxveOoCvmjyr nLzgZE6K0/CvKv44XjFssSrAthgzpUymYlR49Nase4jEYGTkB0T5Te8LQybrOGHql3m1 lWAv2zysZ8be8ivSj4Bwt7K7iYFdy4uYxD1XgCinkZWoVqwgYkYhKka3+BLz0cgB5lfV +Rcw== X-Gm-Message-State: APjAAAXf/qfdS40++PU+yRRV3I0e5AuZIZoxLReH8kDhWcsDUdFH9xAr ZIqlvR8qk4WekhSzlVZBIEyQ0Pu9LLEHLw== X-Received: by 2002:a17:90a:a410:: with SMTP id y16mr14094019pjp.62.1562173302220; Wed, 03 Jul 2019 10:01:42 -0700 (PDT) Received: from blackbox.Home ([200.68.141.206]) by smtp.gmail.com with ESMTPSA id o16sm8417666pgi.36.2019.07.03.10.01.40 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 03 Jul 2019 10:01:41 -0700 (PDT) From: =?utf-8?b?QW7DrWJhbCBMaW3Ds24=?= To: openembedded-core@lists.openembedded.org Date: Wed, 3 Jul 2019 12:02:23 -0500 Message-Id: <20190703170223.6228-3-anibal.limon@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190703170223.6228-1-anibal.limon@linaro.org> References: <20190703170223.6228-1-anibal.limon@linaro.org> MIME-Version: 1.0 Subject: [OE-core] [PATCHv4 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 | 24 +++++++++++++----------- 2 files changed, 16 insertions(+), 11 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 0134f86b4c..10f7296c91 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -1069,17 +1069,19 @@ class BaseConfig(object): gateway = tapnum * 2 + 1 client = gateway + 1 - # XXX: Linux qemuarm and qemuppc dosen't configure the interface - # if device is specified in ip (ethN), so if only one tap device is - # requested don't specify ethN. - if tap_no == 1: - netconf = "192.168.7.%s::192.168.7.%s:255.255.255.0" % (client, gateway) - logger.info("Network configuration: %s", netconf) - self.kernel_cmdline_script += " ip=%s" % netconf - elif 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': + # XXX: Linux qemuarm and qemuppc dosen't configure the interface + # if device is specified in ip (ethN), so if only one tap device is + # requested don't specify ethN. + if tap_no == 1: + netconf = "192.168.7.%s::192.168.7.%s:255.255.255.0" % (client, gateway) + logger.info("Network configuration: %s", netconf) + self.kernel_cmdline_script += " ip=%s" % netconf + elif 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)