#include <sbuild-chroot-mountable.h>
Public Member Functions | |
virtual | ~chroot_mountable () |
The destructor. | |
virtual std::string const & | get_mount_device () const =0 |
Get the mount device of the chroot. | |
std::string const & | get_mount_options () const |
Get the filesystem mount_options of the chroot block device. | |
void | set_mount_options (std::string const &mount_options) |
Set the filesystem mount_options of the chroot block device. | |
virtual std::string const & | get_location () const |
Get the location. | |
virtual void | set_location (std::string const &location) |
Set the location. | |
virtual void | setup_env (environment &env) |
Set environment. | |
virtual session_flags | get_session_flags () const |
Get the session flags of the chroot. | |
Protected Member Functions | |
chroot_mountable () | |
The constructor. | |
virtual void | get_details (format_detail &detail) const |
Get detailed information about the chroot for output. | |
virtual void | get_keyfile (keyfile &keyfile) const |
Copy the chroot properties into a keyfile. | |
virtual void | set_keyfile (keyfile const &keyfile, string_list &used_keys) |
Set the chroot properties from a keyfile. | |
Private Attributes | |
std::string | mount_options |
The options to mount the device with. | |
Friends | |
class | chroot |
The device will be mounted on demand.
chroot_mountable::chroot_mountable | ( | ) | [protected] |
The constructor.
chroot_mountable::~chroot_mountable | ( | ) | [virtual] |
The destructor.
virtual std::string const& sbuild::chroot_mountable::get_mount_device | ( | ) | const [pure virtual] |
Get the mount device of the chroot.
Reimplemented from sbuild::chroot.
Implemented in sbuild::chroot_block_device, sbuild::chroot_loopback, and sbuild::chroot_lvm_snapshot.
std::string const & chroot_mountable::get_mount_options | ( | ) | const |
Get the filesystem mount_options of the chroot block device.
References mount_options.
Referenced by get_details(), get_keyfile(), and setup_env().
void chroot_mountable::set_mount_options | ( | std::string const & | mount_options | ) |
Set the filesystem mount_options of the chroot block device.
mount_options | the mount options. |
Referenced by set_keyfile().
std::string const & chroot_mountable::get_location | ( | ) | const [virtual] |
Get the location.
This is a path to the chroot directory inside the device (absolute path from the device root).
Reimplemented from sbuild::chroot.
References sbuild::chroot::get_location().
Referenced by get_keyfile().
void chroot_mountable::set_location | ( | std::string const & | location | ) | [virtual] |
Set the location.
This is a path to the chroot directory inside the device (absolute path from the device root).
location | the location. |
Reimplemented from sbuild::chroot.
References sbuild::is_absname(), sbuild::chroot::LOCATION_ABS, and sbuild::chroot::set_location().
Referenced by set_keyfile().
void chroot_mountable::setup_env | ( | environment & | env | ) | [virtual] |
Set environment.
Set the environment that the setup scripts will see during execution.
env | the environment to set. |
Reimplemented from sbuild::chroot.
Reimplemented in sbuild::chroot_block_device, sbuild::chroot_loopback, and sbuild::chroot_lvm_snapshot.
References sbuild::environment::add(), get_mount_options(), and sbuild::chroot::setup_env().
Referenced by sbuild::chroot_loopback::setup_env(), and sbuild::chroot_block_device::setup_env().
sbuild::chroot::session_flags chroot_mountable::get_session_flags | ( | ) | const [virtual] |
Get the session flags of the chroot.
These determine how the Session controlling the chroot will operate.
Implements sbuild::chroot.
Reimplemented in sbuild::chroot_block_device, sbuild::chroot_loopback, and sbuild::chroot_lvm_snapshot.
References sbuild::chroot::SESSION_NOFLAGS.
Referenced by sbuild::chroot_loopback::get_session_flags(), and sbuild::chroot_block_device::get_session_flags().
void chroot_mountable::get_details | ( | format_detail & | detail | ) | const [protected, virtual] |
Get detailed information about the chroot for output.
detail | the details to output to. |
Reimplemented from sbuild::chroot.
Reimplemented in sbuild::chroot_block_device, sbuild::chroot_loopback, and sbuild::chroot_lvm_snapshot.
References sbuild::format_detail::add(), sbuild::chroot::get_details(), get_mount_options(), and mount_options.
Referenced by sbuild::chroot_loopback::get_details(), and sbuild::chroot_block_device::get_details().
void chroot_mountable::get_keyfile | ( | keyfile & | keyfile | ) | const [protected, 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 from sbuild::chroot.
Reimplemented in sbuild::chroot_block_device, sbuild::chroot_loopback, and sbuild::chroot_lvm_snapshot.
References sbuild::chroot::get_keyfile(), get_location(), get_mount_options(), sbuild::chroot::get_name(), and sbuild::basic_keyfile< K, P >::set_object_value().
Referenced by sbuild::chroot_loopback::get_keyfile(), and sbuild::chroot_block_device::get_keyfile().
void chroot_mountable::set_keyfile | ( | keyfile const & | keyfile, | |
string_list & | used_keys | |||
) | [protected, 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. | |
used_keys | a list of the keys used will be set. |
Reimplemented from sbuild::chroot.
Reimplemented in sbuild::chroot_block_device, sbuild::chroot_loopback, and sbuild::chroot_lvm_snapshot.
References sbuild::chroot::get_name(), sbuild::basic_keyfile< K, P >::get_object_value(), sbuild::keyfile_base::PRIORITY_OPTIONAL, sbuild::chroot::set_keyfile(), set_location(), and set_mount_options().
Referenced by sbuild::chroot_loopback::set_keyfile(), and sbuild::chroot_block_device::set_keyfile().
friend class chroot [friend] |
Reimplemented in sbuild::chroot_block_device, sbuild::chroot_loopback, and sbuild::chroot_lvm_snapshot.
std::string sbuild::chroot_mountable::mount_options [private] |