[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240403212931.128541-7-rrameshbabu@nvidia.com>
Date: Wed, 3 Apr 2024 14:28:44 -0700
From: Rahul Rameshbabu <rrameshbabu@...dia.com>
To: netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org
Cc: ahmed.zaki@...el.com,
aleksander.lobakin@...el.com,
alexandre.torgue@...s.st.com,
andrew@...n.ch,
cjubran@...dia.com,
corbet@....net,
davem@...emloft.net,
dtatulea@...dia.com,
edumazet@...gle.com,
gal@...dia.com,
hkallweit1@...il.com,
jacob.e.keller@...el.com,
jiri@...nulli.us,
joabreu@...opsys.com,
justinstitt@...gle.com,
kory.maincent@...tlin.com,
kuba@...nel.org,
leon@...nel.org,
liuhangbin@...il.com,
maxime.chevallier@...tlin.com,
pabeni@...hat.com,
paul.greenwalt@...el.com,
przemyslaw.kitszel@...el.com,
rdunlap@...radead.org,
richardcochran@...il.com,
saeed@...nel.org,
tariqt@...dia.com,
vadim.fedorenko@...ux.dev,
vladimir.oltean@....com,
wojciech.drewek@...el.com,
Rahul Rameshbabu <rrameshbabu@...dia.com>
Subject: [PATCH RFC v2 5/6] tools: ynl: ethtool.py: Make tool invokable from any CWD
ethtool.py depends on yml files in a specific location of the linux kernel
tree. Using relative lookup for those files means that ethtool.py would
need to be run under tools/net/ynl/. Lookup needed yml files without
depending on the current working directory that ethtool.py is invoked from.
Signed-off-by: Rahul Rameshbabu <rrameshbabu@...dia.com>
---
tools/net/ynl/ethtool.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/net/ynl/ethtool.py b/tools/net/ynl/ethtool.py
index 6c9f7e31250c..44ba3ba58ed9 100755
--- a/tools/net/ynl/ethtool.py
+++ b/tools/net/ynl/ethtool.py
@@ -6,6 +6,7 @@ import json
import pprint
import sys
import re
+import os
from lib import YnlFamily
@@ -152,8 +153,11 @@ def main():
global args
args = parser.parse_args()
- spec = '../../../Documentation/netlink/specs/ethtool.yaml'
- schema = '../../../Documentation/netlink/genetlink-legacy.yaml'
+ script_abs_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
+ spec = os.path.join(script_abs_dir,
+ '../../../Documentation/netlink/specs/ethtool.yaml')
+ schema = os.path.join(script_abs_dir,
+ '../../../Documentation/netlink/genetlink-legacy.yaml')
ynl = YnlFamily(spec, schema)
--
2.42.0
Powered by blists - more mailing lists