From patchwork Sat Jan 13 22:36:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 860382 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="QiYyLd+Q"; 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 3zJvcL4jTQz9sBd for ; Sun, 14 Jan 2018 09:36:50 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id DAB01F06; Sat, 13 Jan 2018 22:36:47 +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 23FF4ECF for ; Sat, 13 Jan 2018 22:36:46 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pl0-f66.google.com (mail-pl0-f66.google.com [209.85.160.66]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 9D5E1473 for ; Sat, 13 Jan 2018 22:36:45 +0000 (UTC) Received: by mail-pl0-f66.google.com with SMTP id 66so1193545plc.13 for ; Sat, 13 Jan 2018 14:36:45 -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=nZekyMs3vDYyc1iR5ZtwuE3qIr+RwFWATCppIOZP4O0=; b=QiYyLd+QzmQxUPTZZMugnpTAQLzEV2wFe7QLN3pka4BJxjwZfIcMtWrE0kfmtcL6sP HgRMEtHj+cWHssvPH4VP+2kBjPUXfruFK4P0Ad7H0OhtjWvacLvTu0cDR04izX0V9yuf scscYLhX4tf3N3ePNuxV5N1HXuyvjSkM0bnDirH04Kh5zWMgC5HCsUkHwE3C4lnTjoYB hDhDioMkkjXzW26k76/d9krb5OXNcgoj6vuBQOJSbZ33RXdSq1AFAX/iJRpJiqo3kEhs eN2KsKqxgUTTzuoOOjTPmnZ1JSN8lyJ+wJIedxOQvHnOrZMCmPdI24GQQraQuDHy54d6 ARHg== 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=nZekyMs3vDYyc1iR5ZtwuE3qIr+RwFWATCppIOZP4O0=; b=bsiwj17QXYSDyZfb0VFJzNlAaGW5PgyKPbqPztFia6kcXyggNh5h8I6xbJCcClMl3J m5/XqG0od2oiihXfOZxCouV96+2ucFG+vN1DiP0jfZ+/bPwBL/Sk4Idu5GDmyi6+ZAbv d8tX279Z7gg9H5xRD6KDxv42M9HCSlbhcmOlZjQiI5g4uKgJ85Jl01bY5bN8Vs6zHY4n 22I7xZ0iZSRrdUlaXBp2urw+BjdMoANtvJdX9W4N3wXqzmH0nb4iJvJ0wIeQkMrmMFBs VyAJWCiErYilPssLrRMiZ4aTfFc2lEofyT7jpRnmet9nA95IvDxatgJB3Qojh/H3h+Sh gBnA== X-Gm-Message-State: AKwxytdb0GX900Q7W49vKS2dWSNofsChIyfEky/lJeogkqBwnb5k1bYt XC8flNITEJi5/YuK8Q/5mCCywA== X-Google-Smtp-Source: ACJfBotuvf6qwANgBLo1x6jPl/QxVyS+G+gcotKgpPCMKYZJgZAmqE80V1iLq2QoRYZqEMkf2l86mw== X-Received: by 10.84.130.33 with SMTP id 30mr5372207plc.134.1515883004756; Sat, 13 Jan 2018 14:36:44 -0800 (PST) Received: from gizo.domain (184-100-156-182.ptld.qwest.net. [184.100.156.182]) by smtp.gmail.com with ESMTPSA id v186sm26894656pfb.5.2018.01.13.14.36.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Jan 2018 14:36:43 -0800 (PST) From: Greg Rose To: dev@openvswitch.org Date: Sat, 13 Jan 2018 14:36:40 -0800 Message-Id: <1515883000-14032-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 Subject: [ovs-dev] [PATCH] rhel: Ensure proper OVS kernel modules load after upgrade 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 Add post install and post un-install scripts to make sure that the openvswitch kernel modules are correctly written with the weak-modules utility. This ensures that after an upgrade to a newer kernel the correct openvswitch kernel modules from a previous installation will be found by the depmod search path. Suggested-by: Flavio Leitner Signed-off-by: Greg Rose --- rhel/openvswitch.spec.in | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/rhel/openvswitch.spec.in b/rhel/openvswitch.spec.in index e510d35..44cd611 100644 --- a/rhel/openvswitch.spec.in +++ b/rhel/openvswitch.spec.in @@ -165,6 +165,17 @@ else done fi +%post kmod-%{kverrel} +for k in $(cd /lib/modules && /bin/ls); do + [ -d "/lib/modules/$k/kernel/" ] && depmod -a "$k" +done +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 +fi + # Ensure all required services are set to run /sbin/chkconfig --add openvswitch /sbin/chkconfig openvswitch on @@ -185,6 +196,19 @@ if [ "$1" = "0" ]; then # $1 = 0 for uninstall rm -f /etc/openvswitch/vswitchd.cacert fi +%postun kmod-%{kverrel} +for k in $(cd /lib/modules && /bin/ls); do + [ -d "/lib/modules/$k/kernel/" ] && depmod -a "$k" +done +if [ "$1" = 0 ]; then # Erase, not upgrade + 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 --remove-modules + fi +fi + %postun selinux-policy if [ $1 -eq 0 ] ; then /usr/sbin/semodule -r openvswitch-custom &> /dev/null || :