4. rtplatformids - Command line interface

The rtplatformids executable provides the command line interface to the library modules.

4.1. SYNOPSIS

rtplatformids    [OPTIONS]

4.2. OPTIONS

4.2.1. –category

Display category.

4.2.2. –debug

Activates debug output including stacktrace, multiple raise the debug level.

-d --debug[=#level]

  initial := 0,  sys.stacktrace=0
  default := +1, sys.stacktrace += 3

  When level the debug > 2: sys.stacktrace=1000

4.2.3. –debug-options

Displays the internal commandline options data with optional output format.

--debug-options[=('json' | 'repr' | 'str')[ cont]]

  default := 'json'

For export streams refer to –out-format.

4.2.4. –dist

Display distribution.

4.2.5. –distrel

Display release of the distribution.

4.2.6. –distrel-hexversion

Display the release of the distribution including the canonical version as hex-bit-array.

4.2.7. –distrel-key

Display name of the selection key of the distribution release. Used for internal mapping-tables to be used as debugging support.

4.2.8. –distrel-name

Display name of the distribution release.

4.2.9. –dist-vers

Display the version array the distribution release.

4.2.10. –enumerate

Enumerates the known platform entries.

--enumerate [<type>] [num=<num>] [scope=<scope>]

  filter:
     type := (
        all
        | category
        | ostype
        | dist
        | distrel
     )

  number format:
     num := (
        int       # integer
        | hex     # hex
        | bit     # bitarray
        | sym     # symbolic enum names
     )

  filter:
     scope := (
        all       # all
        | numkey  # numeric keys
        | strkey  # string keys
     )

  num padding:
     pad := (
        on | 1 | true       # show all
        | off | 0 | false   # suppress padding entries with "k == v"
     )

  reverse mapping:
     reverse := (
        on | 1 | true       # num2rte
        | off | 0 | false   # rte2num
     )

4.2.11. –environ

Print environ.

4.2.12. –fromfile

Enables the read of options from an options file. For details refer to argparse.ArgumentParse constructor option fromfile_prefix_chars.

4.2.13. –help

This help.

--help
-h

4.2.14. –load

Loads additional modules:

--load <filepathname>

  filepathname:  The file system path name of the source module to be loaded.
                 The file path must be fully qualified including extension,
                 either absolute, or relative.

The interface of current version supports the load bitmask mapping onto string names. The interface is simply the loadtime update of one of the following dictionaries platformids.ProtectedDict. The maps are:

  • platformids.num2rte

  • platformids.rte2num

  • platformids.num2enumstr

For examples and templates refer to platformids/map_enum_labels and the directory platformids/dist.

The basic principle is as for example in case of Solaris:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from platformids import RTE_SOLARIS, rte2num, num2rte

RTE_SOLARIS10 = RTE_SOLARIS  + 0x00000100  #: Solaris-10
RTE_SOLARIS11 = RTE_SOLARIS  + 0x00000200  #: Solaris-11

rte2num.update(
    {
        'SunOS5': RTE_SOLARIS,
        'sunos5': RTE_SOLARIS,
        'sunos5.10': RTE_SOLARIS10,
        'sunos5.11': RTE_SOLARIS11,
        'solaris10': RTE_SOLARIS10,
        'solaris11': RTE_SOLARIS11,
        RTE_SOLARIS10: RTE_SOLARIS10,
        RTE_SOLARIS11: RTE_SOLARIS11,
    }
)

num2rte.update(
    {
        RTE_SOLARIS: 'solaris',
        RTE_SOLARIS10: 'solaris10',
        RTE_SOLARIS11: 'solaris11',
    }
)

The optional mapping of symbolic enumeration labels for bitmasks e.g. in case of platformids.dist.solaris_enum_labels is:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
from __future__ import absolute_import

from platformids import *  # @UnusedWildImport
from platformids.dist import *  # @UnusedWildImport

from platformids.dist.solaris import *  # @UnusedWildImport

num2enumstr.update(
    {
        RTE_SOLARIS10: "RTE_SOLARIS10",
        RTE_SOLARIS11: "RTE_SOLARIS11",
    }
)

4.2.15. –ostype-id

Display the ID of the OS release.

4.2.16. –ostype-version

Display the version array the OS release.

4.2.17. –ostype

Display ostype.

4.2.18. –out-format

Defines the processed output format.

--out-format=<format>

  format := (
     'json'
     | 'raw'
     | 'repr' | 'str'
     | 'basharray' | 'bashvars'
  )

Supports normal data display, not the ‘–platform’ and ‘–enumerate’ options.

4.2.19. –platform

Display selected parameters from standard libraries:

  • os

  • sys

  • platform

4.2.20. –quiet

Suppress output.

4.2.21. –Version

Current version - detailed.

--Version
-Version

4.2.22. –verbose

Verbose, some relevant states for basic analysis. When ‘–selftest’ is set, repetition raises the display level.

--verbose
-v

4.2.23. –version

Current version - terse.

--version
-version

4.2.24. –terse

Print short - terse.

4.3. DESCRIPTION

The call interface ‘rtplatformids’ provides the commandline interface for the platform scanner.

4.4. EXAMPLES

Some simple call examples are:

platformids  –help

rtplatformids
rtplatformids  –platform
rtplatformids  –out-format json

Some more elaborate call examples with custom load:

rtplatformids.py –enumerate  all  pad=off reverse=0 num=sym \
   –load platformids/dist/fedora_enum_labels.py \
   –load platformids/dist/windows_enum_labels.py