Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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@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>

authored by

Rahul Rameshbabu and committed by
Jakub Kicinski
ca3e10c4 a9e4230d

+6 -2
+6 -2
tools/net/ynl/ethtool.py
··· 6 6 import pprint 7 7 import sys 8 8 import re 9 + import os 9 10 10 11 from lib import YnlFamily 11 12 ··· 153 152 global args 154 153 args = parser.parse_args() 155 154 156 - spec = '../../../Documentation/netlink/specs/ethtool.yaml' 157 - schema = '../../../Documentation/netlink/genetlink-legacy.yaml' 155 + script_abs_dir = os.path.dirname(os.path.abspath(sys.argv[0])) 156 + spec = os.path.join(script_abs_dir, 157 + '../../../Documentation/netlink/specs/ethtool.yaml') 158 + schema = os.path.join(script_abs_dir, 159 + '../../../Documentation/netlink/genetlink-legacy.yaml') 158 160 159 161 ynl = YnlFamily(spec, schema) 160 162