[Git][NTPsec/ntpsec][master] ntpconfigtest: a new contrib/ tool to cehck kernel configuration.

Gary E. Miller gitlab at mg.gitlab.com
Thu Mar 30 02:01:12 UTC 2017


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
f0c6b0d5 by Gary E. Miller at 2017-03-29T18:58:57-07:00
ntpconfigtest:  a new contrib/ tool to cehck kernel configuration.

Automation to check your running linux kernel config.  More items to be
added as they get nailed down.

- - - - -


2 changed files:

- contrib/README
- + contrib/ntpconfigtest


Changes:

=====================================
contrib/README
=====================================
--- a/contrib/README
+++ b/contrib/README
@@ -2,6 +2,8 @@ The following tools are not production-ready. They are included only as
 conveniences, examples or rudimentary starting points for other development
 efforts.
 
+ntpconfigtest: Check your linux configuration for the proper entries.
+
 ntpheat is a program to exercise a CPU until the CPU reachs a certain
 temperature.  The idea is to get the temperature around the system
 oscillator to be near the zero TC point.  Tested on RasPi wrapped


=====================================
contrib/ntpconfigtest
=====================================
--- /dev/null
+++ b/contrib/ntpconfigtest
@@ -0,0 +1,42 @@
+#!/usr/bin/env python
+
+# On Linux systems, read /proc/config.gz and check for the
+# needed kernel options.
+
+from __future__ import print_function
+
+import gzip
+import string
+import sys
+
+config_file_name = '/proc/config.gz'
+
+try:
+    with gzip.open(config_file_name, 'rb') as f:
+        file_content = f.read()
+except:
+        print("ERROR: can not read your %s" % (config_file_name))
+        sys.exit(1)
+
+tests = (
+    ('CONFIG_CPU_FREQ_GOV_PERFORMANCE', 'For best performance'),
+    ('CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y', 'For best performance'),
+    ('CONFIG_PPS', 'Needed for PPS support' ),
+    ('CONFIG_PPS_CLIENT_LDISC', 'For PPS support on serial lines' ),
+    ('CONFIG_PPS_CLIENT_GPIO', 'For PPS support on GPIO lines' ),
+    )
+
+for test in tests:
+    print("Checking: %s, %s: " % (test[0], test[1]), end='')
+    index = file_content.find("\n%s" % (test[0]))
+    if 0 <= index:
+        print("OK")
+    else:
+        print("Missing")
+
+sys.exit(0)
+
+
+
+
+



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/f0c6b0d5fab793a37888769fe4cfdadb87deabc8
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170330/779e8056/attachment.html>


More information about the vc mailing list