From patchwork Thu Jan 25 03:23:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 865703 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) 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; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uelRmx9G"; 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 3zRnRp40qjz9sQm for ; Thu, 25 Jan 2018 14:23:17 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id DA214108A; Thu, 25 Jan 2018 03:23:14 +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 C33611083 for ; Thu, 25 Jan 2018 03:23:13 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 0A45CE2 for ; Thu, 25 Jan 2018 03:23:12 +0000 (UTC) Received: by mail-pf0-f196.google.com with SMTP id t12so4795967pfg.2 for ; Wed, 24 Jan 2018 19:23:12 -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; bh=kR9w2ihzASKjCFoOvbK0PLofT0Aj/K4NSKXc40C3fzM=; b=uelRmx9GZPFW7XXb6j1mhPfj6WZyCtM5d/Q/8qOgwkyRdwLIPA5LE4lmuMQpTlphZ0 mQbvD1rx6Qa6Zy7BL3kW4Qy7nqh2veBfX3aj2fML3v2Iu/SpCV+zOw/84R7zEWYydLMn BSayJK/NqiT/XAFUunOPm1tVlRzIG0m0TsNJA8gPnUJlF2F+wryZiNYQpWjKeR+pv+qR BYAue/jfjbzg8InaEl1lDbbICRuG2l3nlEb84o2U4I6HNGY6LlAc67D4f5DAuEn+y6G6 158y26ZAvAnBo3tE3xE9DKQp9IfCbypVQ04B3gMKgfOZPkUb/ExaZMndZkqdxXnB0nAC CJkQ== 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; bh=kR9w2ihzASKjCFoOvbK0PLofT0Aj/K4NSKXc40C3fzM=; b=dcUbaPScFwbB8ooCmZp6yYEFZ7ac8FU9ei4oLkgviZuCVbIyoF+9Dv3FTMrm8EmQqG q6NvuGcEDqtxJPeovXh7BjDkF/xQYOtjqWNfobBmjHMEklLqhpw4we75CirkeKyp6bLZ fJCPrjTHYw3RExpXBz47tUKOrKPN/SfWLFFFW+plBqXrtwDd3hQ5fxtMMFnw6owNKKzJ aHmAgt4bUs3+h0fTqF197rNQnnwn2WyGVM30QOqbld1IZHkvGz8sjx7jdsPZ54ft4hGz haoCmY2fNvjt+khyIigD5BaZd/9KoJADpiqdh078j1La6TTSQ6PKqD5hv9HJYCkQzbkl 34fg== X-Gm-Message-State: AKwxytdnrBB8qjnvkEN5KgQxF+yVVO/YlyQcw+qDwpu9uYw/tqYfg9U2 yFRjeetURqhkRnIa6NXOEwxiig== X-Google-Smtp-Source: AH8x226q6YfFV9WDU7GyZ73iDD/jwltDsF84eD53wmp4WwIlB2Ew0dVv53LS4avj36z9s9e8BduI1A== X-Received: by 2002:a17:902:20cb:: with SMTP id v11-v6mr10022290plg.63.1516850592025; Wed, 24 Jan 2018 19:23:12 -0800 (PST) Received: from gizo.domain (184-100-156-182.ptld.qwest.net. [184.100.156.182]) by smtp.gmail.com with ESMTPSA id k29sm2183862pgn.28.2018.01.24.19.23.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jan 2018 19:23:10 -0800 (PST) From: Greg Rose To: dev@openvswitch.org Date: Wed, 24 Jan 2018 19:23:06 -0800 Message-Id: <1516850586-4226-1-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Flavio Leitner Subject: [ovs-dev] [PATCH] rhel: Change depmod configuration 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: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org A previous patch added post install and post uninstall scripts which use the weak-modules utility to make sure that openvswitch kernel modules are copied to the correct kernel directory. While this patch did fix some issues there are two remaining issues we have found. 1) In the case where the OS is running kernel X and the openvswitch kernel modules have been previously installed correctly and are working without a problem and then updating to Kernel X.1 we find that the correct openvswitch kernel module no longer loads. 2) In the case where a kernel module rpm has been built against an older kernel but installed on a newer kernel then the correct openvswitch kernel module will not load. This patch changes the weak-modules parameter to --add-kernel instead of --add-modules. This fixes the problem in case 1. In addition we modify the openvswitch depmod configuration file installed to the /etc/depmod.d directory and prepend a "01" to the name of the file. We then insert the first line of the file with a search path that will find weak-updates first. This change along with the change to the weak-modules utility parameters fixes the problem in case 2. I also modified the kernel module configuration file for both the rhel6 and rhel7/fedora specs to use a common "01openvswitch.conf" file name format. Cc: Flavio Leitner Co-authored-by: Gurucharan Shetty Signed-off-by: Greg Rose --- rhel/openvswitch-kmod-fedora.spec.in | 12 +++++++----- rhel/openvswitch-kmod-rhel6.spec.in | 14 ++++++++------ rhel/openvswitch-kmod.files | 2 +- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/rhel/openvswitch-kmod-fedora.spec.in b/rhel/openvswitch-kmod-fedora.spec.in index c0cd298..ae3a4d8 100644 --- a/rhel/openvswitch-kmod-fedora.spec.in +++ b/rhel/openvswitch-kmod-fedora.spec.in @@ -43,13 +43,15 @@ make %{_smp_mflags} -C datapath/linux rm -rf $RPM_BUILD_ROOT make INSTALL_MOD_PATH=$RPM_BUILD_ROOT -C datapath/linux modules_install mkdir -p $RPM_BUILD_ROOT/etc/depmod.d + +echo "search weak-updates updates extra built-in" >> $RPM_BUILD_ROOT/etc/depmod.d/01openvswitch.conf for module in $RPM_BUILD_ROOT/lib/modules/%{kernel}/extra/*.ko do modname="$(basename ${module})" echo "override ${modname%.ko} * extra" >> \ - $RPM_BUILD_ROOT/etc/depmod.d/kmod-openvswitch.conf + $RPM_BUILD_ROOT/etc/depmod.d/01openvswitch.conf echo "override ${modname%.ko} * weak-updates" >> \ - $RPM_BUILD_ROOT/etc/depmod.d/kmod-openvswitch.conf + $RPM_BUILD_ROOT/etc/depmod.d/01openvswitch.conf done %clean @@ -64,7 +66,7 @@ if [ -x "/sbin/weak-modules" ]; then for m in openvswitch vport-gre vport-stt vport-geneve \ vport-lisp vport-vxlan; do echo "/lib/modules/%{kernel}/extra/$m.ko" - done | /sbin/weak-modules --add-modules + done | /sbin/weak-modules --add-kernel fi %postun @@ -76,14 +78,14 @@ if [ "$1" = 0 ]; then # Erase, not upgrade for m in openvswitch vport-gre vport-stt vport-geneve \ vport-lisp vport-vxlan; do echo "/lib/modules/%{kernel}/extra/$m.ko" - done | /sbin/weak-modules --remove-modules + done | /sbin/weak-modules --remove-kernel fi fi %files %defattr(0644,root,root) /lib/modules/%{kernel}/extra/*.ko -/etc/depmod.d/kmod-openvswitch.conf +/etc/depmod.d/01openvswitch.conf %exclude /lib/modules/%{kernel}/modules.* %changelog diff --git a/rhel/openvswitch-kmod-rhel6.spec.in b/rhel/openvswitch-kmod-rhel6.spec.in index c6e6db5..28c7ce1 100644 --- a/rhel/openvswitch-kmod-rhel6.spec.in +++ b/rhel/openvswitch-kmod-rhel6.spec.in @@ -62,13 +62,15 @@ for flavor in %flavors_to_build ; do find $INSTALL_MOD_PATH/lib/modules -iname 'modules.*' -exec rm {} \; done install -d %{buildroot}%{_sysconfdir}/depmod.d/ + +echo "search extra/openvswitch weak-updates/openvswitch updates extra built-in weak-updates" >> 01%{oname}.conf for module in %{buildroot}/lib/modules/%{kernel_version}/$INSTALL_MOD_DIR/*.ko; do modname="$(basename ${module})" - echo "override ${modname%.ko} * extra/%{oname}" >> %{oname}.conf - echo "override ${modname%.ko} * weak-updates/%{oname}" >> %{oname}.conf + echo "override ${modname%.ko} * extra/%{oname}" >> 01%{oname}.conf + echo "override ${modname%.ko} * weak-updates/%{oname}" >> 01%{oname}.conf done -install -m 644 %{oname}.conf %{buildroot}%{_sysconfdir}/depmod.d/ +install -m 644 01%{oname}.conf %{buildroot}%{_sysconfdir}/depmod.d/ %post # Ensure that modprobe will find our modules. @@ -79,7 +81,7 @@ if [ -x "/sbin/weak-modules" ]; then for m in openvswitch vport-gre vport-stt vport-geneve \ vport-lisp vport-vxlan; do echo "/lib/modules/%{kernel}/extra/$m.ko" - done | /sbin/weak-modules --add-modules + done | /sbin/weak-modules --add-kernel fi %postun @@ -91,13 +93,13 @@ if [ "$1" = 0 ]; then # Erase, not upgrade for m in openvswitch vport-gre vport-stt vport-geneve \ vport-lisp vport-vxlan; do echo "/lib/modules/%{kernel}/extra/$m.ko" - done | /sbin/weak-modules --remove-modules + done | /sbin/weak-modules --remove-kernel fi fi %files %defattr(644,root,root) -/etc/depmod.d/%{oname}.conf +/etc/depmod.d/01%{oname}.conf %clean rm -rf $RPM_BUILD_ROOT diff --git a/rhel/openvswitch-kmod.files b/rhel/openvswitch-kmod.files index 357c2e8..49262f3 100644 --- a/rhel/openvswitch-kmod.files +++ b/rhel/openvswitch-kmod.files @@ -1,3 +1,3 @@ %defattr(644,root,root,755) /lib/modules/%2-%1 -/etc/depmod.d/openvswitch.conf +/etc/depmod.d/01openvswitch.conf