1956 /usr/bin/uname '-o' should return 'Illumos'

Review Request #850 — Created Feb. 8, 2018 and submitted

citrus
illumos-gate
master
8804884...
general

1956 /usr/bin/uname '-o' should return 'Illumos'

This is based on Andy Stormont's patch attached to the issue (https://illumos.org/issues/1956) but I've additionally:

  • Made "illumos" lower-case as discussed in the issue;
  • Stopped uname -a from including the OS at the end of the line to retain backwards compatibility for any consumers;
  • Updated the syntax line in the man page and moved the new -o block into its alphabetic place;
  • Added a couple of pbchk cleanups.

bloody% cat /etc/motd
The Illumos Project     SunOS 5.11      illumos-gate    February 2018
bloody% uname
SunOS
bloody% uname -a
SunOS bloody 5.11 illumos-gate i86pc i386 i86pc
bloody% uname -o
illumos
bloody% uname -X
System = SunOS
Node = bloody
Release = 5.11
KernelID = illumos-gate
Machine = i86pc
BusType = <unknown>
Serial = <unknown>
Users = <unknown>
OEM# = 0
Origin# = 1
NumCPU = 16

So no changes apart from a new -o option.

wiedi
  1. Ship It!
  2. 
      
ptribble
  1. Why go via systeminfo when you could just hardcode "illumos" into the uname binary and not modify systeminfo at all?

    Most of the point of using systeminfo is for information that varies between systems, that's not the case here, so putting a fixed string there doesn't make a lot of sense.

    1. If we're going to print out the kernel identity, then it feels like we should actually ask the kernel what it is.

    2. Is this the kernel identity, though?

      If both uname and the kernel agree, then it doesn't matter; at which point why have a complex implementation rather than simply hardcoding it in uname?

      If you want to change it for some reason, then it would be easier to simply change it in uname and ship a new uname rather than having to build a new OS.

      The circumstance in which asking the kernel becomes interesting is that in which the kernel and the uname binary come from different sources. Consider zones, for instance, but there are others. In which case I would expect 'uname -o' to tell me the name of the userland, rather than the underlying kernel. (Or you need to provide a mechanism for the zone brand to interpose on this call and give a different answer.)

      As an extreme example, does 'uname -o' in a LX zone return illumos or Linux?

      I'm 100% in favour of doing this, but I think the implementation is wrong.

  2. 
      
rejohnst
  1. Ship It!
  2. 
      
citrus
yuripv
  1. Ship It!
  2. 
      
hans
  1. Ship It!
  2. 
      
citrus
ptribble
  1. Ship It!
  2. 
      
wiedi
  1. Ship It!
  2. 
      
hans
  1. Ship It!
  2. 
      
citrus
Review request changed

Status: Closed (submitted)

Loading...