Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

Notes

Architectures/ISAs

I believe that no illumos distributions modify uname -srmpio, meaning that for all distributions this will be:

% uname -srmpio
SunOS 5.11 i86pc i386 i86pc Solaris

A bit more about the architecture:

% uname -mpi
i86pc i386 i86pc

uname is not very helpful on x86 - here, -m is supposed to give you the equivalent of the cpu version/release, -p is the cpu family, and -i is the hardware/system name. But this is really only available for SPARC systems, e.g. (from a Solaris(tm) box):

% uname -mpi
sun4u sparc SUNW,Sun-Fire-480R

isainfo can tell you a bit about the booted kernel's architecture, e.g.:

illumos32% isainfo -b
32
illumos32% isainfo -k
i386
illumos64% isainfo -b
64
illumos64% isainfo -k
amd64

Major Versions and Releases

I'm not sure whether it's better to say "NA" or "11" for ansible_distribution_major_version. Neither is terribly useful, OpenSolaris and thus illumos was always SunOS 5.11/Solaris 11 and I don't know of any plans from illumos to change this at any point.

ansible_distribution_release can be set using the first line of /etc/release as with Solaris(tm), but there may be better ways.

Distributions

SmartOS

SmartOS is a hypervisor OS so it makes sense to differentiate slightly between the global zone and OS zones. SmartOS can be identified with one of two methods:

  1. uname -v starts with joyent_
  2. SmartOS appears in /etc/release

Global Zone

Can be identified by the output of zonename(1) being the string global. The release version is essentially the booted kernel version.

ansible_distribution_version: uname -v (e.g. "joyent_20141212T011737Z")

/etc/release

                       SmartOS 20141212T011737Z x86_64
              Copyright 2010 Sun Microsystems, Inc.  All Rights Reserved.
              Copyright 2010-2012 Joyent, Inc.  All Rights Reserved.
                        Use is subject to license terms.

   Built with the following components:

[
        { "repo": "smartos-live", "branch": "release-20141211", "rev": "b995396ddc143f63cab46124449f00fcccb67df1", "commit_date": "1418341092", "url": "git@github.com:joyent/smartos-live.git" }
        , { "repo": "illumos-joyent", "branch": "release-20141211", "rev": "662ce04b9d2cbe2db70e6ae61a4da56c584f3a3c", "commit_date": "1418231126", "url": "http://github.com/joyent/illumos-joyent" }
        , { "repo": "illumos-extra", "branch": "release-20141211", "rev": "65ae07902ff89744c623c0ea7c7498eaa74e7399", "commit_date": "1413676011", "url": "http://github.com/joyent/illumos-extra" }
        , { "repo": "kvm", "branch": "release-20141211", "rev": "8bdb134ab2cbdd179cd0af6b4c4acf21af34fb87", "commit_date": "1418246570", "url": "http://github.com/joyent/illumos-kvm" }
        , { "repo": "kvm-cmd", "branch": "release-20141211", "rev": "f47ef85759a8ce60f20be7003f30ea6725ff13ea", "commit_date": "1418341048", "url": "http://github.com/joyent/illumos-kvm-cmd" }
        , { "repo": "mdata-client", "branch": "release-20141211", "rev": "dad0a462fa6571a2e88ebbceec7d30d5914896b9", "commit_date": "1416694236", "url": "https://github.com/joyent/mdata-client.git" }
        , { "repo": "smartos-overlay", "branch": "release-20141211", "rev": "d689fc2679e9462ba19952b993074e92f495abf8", "commit_date": "1413837014", "url": "http://github.com/joyent/smartos-overlay" }
]

uname -srvmpi

This is Solaris uname, which does not support -o.

SunOS 5.11 joyent_20141212T011737Z i86pc i386 i86pc

OS Zones

Can be identified by the output of zonename(1) being anything other than global. The release version is the version of the packaging system (pkgsrc).

ansible_distribution_version: In /etc/release (e.g. "14.3.0")

/etc/release

                                SmartOS x86_64
              Copyright 2010 Sun Microsystems, Inc.  All Rights Reserved.
              Copyright 2010-2013 Joyent, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                   See joyent_20141002T182809Z for assembly date and time.

/etc/product

Name: Joyent Instance
Image: base64 14.3.0
Documentation: http://wiki.joyent.com/jpc2/Base+Instance

uname -srvmpio

SunOS 5.11 joyent_20141212T011737Z i86pc i386 i86pc Solaris

OpenIndiana

Can be identified by one of two methods:

  1. uname -v starts with oi_
  2. OpenIndiana appears in /etc/release
ansible_distribution_version: uname -v (e.g. "oi_151a9")

/etc/release

             OpenIndiana Development oi_151.1.9 X86 (powered by illumos)
        Copyright 2011 Oracle and/or its affiliates. All rights reserved.
                        Use is subject to license terms.
                           Assembled 17 January 2014

uname -srvmpio

SunOS 5.11 oi_151a9 i86pc i386 i86pc Solaris

OmniOS

Can be identified by one of two methods:

  1. uname -v starts with omnios-
  2. OmniOS appears in /etc/release
ansible_distribution_version: head -1 /etc/release | awk '{print $NF}' (e.g. "r151012")

/etc/release

  OmniOS v11 r151012
  Copyright 2014 OmniTI Computer Consulting, Inc. All rights reserved.
  Use is subject to license terms.

uname -srvmpi

SunOS 5.11 omnios-10b9c79 i86pc i386 i86pc

NexentaStor

Can be identified by one of two methods:

  1. uname -v starts with NexentaOS_
  2. Nexenta appears in /etc/release (although this could pick up other Nexenta distros such as illumian)
ansible_distribution_version: head -1 /etc/release | awk '{print $NF}' | tr -d v (e.g. "3.1.6")

NexentaStor is the only major distro with a concept of major versions, so it may make sense to use ansible_distribution_major_version here (e.g. "3" or "4"). Especially since 3 was OpenSolaris based whereas 4 is illumos based.

/etc/release

                         Open Storage Appliance v3.1.6
           Copyright (c) 2014 Nexenta Systems, Inc.  All Rights Reserved.
           Copyright (c) 2011 Oracle.  All Rights Reserved.
                         Use is subject to license terms.
                        Open Storage Appliance 4.0.3-FP2
           Copyright (c) 2014 Nexenta Systems, Inc.  All Rights Reserved.
           Copyright (c) 2010 Oracle.  All Rights Reserved.
                        Use is subject to license terms.

uname -srvmpio

SunOS 5.11 NexentaOS_134f i86pc i386 i86pc Solaris
SunOS 5.11 NexentaOS_4:cd604cd066 i86pc i386 i86pc

Solaris(tm)

Can be identified by Solaris (or Oracle Solaris) in /etc/release, or possibly by uname -v starting with Generic_ (although this may have changed in newer releases, or some illumos distributions may use Generic_).

ansible_distribution_version: uname -r | cut -d. -f2 (e.g. "10", or use the current method that parses `/etc/release`)

/etc/release

                       Solaris 10 10/09 s10x_u8wos_08a X86
           Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                           Assembled 16 September 2009
                           Oracle Solaris 11 11/11 X86
  Copyright (c) 1983, 2011, Oracle and/or its affiliates.  All rights reserved.
                            Assembled 18 October 2011

uname -srvmpi

SunOS 5.10 Generic_141445-09 i86pc i386 i86pc
SunOS 5.11 11.0 sun4v sparc SUNW,Sun-Blade-T6320

@sskras

This comment has been minimized.

Copy link

@sskras sskras commented Apr 3, 2019

Nice one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment