From patchwork Tue Nov 12 08:47:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: aginwala aginwala X-Patchwork-Id: 1193372 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="bcHSMPmR"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47C1bs52K9z9sPJ for ; Tue, 12 Nov 2019 19:48:09 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 1D00EC2C; Tue, 12 Nov 2019 08:48:06 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 7027CB6C for ; Tue, 12 Nov 2019 08:48:04 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 52371623 for ; Tue, 12 Nov 2019 08:48:03 +0000 (UTC) Received: by mail-pf1-f195.google.com with SMTP id r4so12842178pfl.7 for ; Tue, 12 Nov 2019 00:48:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HQ9hXTJ1/eDr1zI6BrSHolfZVefOWcOVVZ31Wws+hbI=; b=bcHSMPmRoNL66SWROmFhbohARHVFYj4eu9B1zvFQi0Vqx3yBMQFhbk6CSFxCi4ioiN FPY2CBT0wnVhIj6yABVrUQ7lVDbvWD8lVB//rj9Z5iqh/tnBhpcclkAlgeTN/U9Z/H1A Fpb2rWiWcsee65zBcZIxlAIASItfRRPHhNDXJnYsmo4nhX4C/2SjYmlwO8iF5LUJgmSn pJNkh9asQMbMWvXprImjsdU7x2VS1DmCbeSBYURogkQRH3G1hxcDigUwCuR8n0PxbMbb Iw1jHoNGuMIm8T3PWpsBGOjBnXD4IP16ECegAlCOe/U91xTOSUWg/bhgfpwBzHyWql+t y7Rw== 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:mime-version :content-transfer-encoding; bh=HQ9hXTJ1/eDr1zI6BrSHolfZVefOWcOVVZ31Wws+hbI=; b=mwr2Ab8BFBQQkKx/iZ2mg3HOM+dWyxknjlzDXpU3QTg67zJkJDc9LqYtKSWRSNbF1k Ztga/Ikv0w0Vv5vJeNY/rcaDwdTR8EuqfJUpSjA4q6CFn3lckdrN6OsmA7qVmftp5P7m rWpnWcZJ5MOS3N4KmP7RAbBsUO31C3PRe9f2bksr8rMqWZSGjQN8dKQL1zwYsoEq7DSm aflRfu0elLqZtUnJa1KBviJQ64BwUgMTfTCtURNY+9UAqmsKOgCyP9QdQEAb/bykEt7v HfYwYbO/ySFr67/Rk1OxmhMRrqS5XxHoEttllybkwigumakDrEvGV1bpegS0Z9y4PlOD 0N0g== X-Gm-Message-State: APjAAAXX28l7dDsylpJCPFWjAZ95KF2h8ZFxuhYjwsWJP37w8YEUtuL4 W16uf55k6FEgRZxXFsOCHolLaSfs X-Google-Smtp-Source: APXvYqyNHcB9BhS8Z6FKyWjd7HljDnoUURp6ZlFS4lwC7Ync2ynmtUZMuu0ixrMLjiXrXPtsEuJtcg== X-Received: by 2002:a17:90a:9741:: with SMTP id i1mr4941789pjw.41.1573548482597; Tue, 12 Nov 2019 00:48:02 -0800 (PST) Received: from LM-SJC-11015761.hsd1.ca.comcast.net. (c-71-198-142-45.hsd1.ca.comcast.net. [71.198.142.45]) by smtp.gmail.com with ESMTPSA id 39sm1832381pjo.7.2019.11.12.00.48.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 Nov 2019 00:48:01 -0800 (PST) From: amginwal@gmail.com To: dev@openvswitch.org Date: Tue, 12 Nov 2019 00:47:58 -0800 Message-Id: <20191112084758.3663-1-amginwal@gmail.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Aliasgar Ginwala , guru@ovn.org Subject: [ovs-dev] [PATCH v1] ovs container build: Make kernel module configurable X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org From: Aliasgar Ginwala --with-linux can be made configurable while building containers for leveraging kernel modules installed on host. KERNEL_VERSION=host should be used in env variable for the same. Signed-off-by: Aliasgar Ginwala --- utilities/docker/Makefile | 2 +- utilities/docker/debian/build-kernel-modules.sh | 16 +++++++++++++--- utilities/docker/start-ovs | 9 ++++++++- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/utilities/docker/Makefile b/utilities/docker/Makefile index 8c2f7810e..d8b08a3c9 100644 --- a/utilities/docker/Makefile +++ b/utilities/docker/Makefile @@ -10,7 +10,7 @@ # make push REPO = ${DOCKER_REPO} -tag = ${OVS_VERSION}_${KERNEL_VERSION} +tag = ${OVS_VERSION}_${DISTRO}_${KERNEL_VERSION} build: ;docker build -t ${REPO}:${tag} --build-arg DISTRO=${DISTRO} \ --build-arg OVS_BRANCH=${OVS_BRANCH} \ diff --git a/utilities/docker/debian/build-kernel-modules.sh b/utilities/docker/debian/build-kernel-modules.sh index 18ac35764..17a67bfcb 100755 --- a/utilities/docker/debian/build-kernel-modules.sh +++ b/utilities/docker/debian/build-kernel-modules.sh @@ -17,13 +17,17 @@ OVS_BRANCH=$2 GITHUB_SRC=$3 # Install deps -linux="linux-image-$KERNEL_VERSION linux-headers-$KERNEL_VERSION" build_deps="apt-utils libelf-dev build-essential libssl-dev python3 \ python3-six wget gdb autoconf libtool git automake bzip2 debhelper \ dh-autoreconf openssl" apt-get update -apt-get install -y ${linux} ${build_deps} + +if [ $KERNEL_VERSION != "host" ]; then + linux="linux-image-$KERNEL_VERSION linux-headers-$KERNEL_VERSION" + apt-get install -y ${linux} +fi +apt-get install -y ${build_deps} # get the source mkdir /build; cd /build @@ -32,8 +36,14 @@ cd ovs # build and install ./boot.sh -./configure --localstatedir="/var" --sysconfdir="/etc" --prefix="/usr" \ +if [ $KERNEL_VERSION == "host" ]; then + ./configure --localstatedir="/var" --sysconfdir="/etc" --prefix="/usr" \ +--enable-ssl +else + ./configure --localstatedir="/var" --sysconfdir="/etc" --prefix="/usr" \ --with-linux=/lib/modules/$KERNEL_VERSION/build --enable-ssl +fi + make -j8; make install; make modules_install # remove deps to make the container light weight. diff --git a/utilities/docker/start-ovs b/utilities/docker/start-ovs index 4a1a16cd1..c99380519 100755 --- a/utilities/docker/start-ovs +++ b/utilities/docker/start-ovs @@ -38,5 +38,12 @@ case $1 in -vfile:info --mlockall --no-chdir \ --log-file=/var/log/openvswitch/ovs-vswitchd.log ;; - *) echo "$0 [ovsdb-server|ovs-vswitchd]" + "ovs-vswitchd-host") /usr/share/openvswitch/scripts/ovs-ctl \ + --no-ovsdb-server start + /usr/share/openvswitch/scripts/ovs-ctl stop + ovs-vswitchd --pidfile -vconsole:emer \ + -vsyslog:err -vfile:info --mlockall --no-chdir \ + --log-file=/var/log/openvswitch/ovs-vswitchd.log + ;; + *) echo "$0 [ovsdb-server|ovs-vswitchd|ovs-vswitchd-host]" esac