Re: [PATCH] Fix incorrect OS reporting in uname -o

2013-09-19 Thread Denys Vlasenko
On Wed, Sep 18, 2013 at 12:56 AM, Rich Felker dal...@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.

There should be a reason why this is useful...
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: [PATCH] Fix incorrect OS reporting in uname -o

2013-09-19 Thread Rich Felker
On Thu, Sep 19, 2013 at 04:18:59PM +0200, Denys Vlasenko wrote:
 On Wed, Sep 18, 2013 at 12:56 AM, Rich Felker dal...@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
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: [PATCH] Fix incorrect OS reporting in uname -o

2013-09-18 Thread Laurent Bercot



But I'd call such a system BusyBox/Linux instead, since BusyBox is the
userspace, regardless of the C library in my opinion.


 How do you know for sure ?
 Busybox isn't the only alternative userspace. There are other several,
if lesser-known, projects that provide low-level userspace tools.
toybox is one. s6-portable-utils + s6-linux-utils is another. And they
are certainly not the only ones.

 In 2000, I have built a server without GNU software just to contradict RMS,
who was insisting that I should call my system GNU/Linux instead of Linux.
Don't make me build a server without GNU *and* without Busybox just to
contradict you. ;)

--
 Laurent


___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: [PATCH] Fix incorrect OS reporting in uname -o

2013-09-18 Thread Rich Felker
On Wed, Sep 18, 2013 at 05:29:48PM +0800, ChenQi wrote:
 On 09/18/2013 04:47 PM, Pere wrote:
 On Wed, Sep 18, 2013 at 9:18 AM, Laurent Bercot
 ska-dietl...@skarnet.org wrote:
 But I'd call such a system BusyBox/Linux instead, since BusyBox is the
 userspace, regardless of the C library in my opinion.
 
   How do you know for sure ?
 
 Because this is Busybox's uname.
 
 I think it's possible that there are several uname providers in the
 system, and busybox is just one of them.
 Invoking busybox != The userpace is busybox

This is why my patch simply proposes removing the incorrect GNU/
part of the uname rather than assuming some other name applies. If
others would prefer removing the GNU/ prefix unconditionally, I have
no objection, but my intent was to be conservative and merely remove
it in cases where there's no justification for calling the system a
GNU/Linux system.

Rich
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: [PATCH] Fix incorrect OS reporting in uname -o

2013-09-18 Thread Patrick 'P. J.' McDermott
On 2013-09-18 04:18, Laurent Bercot wrote:
 
 But I'd call such a system BusyBox/Linux instead, since BusyBox is the
 userspace, regardless of the C library in my opinion.
 
  How do you know for sure ?

As Pere said, because this is BusyBox uname.

If the uname is provided by BusyBox, the userspace is probably BusyBox
(just like GNU uname assumes the userspace is GNU).

  Busybox isn't the only alternative userspace. There are other several,
 if lesser-known, projects that provide low-level userspace tools.
 toybox is one. s6-portable-utils + s6-linux-utils is another. And they
 are certainly not the only ones.

Right.  But Toybox has its own uname [1][2], so BusyBox uname won't be
installed on a Toybox-based system (which of course is not a
BusyBox/Linux or GNU/Linux system).

Running BusyBox uname on a non-BusyBox system (that is, configuring
BusyBox to build only the uname applet and little or nothing else) makes
no sense.

[1]: http://www.landley.net/toybox/status.html#done
[2]: http://www.landley.net/hg/toybox/file/tip/toys/posix/uname.c

  In 2000, I have built a server without GNU software just to contradict RMS,
 who was insisting that I should call my system GNU/Linux instead of Linux.
 Don't make me build a server without GNU *and* without Busybox just to
 contradict you. ;)

If you do, then GNU uname won't be able to call the system GNU/Linux
and BusyBox uname won't be able to call it BusyBox/Linux, because it
actually won't be either.  That doesn't contradict me at all.

-- 
Patrick P. J. McDermott
  http://www.pehjota.net/
Lead Developer, ProteanOS
  http://www.proteanos.com/
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: [PATCH] Fix incorrect OS reporting in uname -o

2013-09-18 Thread Laurent Bercot

  How do you know for sure ?

As Pere said, because this is BusyBox uname.


 That would only prove that the uname implementation is Busybox's. That
wouldn't say anything about the rest of the system.



Running BusyBox uname on a non-BusyBox system (that is, configuring
BusyBox to build only the uname applet and little or nothing else) makes
no sense.


 I guess I make no sense then, because it's exactly what I do. I build
my servers from bits and pieces of software, in the original Linux from
scratch spirit; I use Busybox when I don't have a better implementation
of some functionality. That's the way the OS has become what it is today,
that's what free software is about, even if that kind of creativity has
of course diminished over the last fifteen-or-so years.
 The GNU tendency to take over the machine and pretend to provide absolutely
everything a user might ever need while disregarding quality smells a bit too
much like Microsoft in my opinion; and I'm not particularly happy when people
try to push Busybox in that direction too (even if the quality is orders of
magnitude better).

 Call the kernel Linux, even if it's patched, because nobody will build a
kernel from bits and pieces: the kernel is monolithic and cathedral-like,
and it has a strong identity. But as much as GNU would love to, it's
impossible to label userspace. Userspace is a bazaar, even on mainstream
distribution you have endless sources of software, and it's fine the way
it is. I'm very glad to have Busybox as part of my system, but I really
do not want Busybox to claim it IS my system.

--
 Laurent


___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: [PATCH] Fix incorrect OS reporting in uname -o

2013-09-18 Thread Patrick 'P. J.' McDermott
On 2013-09-18 12:38, Laurent Bercot wrote:
   How do you know for sure ?
 As Pere said, because this is BusyBox uname.
 
  That would only prove that the uname implementation is Busybox's. That
 wouldn't say anything about the rest of the system.

Anyone running BusyBox uname on a non-BusyBox system can easily patch
coreutils/uname.c to change the output of `uname -o`.

I suggest that BusyBox/Linux be the default otherwise.  Perhaps this
could be added as an option to Kconfig to obviate a patch.

-- 
Patrick P. J. McDermott
  http://www.pehjota.net/
Lead Developer, ProteanOS
  http://www.proteanos.com/
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: [PATCH] Fix incorrect OS reporting in uname -o

2013-09-18 Thread Pere
On Wed, Sep 18, 2013 at 10:13 PM, Aaro Koskinen aaro.koski...@iki.fi wrote:
 Hi,

 On Tue, Sep 17, 2013 at 11:47:55PM -0400, Patrick 'P. J.' McDermott wrote:
 On 2013-09-17 18:56, Rich Felker wrote:
  -   strcpy(uname_info.os, GNU/Linux);
  +   strcpy(uname_info.os,
  +#ifdef __GLIBC__
  +   GNU/
  +#endif
  +   Linux);

 I'd agree that most BusyBox-based systems can hardly be called
 GNU/Linux, even with glibc.  It seems inappropriate to call a system
 GNU if it has little or no GNU software.

 Maybe in the case when GNU toolchain was not used to compile the system?

 But I'd call such a system BusyBox/Linux instead, since BusyBox is the
 userspace, regardless of the C library in my opinion.

 My systems have uname from busybox, but I also have ~80 other packages
 installed, so BusyBox/Linux would be also wrong. Maybe it should
 be configurable.

I don't think BusyBox/Linux is a good idea. And I can't see that
making it configurable solves a real issue.

Regarding the original patch, not that my opinion matters, but if
BusyBox tries to match GNU behaviour in most situations, and Busybox
partially derives from GNU source code, then the current behaviour
makes sense.

--
Pere
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: [PATCH] Fix incorrect OS reporting in uname -o

2013-09-18 Thread Aaro Koskinen
Hi,

On Tue, Sep 17, 2013 at 11:47:55PM -0400, Patrick 'P. J.' McDermott wrote:
 On 2013-09-17 18:56, Rich Felker wrote:
  -   strcpy(uname_info.os, GNU/Linux);
  +   strcpy(uname_info.os,
  +#ifdef __GLIBC__
  +   GNU/
  +#endif
  +   Linux);
 
 I'd agree that most BusyBox-based systems can hardly be called
 GNU/Linux, even with glibc.  It seems inappropriate to call a system
 GNU if it has little or no GNU software.

Maybe in the case when GNU toolchain was not used to compile the system?

 But I'd call such a system BusyBox/Linux instead, since BusyBox is the
 userspace, regardless of the C library in my opinion.

My systems have uname from busybox, but I also have ~80 other packages
installed, so BusyBox/Linux would be also wrong. Maybe it should
be configurable.

A.
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: [PATCH] Fix incorrect OS reporting in uname -o

2013-09-18 Thread Tito
On Wednesday 18 September 2013 23:19:51 Pere wrote:
 On Wed, Sep 18, 2013 at 10:13 PM, Aaro Koskinen aaro.koski...@iki.fi wrote:
  Hi,
 
  On Tue, Sep 17, 2013 at 11:47:55PM -0400, Patrick 'P. J.' McDermott wrote:
  On 2013-09-17 18:56, Rich Felker wrote:
   -   strcpy(uname_info.os, GNU/Linux);
   +   strcpy(uname_info.os,
   +#ifdef __GLIBC__
   +   GNU/
   +#endif
   +   Linux);
 
  I'd agree that most BusyBox-based systems can hardly be called
  GNU/Linux, even with glibc.  It seems inappropriate to call a system
  GNU if it has little or no GNU software.
 
  Maybe in the case when GNU toolchain was not used to compile the system?
 
  But I'd call such a system BusyBox/Linux instead, since BusyBox is the
  userspace, regardless of the C library in my opinion.
 
  My systems have uname from busybox, but I also have ~80 other packages
  installed, so BusyBox/Linux would be also wrong. Maybe it should
  be configurable.
 
 I don't think BusyBox/Linux is a good idea. And I can't see that
 making it configurable solves a real issue.
 
 Regarding the original patch, not that my opinion matters, but if
 BusyBox tries to match GNU behaviour in most situations, and Busybox
 partially derives from GNU source code, then the current behaviour
 makes sense.
 
 --
 Pere

Hi,
GNU/Linux as default value is perfectly in line with the statement
on the About section of the busybox website:

BusyBox combines tiny versions of many common UNIX utilities into a single 
small executable.
It provides replacements for most of the utilities you usually find in ___GNU__ 
 fileutils, shellutils, etc.
The utilities in BusyBox generally have fewer options than their full-featured 
__GNU__ cousins;
however, the options that are included provide the expected functionality and 
behave
very much like their __GNU__ counterparts.

BTW, i suspect that busybox could be compiled and run also on non linux systems
so the next step would be to also make the Linux part somehow configurable.

A better solution at this point could be to not build the busybox uname applet
and use the native one or use a simple wrapper:

#!/bin/sh
busybox uname $@ | sed  's/GNU\/Linux/MyLibc\/MyKernel/'

Ciao,
Tito


___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: [PATCH] Fix incorrect OS reporting in uname -o

2013-09-17 Thread Patrick 'P. J.' McDermott
On 2013-09-17 18:56, Rich Felker wrote:
 - strcpy(uname_info.os, GNU/Linux);
 + strcpy(uname_info.os,
 +#ifdef __GLIBC__
 + GNU/
 +#endif
 + Linux);

I'd agree that most BusyBox-based systems can hardly be called
GNU/Linux, even with glibc.  It seems inappropriate to call a system
GNU if it has little or no GNU software.

But I'd call such a system BusyBox/Linux instead, since BusyBox is the
userspace, regardless of the C library in my opinion.

-   strcpy(uname_info.os, GNU/Linux);
+   strcpy(uname_info.os, BusyBox/Linux);

-- 
Patrick P. J. McDermott
  http://www.pehjota.net/
Lead Developer, ProteanOS
  http://www.proteanos.com/
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox