Skip to content

Commit

Permalink
tools: ynl: ethtool.py: Make tool invokable from any CWD
Browse files Browse the repository at this point in the history
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@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Link: https://lore.kernel.org/r/20240402204000.115081-1-rrameshbabu@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Rahul Rameshbabu authored and Jakub Kicinski committed Apr 4, 2024
1 parent a9e4230 commit ca3e10c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tools/net/ynl/ethtool.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import pprint
import sys
import re
import os

from lib import YnlFamily

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit ca3e10c

Please sign in to comment.