lfreist / hwinfo

cross platform C++ library for hardware information (CPU, RAM, GPU, ...)
MIT License
438 stars 76 forks source link

Use os-release instead of lsb-release for Linux OS Information #41

Closed egecetin closed 1 year ago

egecetin commented 1 year ago

For some linux distributions (eg Rocky Linux) lsb-release file does not exist. So, the OS output of the example code shows unknown fields,

----------------------------------- OS ------------------------------------
Operating System:   Linux <unknown version>
short name:         Linux
version:            <unknown version>
kernel:             4.18.0-372.19.1.el8_6.x86_64
architecture:       64 bit
endianess:          little endian

If the library uses os-release instead of the lsb-release file, the library can parse the information correctly,

----------------------------------- OS ------------------------------------
Operating System:   Rocky Linux 8.6 (Green Obsidian)
short name:         Rocky Linux
version:            8.6
kernel:             4.18.0-372.19.1.el8_6.x86_64
architecture:       64 bit
endianess:          little endian