#include <sbuild-chroot.h>
Inheritance diagram for sbuild::Chroot:
Public Types | |
typedef runtime_error_custom< Chroot > | error |
Exception type. | |
typedef std::tr1::shared_ptr< Chroot > | chroot_ptr |
A shared_ptr to an AuthConv object. | |
enum | SetupType { SETUP_START, SETUP_RECOVER, SETUP_STOP, RUN_START, RUN_STOP } |
Type of setup to perform. More... | |
enum | SessionFlags { SESSION_CREATE = 1 << 0 } |
Chroot session properties. More... | |
Public Member Functions | |
virtual | ~Chroot () |
The destructor. | |
virtual chroot_ptr | clone () const =0 |
Copy the chroot. | |
std::string const & | get_name () const |
Get the name of the chroot. | |
void | set_name (std::string const &name) |
Set the name of the chroot. | |
std::string const & | get_description () const |
Get the description of the chroot. | |
void | set_description (std::string const &description) |
Set the description of the chroot. | |
virtual std::string const & | get_mount_location () const |
Get the mount location of the chroot. | |
void | set_mount_location (std::string const &location) |
Set the mount location of the chroot. | |
virtual std::string const & | get_mount_device () const |
Get the mount device of the chroot. | |
void | set_mount_device (std::string const &device) |
Set the mount device of the chroot. | |
unsigned int | get_priority () const |
Get the priority of the chroot. | |
void | set_priority (unsigned int priority) |
Set the priority of a chroot. | |
string_list const & | get_groups () const |
Get the groups allowed to access the chroot. | |
void | set_groups (string_list const &groups) |
Set the groups allowed to access the chroot. | |
string_list const & | get_root_groups () const |
Get the groups allowed to access the chroot as root. | |
void | set_root_groups (string_list const &groups) |
Set the groups allowed to access the chroot as root. | |
string_list const & | get_aliases () const |
Get the aliases of the chroot. | |
void | set_aliases (string_list const &aliases) |
Set the aliases of the chroot. | |
bool | get_active () const |
Get the activity status of the chroot. | |
void | set_active (bool active) |
Set the activity status of the chroot. | |
bool | get_run_setup_scripts () const |
Check if chroot setup scripts will be run. | |
void | set_run_setup_scripts (bool run_setup_scripts) |
Set whether chroot setup scripts will be run. | |
bool | get_run_session_scripts () const |
Check if chroot session scripts will be run. | |
void | set_run_session_scripts (bool run_session_scripts) |
Set whether chroot session scripts will be run. | |
virtual std::string const & | get_chroot_type () const =0 |
Get the type of the chroot. | |
virtual void | setup_env (environment &env) |
Set environment. | |
virtual void | setup_lock (SetupType type, bool lock)=0 |
Lock a chroot during setup. | |
virtual SessionFlags | get_session_flags () const =0 |
Get the session flags of the chroot. | |
virtual void | print_details (std::ostream &stream) const |
Print detailed information about the chroot to a stream. | |
virtual void | print_config (std::ostream &stream) const |
Print the configuration group for a chroot in the format required by schroot.conf. | |
Static Public Member Functions | |
static chroot_ptr | create (std::string const &type) |
Create a chroot. | |
static chroot_ptr | create (keyfile const &keyfile, std::string const &group) |
Create a chroot. | |
Protected Member Functions | |
Chroot () | |
The constructor. | |
Chroot (keyfile const &keyfile, std::string const &group) | |
The constructor. | |
virtual void | setup_session_info (bool start) |
Set up persistent session information. | |
template<typename T> | |
format_detail< T > | format_details (std::string const &name, T const &value) const |
Format a name-value pair for output. | |
Private Attributes | |
std::string | name |
Chroot name. | |
std::string | description |
Chroot description. | |
unsigned int | priority |
Chroot prioroty. | |
string_list | groups |
Groups allowed to access the chroot. | |
string_list | root_groups |
Groups allowed to access the chroot as root. | |
string_list | aliases |
Alternative names for the chroot. | |
std::string | mount_location |
Location to mount chroot in the filesystem (if any). | |
std::string | mount_device |
Block device to mount (if any). | |
bool | active |
Chroot activity status. | |
bool | run_setup_scripts |
Run chroot setup scripts? | |
bool | run_session_scripts |
Run session setup scripts? | |
Classes | |
class | format_detail |
Helper to perform formatting of chroot details. More... |
This class contains all of the metadata associated with a single chroot, for all chroot types. This is the in-core representation of a chroot definition in the configuration file, and may be initialised directly from an open keyfile.
|
A shared_ptr to an AuthConv object.
|
|
Exception type.
|
|
Chroot session properties.
|
|
Type of setup to perform.
|
|
The constructor.
|
|
The constructor. Initialise from an open keyfile.
|
|
The destructor.
|
|
Copy the chroot. This is a virtual copy constructor.
Implemented in sbuild::ChrootBlockDevice, sbuild::ChrootFile, sbuild::ChrootLvmSnapshot, and sbuild::ChrootPlain. |
|
Create a chroot. This is a factory function.
|
|
Create a chroot. This is a factory function.
|
|
Format a name-value pair for output. This is a convenience wrapper to construct a format_detail of the appropriate type.
|
|
Get the activity status of the chroot.
|
|
Get the aliases of the chroot. These are alternative names for the chroot.
|
|
Get the type of the chroot.
Implemented in sbuild::ChrootBlockDevice, sbuild::ChrootFile, sbuild::ChrootLvmSnapshot, and sbuild::ChrootPlain. |
|
Get the description of the chroot.
|
|
Get the groups allowed to access the chroot.
|
|
Get the mount device of the chroot.
Reimplemented in sbuild::ChrootBlockDevice, and sbuild::ChrootLvmSnapshot. |
|
Get the mount location of the chroot.
Reimplemented in sbuild::ChrootPlain. |
|
Get the name of the chroot.
|
|
Get the priority of the chroot. This is a number indicating whether than a ditribution is older than another.
|
|
Get the groups allowed to access the chroot as root. Mmebers of these groups can switch to root without authenticating themselves.
|
|
Check if chroot session scripts will be run.
|
|
Check if chroot setup scripts will be run.
|
|
Get the session flags of the chroot. These determine how the Session controlling the chroot will operate.
Implemented in sbuild::ChrootBlockDevice, sbuild::ChrootFile, sbuild::ChrootLvmSnapshot, and sbuild::ChrootPlain. |
|
Print the configuration group for a chroot in the format required by schroot.conf.
Reimplemented in sbuild::ChrootBlockDevice, sbuild::ChrootFile, sbuild::ChrootLvmSnapshot, and sbuild::ChrootPlain. |
|
Print detailed information about the chroot to a stream. The information is printed in plain text with one line per property.
Reimplemented in sbuild::ChrootBlockDevice, sbuild::ChrootFile, sbuild::ChrootLvmSnapshot, and sbuild::ChrootPlain. |
|
Set the activity status of the chroot.
|
|
Set the aliases of the chroot. These are alternative names for the chroot.
|
|
Set the description of the chroot.
|
|
Set the groups allowed to access the chroot.
|
|
Set the mount device of the chroot.
|
|
Set the mount location of the chroot.
|
|
Set the name of the chroot.
|
|
Set the priority of a chroot. This is a number indicating whether a distribution is older than another. For example, "oldstable" and "oldstable-security" might be 0, while "stable" and "stable-security" 1, "testing" 2 and "unstable" 3. The values are not important, but the difference between them is.
|
|
Set the groups allowed to access the chroot as root. Mmebers of these groups can switch to root without authenticating themselves.
|
|
Set whether chroot session scripts will be run.
|
|
Set whether chroot setup scripts will be run.
|
|
Set environment. Set the environment that the setup scripts will see during execution.
Reimplemented in sbuild::ChrootBlockDevice, sbuild::ChrootFile, sbuild::ChrootLvmSnapshot, and sbuild::ChrootPlain. |
|
Lock a chroot during setup. The locking technique (if any) may vary depending upon the chroot type and setup stage. For example, during creation of an LVM snapshot a block device might require locking, but afterwards this will change to the new block device. An error will be thrown on failure.
|
|
Set up persistent session information.
|
|
Chroot activity status.
|
|
Alternative names for the chroot.
|
|
Chroot description.
|
|
Groups allowed to access the chroot.
|
|
Block device to mount (if any).
|
|
Location to mount chroot in the filesystem (if any).
|
|
Chroot name.
|
|
Chroot prioroty.
|
|
Groups allowed to access the chroot as root.
|
|
Run session setup scripts?
|
|
Run chroot setup scripts?
|