From patchwork Fri Jun 28 03:38:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anibal Limon X-Patchwork-Id: 168000 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp3157188ilk; Thu, 27 Jun 2019 20:38:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqw067WOfh3pUniDQnBtg4yTsroTAdVCkaeAPjFKTBZTjL1NuYMIUYNsdnTddFBZStsZ3zVx X-Received: by 2002:a17:90a:3210:: with SMTP id k16mr9979178pjb.13.1561693092829; Thu, 27 Jun 2019 20:38:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561693092; cv=none; d=google.com; s=arc-20160816; b=cS54t/PXec1oHZRCNF5r/Vbhi3uxf0he5XPc7+6PVjXBNyIxW8KJ6YqbtofROGqcXt LB/cLmGiK7XqAaSy1L11ZinZJYRxt4UkgcY8QClEfjeZgEnJRHqkFnIxwMMjNW3cFsFy a6en2P0r3XP87NUcBWMiGCmn4rURMJKNYHbmmbP0BwJzsr5Ouz5hlvS4PgydlBPQ5CVN 6WERWgUULEvsPsF4nE/kOWf6f2+KJHicyePqUVPebJ2V5u4sNiMjt5ZnMS5poULbqwwu 0JRYbEGybrhKxYhUHpne0BrEFjVd5uUTiBrA4CZxQs1CTqPLVK9UA17mMk0rbH3g4vP5 OuRA== 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=gruW3mu96HU1dEsl4zE8oAYAkWgs+kYpA22/xVRJib0=; b=YVSHCEQakdGoc3munUGU2Gy0wnz9F0AC1OFygCjDdQn7eU56AExgCnaUyjPFWCaBVy 71BQDV4UKhKmfCZfdqp64SBBMxf2tNqRhr8dBCIqW5tcMRLHD6HE0XmIQcpSbvAhy3AX WqQ44pqsMyL/Gqm67RR+QXZIpRlVmdPLWGozZFrZzzO1fLV0y/ycrQYEiosuJrFNlzMY b8QzQPz8m5eriZ7B6cTersBwbjaArZVeiULNWAt3tZFZSviCbZ+30B0sKuZlSF7uLdpF huA3JqS/i864HaBd2ozSVPFcDhK7okKnyDKBFbLhum362x/6JCN12yCDRiLvAWoMo9D1 LHog== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=EMOFORpN; 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 h13si906338pgp.296.2019.06.27.20.38.12; Thu, 27 Jun 2019 20:38:12 -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=EMOFORpN; 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 6A6727EA6D; Fri, 28 Jun 2019 03:38:04 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by mail.openembedded.org (Postfix) with ESMTP id 0DF4C7EA5F for ; Fri, 28 Jun 2019 03:37:58 +0000 (UTC) Received: by mail-pl1-f196.google.com with SMTP id 9so1648403ple.5 for ; Thu, 27 Jun 2019 20:37:59 -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=7Vfg9h33wB7wYrWh5CS3qJmltO09MmuyBAYOIuEZJec=; b=EMOFORpNA/TWQegB0oArQ+ZFhdP0T5w2eiwIrkmUrJjhmXv6b12KTPib7PcmfLeWKS RsPGz+qdpLcQ8vpYfycl+bquhlye0Zebuj85i2zLsuepczhqunDzUEVc3YrQzOwcogG3 v61H3FELog6+3eD7KBrhdn6a+lGOaDCcPBQ1eaWhzMe8ofoBZjtmudnofifEf8P74LQK 4Yx4DWIjqdCZnGkTi6rY+xbsvH4dK0rBEgWWnugH0BqZIBiJpN3GTHV7iG6hWNbVTRa9 joRUZ6G2YQ6K63xFhEKqpT2X6ij4642QHOsGSVcIsU2qwMAakPCz+5zvCfcoocSOC2zP OsOQ== 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=7Vfg9h33wB7wYrWh5CS3qJmltO09MmuyBAYOIuEZJec=; b=RFT0W52IDKNS7e5QVUEpTc9uZelO6sCm9CqrLFGKKaesEJUWxsb+58OX2cuuKkxakH lapEQiDOzh5Cv8XrRZqjG0RHUMYMq8B4ofMSHRjWx1bA+G13jiEjsQnF4yvQfyRZvcQo i9DE+4LU2NSI2H2H/8vlYOlj9CBTiZwPYl0fINZps2k2bfG8LFKKKvKpw46qPR00R79l nMXPqmHDeSDCpTp6YMUHZmKXs5Ep9s/ugUDIjzEDch6wTbzfyt95EBEI4XEEIz2muy0T pz7Sf+j2mH+k0at33tDpTuWcA0S1CgWoeluDrFSsZKqwf+A/D39QQm3xsD7aAIn8yKHk +G9w== X-Gm-Message-State: APjAAAVXrX0tONRw1MM/axjbrY2KjK9VBr9/Qswx5tYaLJAmrvnX0Ltg 04baogw2T1hzW45oaK2/6S0mCK9+VAj5W44B X-Received: by 2002:a17:902:8c98:: with SMTP id t24mr9026952plo.320.1561693079203; Thu, 27 Jun 2019 20:37:59 -0700 (PDT) Received: from blackbox.Home ([200.68.140.5]) by smtp.gmail.com with ESMTPSA id e184sm566027pfa.169.2019.06.27.20.37.57 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 27 Jun 2019 20:37:58 -0700 (PDT) From: =?utf-8?b?QW7DrWJhbCBMaW3Ds24=?= To: openembedded-core@lists.openembedded.org Date: Thu, 27 Jun 2019 22:38:30 -0500 Message-Id: <20190628033830.27713-3-anibal.limon@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190628033830.27713-1-anibal.limon@linaro.org> References: <20190628033830.27713-1-anibal.limon@linaro.org> MIME-Version: 1.0 Subject: [OE-core] [PATCH 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 e1a78c8910..5d6804233f 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -1067,10 +1067,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)