sbuild
1.7.1
|
Base class for all facets. More...
#include <facet.h>
Public Types | |
enum | session_flags { SESSION_NOFLAGS = 0, SESSION_CREATE = 1 << 0, SESSION_CLONE = 1 << 1, SESSION_PURGE = 1 << 2 } |
Chroot session properties. More... | |
typedef std::shared_ptr< facet > | ptr |
A shared_ptr to a chroot facet object. | |
typedef std::shared_ptr< const facet > | const_ptr |
A shared_ptr to a const chroot facet object. | |
Public Member Functions | |
virtual | ~facet () |
The destructor. | |
virtual ptr | clone () const =0 |
Copy the chroot facet. More... | |
virtual std::string const & | get_name () const =0 |
Get the name of the chroot facet. More... | |
virtual void | setup_env (environment &env) const |
Set environment. More... | |
virtual session_flags | get_session_flags () const |
Get the session flags of the chroot. More... | |
virtual void | get_details (format_detail &detail) const |
Get detailed information about the chroot for output. More... | |
virtual void | get_used_keys (string_list &used_keys) const |
Get a list of the keys used during keyfile parsing. More... | |
virtual void | get_keyfile (keyfile &keyfile) const |
Copy the chroot properties into a keyfile. More... | |
virtual void | set_keyfile (const keyfile &keyfile) |
Set the chroot properties from a keyfile. More... | |
Protected Member Functions | |
facet () | |
The constructor. | |
virtual void | set_chroot (chroot &chroot, bool copy=false) |
Set containing chroot. More... | |
Protected Attributes | |
chroot * | owner |
Chroot owning this facet. | |
Friends | |
class | ::sbuild::chroot::chroot |
Base class for all facets.
This class provides the basic interfaces and properties required for all facets. All facets must be derived from this type. Note that this class can not be used independently of a chroot, and most methods can not be called until the instance is installed in a chroot instance using chroot::add_facet() or related methods.
|
pure virtual |
Copy the chroot facet.
This is a virtual copy constructor.
Implemented in sbuild::chroot::facet::block_device, sbuild::chroot::facet::directory, sbuild::chroot::facet::custom, sbuild::chroot::facet::btrfs_snapshot, sbuild::chroot::facet::fsunion, sbuild::chroot::facet::file, sbuild::chroot::facet::loopback, sbuild::chroot::facet::lvm_snapshot, sbuild::chroot::facet::userdata, sbuild::chroot::facet::plain, sbuild::chroot::facet::unshare, sbuild::chroot::facet::mountable, sbuild::chroot::facet::session, sbuild::chroot::facet::source_clonable, sbuild::chroot::facet::source, sbuild::chroot::facet::session_clonable, and sbuild::chroot::facet::personality.
|
virtual |
Get detailed information about the chroot for output.
detail | the details to output to. |
Reimplemented in sbuild::chroot::facet::fsunion, sbuild::chroot::facet::source_clonable, sbuild::chroot::facet::btrfs_snapshot, sbuild::chroot::facet::file, sbuild::chroot::facet::unshare, sbuild::chroot::facet::lvm_snapshot, sbuild::chroot::facet::mountable, sbuild::chroot::facet::session, sbuild::chroot::facet::loopback, sbuild::chroot::facet::block_device_base, sbuild::chroot::facet::directory_base, sbuild::chroot::facet::userdata, and sbuild::chroot::facet::personality.
|
virtual |
Copy the chroot properties into a keyfile.
The keyfile group with the name of the chroot will be set; if it already exists, it will be removed before setting it.
keyfile | the keyfile to use. |
Reimplemented in sbuild::chroot::facet::fsunion, sbuild::chroot::facet::source_clonable, sbuild::chroot::facet::btrfs_snapshot, sbuild::chroot::facet::file, sbuild::chroot::facet::unshare, sbuild::chroot::facet::custom, sbuild::chroot::facet::lvm_snapshot, sbuild::chroot::facet::mountable, sbuild::chroot::facet::session, sbuild::chroot::facet::loopback, sbuild::chroot::facet::block_device_base, sbuild::chroot::facet::directory_base, sbuild::chroot::facet::userdata, and sbuild::chroot::facet::personality.
|
pure virtual |
Get the name of the chroot facet.
Implemented in sbuild::chroot::facet::fsunion, sbuild::chroot::facet::userdata, sbuild::chroot::facet::block_device, sbuild::chroot::facet::directory, sbuild::chroot::facet::custom, sbuild::chroot::facet::btrfs_snapshot, sbuild::chroot::facet::unshare, sbuild::chroot::facet::file, sbuild::chroot::facet::loopback, sbuild::chroot::facet::mountable, sbuild::chroot::facet::session, sbuild::chroot::facet::source_clonable, sbuild::chroot::facet::source, sbuild::chroot::facet::lvm_snapshot, sbuild::chroot::facet::session_clonable, sbuild::chroot::facet::personality, and sbuild::chroot::facet::plain.
Referenced by sbuild::chroot::chroot::get_chroot_type().
|
virtual |
Get the session flags of the chroot.
These determine how the Session controlling the chroot will operate.
chroot | the chroot to use. |
Reimplemented in sbuild::chroot::facet::fsunion, sbuild::chroot::facet::source_clonable, sbuild::chroot::facet::btrfs_snapshot, sbuild::chroot::facet::file, sbuild::chroot::facet::custom, sbuild::chroot::facet::lvm_snapshot, and sbuild::chroot::facet::session_clonable.
References SESSION_NOFLAGS.
|
virtual |
Get a list of the keys used during keyfile parsing.
Reimplemented in sbuild::chroot::facet::fsunion, sbuild::chroot::facet::source_clonable, sbuild::chroot::facet::btrfs_snapshot, sbuild::chroot::facet::file, sbuild::chroot::facet::unshare, sbuild::chroot::facet::custom, sbuild::chroot::facet::lvm_snapshot, sbuild::chroot::facet::mountable, sbuild::chroot::facet::session, sbuild::chroot::facet::loopback, sbuild::chroot::facet::block_device_base, sbuild::chroot::facet::directory_base, sbuild::chroot::facet::userdata, and sbuild::chroot::facet::personality.
|
protectedvirtual |
Set containing chroot.
The copy parameter is used to inform the facet if it is new or a copy; this is intended to allow additional facets to only be added if the facet is new, for example, to avoid re-adding removed facets when copying a chroot.
chroot | the chroot containing this facet. |
copy | true if the facet has been copied, or false if this is a new instance. |
Reimplemented in sbuild::chroot::facet::block_device_base, sbuild::chroot::facet::custom, sbuild::chroot::facet::block_device, sbuild::chroot::facet::btrfs_snapshot, sbuild::chroot::facet::directory, sbuild::chroot::facet::file, sbuild::chroot::facet::loopback, and sbuild::chroot::facet::lvm_snapshot.
References owner.
Referenced by sbuild::chroot::facet::file::set_chroot(), sbuild::chroot::facet::loopback::set_chroot(), sbuild::chroot::facet::directory::set_chroot(), sbuild::chroot::facet::btrfs_snapshot::set_chroot(), sbuild::chroot::facet::custom::set_chroot(), and sbuild::chroot::facet::block_device_base::set_chroot().
|
virtual |
Set the chroot properties from a keyfile.
The chroot name must have previously been set, so that the correct keyfile group may be determined.
keyfile | the keyfile to get the properties from. |
Reimplemented in sbuild::chroot::facet::fsunion, sbuild::chroot::facet::source_clonable, sbuild::chroot::facet::btrfs_snapshot, sbuild::chroot::facet::file, sbuild::chroot::facet::unshare, sbuild::chroot::facet::custom, sbuild::chroot::facet::lvm_snapshot, sbuild::chroot::facet::mountable, sbuild::chroot::facet::session, sbuild::chroot::facet::loopback, sbuild::chroot::facet::block_device_base, sbuild::chroot::facet::directory_base, sbuild::chroot::facet::userdata, and sbuild::chroot::facet::personality.
|
virtual |
Set environment.
Set the environment that the setup scripts will see during execution.
env | the environment to set. |
Reimplemented in sbuild::chroot::facet::fsunion, sbuild::chroot::facet::unshare, sbuild::chroot::facet::btrfs_snapshot, sbuild::chroot::facet::file, sbuild::chroot::facet::mountable, sbuild::chroot::facet::lvm_snapshot, sbuild::chroot::facet::session, sbuild::chroot::facet::loopback, sbuild::chroot::facet::block_device_base, sbuild::chroot::facet::userdata, and sbuild::chroot::facet::directory_base.