From patchwork Tue Feb 9 19:47:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 1438616 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.166.136; helo=smtp3.osuosl.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.a=rsa-sha256 header.s=20161025 header.b=Wy906itQ; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DZthf2qBGz9s1l for ; Wed, 10 Feb 2021 06:47:28 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 5DF006F54C for ; Tue, 9 Feb 2021 19:47:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dHwyqBUXXQNS for ; Tue, 9 Feb 2021 19:47:25 +0000 (UTC) Received: by smtp3.osuosl.org (Postfix, from userid 1001) id 4B0EE6F668; Tue, 9 Feb 2021 19:47:25 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTP id 3A12E6F4D2; Tue, 9 Feb 2021 19:47:13 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0D97FC0891; Tue, 9 Feb 2021 19:47:13 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4BFC3C013A for ; Tue, 9 Feb 2021 19:47:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 3220A6F4D2 for ; Tue, 9 Feb 2021 19:47:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qDoC8KF94AfF for ; Tue, 9 Feb 2021 19:47:11 +0000 (UTC) Received: by smtp3.osuosl.org (Postfix, from userid 1001) id 7716D6F500; Tue, 9 Feb 2021 19:47:11 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by smtp3.osuosl.org (Postfix) with ESMTPS id 547C36F4D2 for ; Tue, 9 Feb 2021 19:47:10 +0000 (UTC) Received: by mail-pl1-f179.google.com with SMTP id 8so10338714plc.10 for ; Tue, 09 Feb 2021 11:47:10 -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=daEDICp/4HF5eV5wniRystpHN2FlYrGEToz4rR3L2Wk=; b=Wy906itQJYKqJ4L/8XRz2BC36Oa7Rz1h459LTUESXqhIOPe2lVsRH4mlVuXoroZFr0 pQP99+LmV1dELOoACUF9TyZGABr/Dl0jLNq2GtyMof+FZgdKIemBUoJZLrw8Q0ZMNrKf GxJIOheERonI3OvyTIWP9hOlfWPwj3+CPNIeDUCxiH5463usk86zxiFlYLM5n7C/NpZW EPXIs2xPYzZEaMTw5Zr65U/rQ++L1Y8G8aqHUZ348oYaDrH0ya+6KU0z0oUecTw4+s+O Nnb/bZWXpmUQRl7bEjyjRq8y52SArlTIdnjcCPR3eECr6Oab3rIEqNZgcFaSbtBmaiR/ NkVg== 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=daEDICp/4HF5eV5wniRystpHN2FlYrGEToz4rR3L2Wk=; b=K+KvH6M62j6n31AipAg4zcf9ORYJgS+gk2KiJhhxBBpuaTe8auFlX3MZXoqrfYtZy1 /XnCTKjvXozY76eiHCjzU46Qub+2HF1Rl53XXP39uSXP4g6DPOWVtRZqVYb+bYaScCap AjbefSbEii+mCenhrLFDL2z3XQOdssvlGa5wy/Hox/2RIwFrTIRJgOTbbZR3O8iI+VJ9 IOK75wAvR1hPp7CgtcX5VKwk4dBZMdKon07l9ubIom7vu+BrZb/7Doud9og8uSDs87Lt 5Pj4/IXRxNbtgTHXg0AQNbjZXnCgQ6KMG6wlLHxa2eyj0Xi27F7+c7C3wGcSqad4qKme Z9vg== X-Gm-Message-State: AOAM533uMrc+MtjDx+psarqQMsxEYXtdcXVCNCUbluE+8TsTNPI1jBCo 24yoSDYx9aP1uy49CgOoume89hmlel6UKQ== X-Google-Smtp-Source: ABdhPJz+ZCbpmD6zy338UEjViGISj8+ZEI7uVSFtY3bmVAvfvkCK5suxAumAbNg02y9jIc/dAj932g== X-Received: by 2002:a17:90b:1008:: with SMTP id gm8mr5792987pjb.174.1612900029495; Tue, 09 Feb 2021 11:47:09 -0800 (PST) Received: from VMware-box.domain ([97.115.183.46]) by smtp.googlemail.com with ESMTPSA id p12sm3281627pju.35.2021.02.09.11.47.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 11:47:09 -0800 (PST) From: Greg Rose To: dev@openvswitch.org Date: Tue, 9 Feb 2021 11:47:06 -0800 Message-Id: <20210209194706.5069-1-gvrose8192@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [ovs-dev] [PATCH] rhel: Do not update kmod RPM newer major revision kernels X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" The ovs-kmod-manage.sh script will run weak-updates even on newer release kernels installing a non-compatible or un-runnable kernel module. Update the script to never install weak-updates onto kernels with newer major release versions. VMware-BZ: #2717283 Signed-off-by: Greg Rose --- rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh b/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh index f147857e4..66b09472a 100644 --- a/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh +++ b/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh @@ -155,6 +155,16 @@ kmod_versions=() kversion=$(rpm -ql ${rpmname} | grep '\.ko$' | \ sed -n -e 's/^\/lib\/modules\/\(.*\)\/extra\/.*$/\1/p' | \ sort | uniq) + +IFS='.\|-' read installed_major installed_minor installed_patch \ + installed_major_rev installed_minor_rev installed_extra <<<"${kversion}" + +if [ "$installed_major_rev" -lt "$major_rev" ]; then + echo Not installing RPM with major revision "$installed_major_rev" \ +to kernel with greater major revision "$major_rev. Exiting" + exit 1 +fi + for kv in $kversion; do IFS='.\|-' read -r -a kv_nums <<<"${kv}" kmod_versions+=(${kv_nums[$ver_offset]})