New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for /proc/sys/kernel/{ostype,version} #163
Conversation
Typically |
I took a quick skim, and it looks good so far, but I'll review this in more depth later this week. Thanks! |
On my debian 11 machine, the value of
Which the current date-parsing code doesn't really like:
Anything we can do about this? |
I created a Debian VM, and got the same result:
Seems that
I think we may use regex or other methods to handle this. However, I am afraid that we can not cover all formats... |
I looked around (and asked some friends), and it seems that Ubuntu, CentOS, and RHEL all use the date format that you've coded against. Arch linux uses something similar, but not exact:
and Debian uses this, as we discussed above:
I would prefer not to bring regex into the picture, because that's a big dependency for such a small thing. But maybe we can try a few other date formats if the first format doesn't match? Another option would be to rename the
We would then not even attempt to parse this date (though we could give examples in the documentation) |
The field in `/proc/sys/kernel/version` typically contains the kernel build date. However, its formats can vary. To avoid misunderstanding, we change the field name.
I renamed the field
|
Thanks! |
Add two structs
KernelType
andKernelBuildInfo
. The work for implementing/proc/version
should be easy as it's the combination of three substrings: