SystemConfig: show WSL version if available on Linux
This commit is contained in:
parent
e76c55e184
commit
55c82749ad
@ -40,10 +40,20 @@ module SystemConfig
|
|||||||
out
|
out
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def wsl_version(kernel)
|
||||||
|
return "no" unless /-microsoft/i.match?(kernel)
|
||||||
|
|
||||||
|
return "2 (store)" if Version.new kernel[/Linux ([0-9.]*)-.*/, 1] > Version.new("5.15")
|
||||||
|
return "2" if /-microsoft/.match?(kernel)
|
||||||
|
return "1" if /-Microsoft/.match?(kernel)
|
||||||
|
end
|
||||||
|
|
||||||
def dump_verbose_config(out = $stdout)
|
def dump_verbose_config(out = $stdout)
|
||||||
|
kernel = Utils.safe_popen_read("uname", "-mors").chomp
|
||||||
dump_generic_verbose_config(out)
|
dump_generic_verbose_config(out)
|
||||||
out.puts "Kernel: #{`uname -mors`.chomp}"
|
out.puts "Kernel: #{kernel}"
|
||||||
out.puts "OS: #{OS::Linux.os_version}"
|
out.puts "OS: #{OS::Linux.os_version}"
|
||||||
|
out.puts "WSL: #{wsl_version(kernel)}"
|
||||||
out.puts "Host glibc: #{host_glibc_version}"
|
out.puts "Host glibc: #{host_glibc_version}"
|
||||||
out.puts "/usr/bin/gcc: #{host_gcc_version}"
|
out.puts "/usr/bin/gcc: #{host_gcc_version}"
|
||||||
out.puts "/usr/bin/ruby: #{host_ruby_version}" if RUBY_PATH != HOST_RUBY_PATH
|
out.puts "/usr/bin/ruby: #{host_ruby_version}" if RUBY_PATH != HOST_RUBY_PATH
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user