@@ -84,3 +84,5 @@ systemd/rpc-gssd.service
cscope.*
# generic editor backup et al
*~
+# python bytecode
+__pycache__
new file mode 100755
@@ -0,0 +1,13 @@
+#!/usr/bin/python
+import argparse
+import sysfs
+
+parser = argparse.ArgumentParser()
+
+def show_small_help(args):
+ parser.print_usage()
+ print("sunrpc dir:", sysfs.SUNRPC)
+parser.set_defaults(func=show_small_help)
+
+args = parser.parse_args()
+args.func(args)
new file mode 100644
@@ -0,0 +1,19 @@
+import pathlib
+import re
+import sys
+
+MOUNT = None
+with open("/proc/mounts", 'r') as f:
+ for line in f:
+ if re.search("^sys ", line):
+ MOUNT = line.split()[1]
+ break
+
+if MOUNT == None:
+ print("ERROR: sysfs is not mounted")
+ sys.exit(1)
+
+SUNRPC = pathlib.Path(MOUNT) / "kernel" / "sunrpc"
+if not SUNRPC.is_dir():
+ print("ERROR: sysfs does not have sunrpc directory")
+ sys.exit(1)