[PATCH] Fix incorrect OS reporting in uname -o

Rich Felker dalias at aerifal.cx
Thu Sep 19 14:37:34 UTC 2013


On Thu, Sep 19, 2013 at 04:18:59PM +0200, Denys Vlasenko wrote:
> On Wed, Sep 18, 2013 at 12:56 AM, Rich Felker <dalias at aerifal.cx> wrote:
> > See attached.
> 
> What is the point of such a change?
> 
> People (presumably) use uname -o to determine whether
> the OS is Linux, or BSD, or other Unix.
> 
> On Fedora, it says "GNU/Linux". I suspect many other distros have the same.
> 
> My guess is, whoever parses "uname -o" has his code prepared
> to understand "GNU/Linux".
> This may be not the case with bare "Linux"!
> 
> This change can create someone's scripts.

Does anyone use "uname -o"? My understanding is that the entire reason
it was added to coreutils (it's nonstandard, BTW) was political: the
FSF wanted to change "uname -s" to print "GNU/Linux", either by
changing the syscall behavior in the kernel or patching up the
results. Of course the kernel folks said no (or it was just assumed
that they would), and distros also said no (such a change would be
patched out by distros for the exact reason you mentioned -- breaking
scripts), so their only option was to add a new useless option to
print "GNU/Linux".

Please correct me if my understanding of the history is wrong.

> There should be a reason why this is useful...

There are a number of people who do not want their systems
misrepresented as being GNU systems when they're not. Often this is
just political, but it may be relevant in some corporate environments
that have policies against GNU software being used for (dubious) legal
reasons.

As for what constitutes a non-GNU Linux system, that may be hard to
nail down exactly, but I think that the conditions (1) not using
glibc, and (2) using Busybox instead of coreutils, are more than
sufficient to be non-GNU. Even if other GNU components are installed,
it's clearly not a "GNU OS".

Rich


More information about the busybox mailing list