Skip to content

Commit ca3e10c

Browse files
Binary-Eaterkuba-moo
authored andcommitted
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>
1 parent a9e4230 commit ca3e10c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tools/net/ynl/ethtool.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import pprint
77
import sys
88
import re
9+
import os
910

1011
from lib import YnlFamily
1112

@@ -152,8 +153,11 @@ def main():
152153
global args
153154
args = parser.parse_args()
154155

155-
spec = '../../../Documentation/netlink/specs/ethtool.yaml'
156-
schema = '../../../Documentation/netlink/genetlink-legacy.yaml'
156+
script_abs_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
157+
spec = os.path.join(script_abs_dir,
158+
'../../../Documentation/netlink/specs/ethtool.yaml')
159+
schema = os.path.join(script_abs_dir,
160+
'../../../Documentation/netlink/genetlink-legacy.yaml')
157161

158162
ynl = YnlFamily(spec, schema)
159163

0 commit comments

Comments
 (0)