public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: Punit Agrawal <punitagrawal@gmail.com>
To: jkacur@redhat.com
Cc: Punit Agrawal <punitagrawal@gmail.com>,
	linux-rt-users@vger.kernel.org, punit1.agrawal@toshiba.co.jp
Subject: [PATCH 1/2] rteval: osinfo.py: Fix RT kernel detection
Date: Thu,  9 Sep 2021 17:05:46 +0900	[thread overview]
Message-ID: <20210909080547.1331581-2-punitagrawal@gmail.com> (raw)
In-Reply-To: <20210909080547.1331581-1-punitagrawal@gmail.com>

From: Punit Agrawal <punit1.agrawal@toshiba.co.jp>

Since the osinfo.py module was developed, RT kernels have moved on
from identifying as "RT" to "PREEMPT_RT". This change in the kernel
identifier causes osinfo.py to incorrectly detect RT kernels as
non-RT.

Update the check for detecting RT kernel to be able to handle both the
variants.

Signed-off-by: Punit Agrawal <punit1.agrawal@toshiba.co.jp>
---
 rteval/sysinfo/osinfo.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rteval/sysinfo/osinfo.py b/rteval/sysinfo/osinfo.py
index 98e5b4422cad..7b7bfe9ce4ec 100644
--- a/rteval/sysinfo/osinfo.py
+++ b/rteval/sysinfo/osinfo.py
@@ -91,7 +91,7 @@ class OSInfo:
 
         (sys, node, release, ver, machine) = os.uname()
         isrt = 1
-        if ver.find(' RT ') == -1:
+        if 'RT ' not in ver:
             isrt = 0
 
         node_n = libxml2.newNode("node")
-- 
2.32.0


  reply	other threads:[~2021-09-09  8:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-09  8:05 [PATCH 0/2] rteval: Miscellaneous fixes Punit Agrawal
2021-09-09  8:05 ` Punit Agrawal [this message]
2021-09-10 16:30   ` [PATCH 1/2] rteval: osinfo.py: Fix RT kernel detection John Kacur
2021-09-09  8:05 ` [PATCH 2/2] rteval: services.py: Fix incorrect detection of container environment Punit Agrawal
2021-09-12 14:59   ` John Kacur
2021-09-13  7:47     ` Punit Agrawal
2021-09-13  8:06     ` [PATCH v2] " Punit Agrawal
2021-09-13 13:33       ` John Kacur

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210909080547.1331581-2-punitagrawal@gmail.com \
    --to=punitagrawal@gmail.com \
    --cc=jkacur@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=punit1.agrawal@toshiba.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox