Code review request for Linux version id fix (6986195)

Gerald Thornbrugh gerald.thornbrugh at oracle.com
Mon Sep 16 09:52:42 PDT 2013


Hi Omair,

I am the originator for the fix, Dan posted my review for me.
Sorry about the delay of my response.

In the openSuSE case the /etc/SuSE-release file seemed to have a more clear
and concise distribution information than the /etc/os-release file.

The /etc/SuSE-release file contains three lines:

openSUSE 12.3 (x86_64)
VERSION = 12.3
CODENAME = Dartmouth

This is a very concise description of the distribution.

The /etc/os-release file contains seven lines:

NAME=openSUSE
VERSION="12.3 (Dartmouth)"
VERSION_ID="12.3"
PRETTY_NAME="openSUSE 12.3 (Dartmouth) (x86_64)
ID=opensuse
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:opensuse:12.3"

I chose to place the /etc/SuSE-release file in front of the 
/etc/os-release file because the
SuSE-release file was more clear and concise than the os-release file.

I do need to update the comment.

I propose the following change:

2181 // Searching system-release (Red Hat) and os-release (other linuxes) are a
2182 // next to last resort.  The os-release file is a new standard that contains
2183 // distribution information and the os-release file seems to be an old standard
2184 // that has been  replaced by the lsb-release and os-release files.


Does this address your concerns?

Thanks!

Jerry

> Hi,
>
> On 09/12/2013 04:00 PM, Daniel D. Daugherty wrote:
>> The "lsb-release" file is the new Linux standard so it is now in the list.
>> I also added the "system-release" and "os-release" files since they are
>> an old standard.
> Actually, /etc/os-release is a fairly new thing [1] that is required by
> systemd. systemd is a new init system (among other things) used by a
> number of newer distributions, including Fedora >= 15, RHEL 7 [2], Arch
> Linux, and openSUSE [3]. So all these distributions now contain
> /etc/os-release. However, even distributions like Debian and Ubuntu
> (which only optionally support systemd) provide a valid /etc/os-release
> file [4].
>
> In fact, on these distributions, perhaps it should be searched first,
> before any of the others. Unlike /etc/lsb-release, /etc/os-release is
> always guaranteed to be present on a base install of these distributions.
>
> I see that os_print_info is called by the error handler, so it probably
> doesn't matter, but since the format of /etc/os-release is standardized,
> it should be possible to seek and print just NAME and VERSION.
>
> Thanks,
> Omair
>
> [1] http://www.freedesktop.org/software/systemd/man/os-release.html
> [2]
> http://rhsummit.files.wordpress.com/2013/06/poettering_f_0945_getting_ready_for_systemd-the-new-red-hat-enterprise-linux-7-service-manager.pdf
> [3] http://en.wikipedia.org/wiki/Systemd
> [4] https://bugs.launchpad.net/ubuntu/+source/base-files/+bug/947236



More information about the hotspot-runtime-dev mailing list