26 #include "LoopMountDetails.h"
27 #include "DynamicMountDetails.h"
28 #include "MountOwnerDetails.h"
30 #include <RdkPluginBase.h>
32 #include <sys/types.h>
33 #include <netinet/in.h>
47 Storage(std::shared_ptr<rt_dobby_schema>& containerConfig,
48 const std::shared_ptr<DobbyRdkPluginUtils> &utils,
49 const std::string &rootfsPath);
52 inline std::string
name()
const override
74 bool startContainer()
override;
100 const std::string mName;
101 std::shared_ptr<rt_dobby_schema> mContainerConfig;
102 const std::string mRootfsPath;
103 const std::shared_ptr<DobbyRdkPluginUtils> mUtils;
105 uint32_t
getMappedId(uint32_t
id, rt_defs_id_mapping **mapping,
size_t mapping_len)
const;
Basic object that provides the default overrides for a plugin.
Definition: RdkPluginBase.h:34
Dobby RDK Storage Plugin.
Definition: Storage.h:45
bool postStop() override
OCI Hook - Run in host namespace. Confusing name - is run when a container is DELETED.
Definition: Storage.cpp:223
std::string name() const override
Should return the name of the plugin.
Definition: Storage.h:52
unsigned hookHints() const override
Set the bit flags for which hooks we're going to use.
Definition: Storage.cpp:58
std::vector< std::unique_ptr< LoopMountDetails > > getLoopMountDetails() const
Create loop mount details vector from all loopback mounts in config.
Definition: Storage.cpp:290
bool postStart() override
OCI Hook - Run in container namespace.
Definition: Storage.cpp:199
bool createContainer() override
OCI Hook - Run in container namespace. Paths resolve to host namespace.
Definition: Storage.cpp:147
void setupOwnerIds(uid_t &uid, gid_t &gid) const
Gets userId and groupId.
Definition: Storage.cpp:593
std::vector< MountOwnerProperties > getMountOwners() const
Reads container config to obtain source path on host, userId, groupId and recursive options....
Definition: Storage.cpp:545
Storage(std::shared_ptr< rt_dobby_schema > &containerConfig, const std::shared_ptr< DobbyRdkPluginUtils > &utils, const std::string &rootfsPath)
Constructor - called when plugin is loaded by PluginLauncher.
Definition: Storage.cpp:42
bool preCreation() override
OCI Hook - Run in host namespace.
Definition: Storage.cpp:76
std::vector< LoopMountProperties > getLoopMounts() const
Reads container config and creates all loop mounts in LoopMountProperties type objects.
Definition: Storage.cpp:331
std::vector< std::string > getDependencies() const override
Should return the names of the plugins this plugin depends on.
Definition: Storage.cpp:268
bool createRuntime() override
OCI Hook - Run in host namespace.
Definition: Storage.cpp:99
std::vector< std::unique_ptr< DynamicMountDetails > > getDynamicMountDetails() const
Create dynamic mount details vector from all dynamic mounts in config.
Definition: Storage.cpp:424
uint32_t getMappedId(uint32_t id, rt_defs_id_mapping **mapping, size_t mapping_len) const
Gets userId or groupId based on mappings.
Definition: Storage.cpp:632
std::vector< std::unique_ptr< MountOwnerDetails > > getMountOwnerDetails() const
Create mount owner details vector from all mount owners in config.
Definition: Storage.cpp:503
std::vector< DynamicMountProperties > getDynamicMounts() const
Reads container config and creates all dynamic mounts in DynamicMountProperties type objects.
Definition: Storage.cpp:459