Dobby  3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
DobbyEnv Class Reference

Basic class used to store the stb environment. More...

#include <DobbyEnv.h>

Inheritance diagram for DobbyEnv:
Inheritance graph
[legend]
Collaboration diagram for DobbyEnv:
Collaboration graph
[legend]

Public Member Functions

 DobbyEnv (const std::shared_ptr< const IDobbySettings > &settings)
 
std::string workspaceMountPath () const override
 Returns the absolute AI workspace mount point path. More...
 
std::string flashMountPath () const override
 Returns the absolute path to the AI area on flash. More...
 
std::string pluginsWorkspacePath () const override
 Returns the path to directory that plugins can write to. More...
 
std::string cgroupMountPath (Cgroup cgroup) const override
 Returns the absolute path to the cgroup mount point for the given cgroup. More...
 
uint16_t platformIdent () const override
 Returns the two byte platform identification number. More...
 

Static Private Member Functions

static std::map< IDobbyEnv::Cgroup, std::string > getCgroupMountPoints ()
 Attempts to get the mount points of the cgroup filesystems. More...
 
static uint16_t getPlatformIdent ()
 Attempts to get the STB platform identifier bytes. More...
 

Private Attributes

const std::string mWorkspacePath
 
const std::string mFlashMountPath
 
const std::string mPluginsWorkspacePath
 
const std::map< IDobbyEnv::Cgroup, std::string > mCgroupMountPaths
 
const uint16_t mPlatformIdent
 

Additional Inherited Members

- Public Types inherited from IDobbyEnv
enum class  Cgroup {
  Freezer , Memory , Cpu , CpuAcct ,
  CpuSet , Devices , Gpu , NetCls ,
  Blkio , Ion
}
 

Detailed Description

Basic class used to store the stb environment.

Used to store constant stuff, like the flash mount point and platform type.

An instance of this class is passed to all plugins when they are initialised as well as storing information for the daemon's own use.

Member Function Documentation

◆ cgroupMountPath()

std::string DobbyEnv::cgroupMountPath ( Cgroup  cgroup) const
overridevirtual

Returns the absolute path to the cgroup mount point for the given cgroup.

This is typically "/sys/fs/cgroup/<cgroup>"

Implements IDobbyEnv.

◆ flashMountPath()

std::string DobbyEnv::flashMountPath ( ) const
overridevirtual

Returns the absolute path to the AI area on flash.

This is the flash mount used to store things like package widget files and any other sort of persistent data.

The path changes depending on the platform, but the following is typical "/mnt/nds/dev_17/part_0/appmanager"

Implements IDobbyEnv.

◆ getCgroupMountPoints()

std::map< IDobbyEnv::Cgroup, std::string > DobbyEnv::getCgroupMountPoints ( )
staticprivate

Attempts to get the mount points of the cgroup filesystems.

This scans the mount table looking for the cgroups mounts, if this fails it's pretty fatal.

This is typically the name of the cgroup prefixed with "/sys/fs/cgroup"

Returns
a map of cgroup type to path

◆ getPlatformIdent()

uint16_t DobbyEnv::getPlatformIdent ( )
staticprivate

Attempts to get the STB platform identifier bytes.

The bytes should be set in the AI_PLATFORM_IDENT environment variable, if they aren't, or the env var is invalid then we return 0x0000 for the platform.

Returns
the two platform identifier bytes

◆ platformIdent()

uint16_t DobbyEnv::platformIdent ( ) const
overridevirtual

Returns the two byte platform identification number.

The following list the platforms at time of writing, for a complete list refer to https://www.stb.bskyb.com/confluence/display/SKYQ/Sky+Q+Hardware

32B0  :  Falcon (broadcom 7445)
32B1  :  FalconV2 UK (ST 419 Gateway)
32B2  :  Titan (Broadcom 7278 Gateway)
32C0  :  X-Wing (ST 412 Gateway)
32C1  :  HIP Box (SKYH412 X-Wing)
32D0  :  MR Box (ST 412 IP-Client)
7D67  :  Amidala (ST 418 Gateway Satellite)
3400  :  Amidala (ST 418 Gateway Cable)
6763  :  Amidala (ST 418 GW Satellite & Cable)
32C2  :  AX2 m-star 64bit platform

Implements IDobbyEnv.

◆ pluginsWorkspacePath()

std::string DobbyEnv::pluginsWorkspacePath ( ) const
overridevirtual

Returns the path to directory that plugins can write to.

This is non-persistent storage and is just a subdirectory of the workspace. Plugins should use this to store any temporary files, mount points, etc.

The path is typically "/mnt/nds/tmpfs/APPLICATIONS_WORKSPACE/plugins"

Implements IDobbyEnv.

◆ workspaceMountPath()

std::string DobbyEnv::workspaceMountPath ( ) const
overridevirtual

Returns the absolute AI workspace mount point path.

This is the tmpfs mount used by all AI code as a place to store non-persistent files.

The path is typically "/mnt/nds/tmpfs/APPLICATIONS_WORKSPACE"

Implements IDobbyEnv.


The documentation for this class was generated from the following files: