mirror of
https://github.com/Klipper3d/klipper.git
synced 2026-01-07 07:17:45 -07:00
klippy: Report Linux version in log
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
35aeb78088
commit
ea9c88526b
2 changed files with 8 additions and 0 deletions
|
|
@ -328,6 +328,7 @@ def main():
|
|||
start_args['software_version'] = git_vers
|
||||
start_args['cpu_info'] = util.get_cpu_info()
|
||||
start_args['device'] = util.get_device_info()
|
||||
start_args['linux_version'] = util.get_linux_version()
|
||||
if bglogger is not None:
|
||||
versions = "\n".join([
|
||||
"Args: %s" % (sys.argv,),
|
||||
|
|
@ -335,6 +336,7 @@ def main():
|
|||
extra_git_desc),
|
||||
"CPU: %s" % (start_args['cpu_info'],),
|
||||
"Device: %s" % (start_args['device']),
|
||||
"Linux: %s" % (start_args['linux_version']),
|
||||
"Python: %s" % (repr(sys.version),)])
|
||||
logging.info(versions)
|
||||
elif not options.debugoutput:
|
||||
|
|
|
|||
|
|
@ -131,6 +131,12 @@ def get_device_info():
|
|||
return "?"
|
||||
return data.rstrip(' \0').strip()
|
||||
|
||||
def get_linux_version():
|
||||
data = _try_read_file('/proc/version')
|
||||
if data is None:
|
||||
return "?"
|
||||
return data.strip()
|
||||
|
||||
def get_version_from_file(klippy_src):
|
||||
data = _try_read_file(os.path.join(klippy_src, '.version'))
|
||||
if data is None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue