#include <sbuild-chroot-block-device-base.h>
Public Member Functions | |
virtual | ~chroot_block_device_base () |
The destructor. | |
std::string const & | get_device () const |
Get the block device of the chroot. | |
void | set_device (std::string const &device) |
Set the block device of the chroot. | |
virtual std::string | get_path () const |
Get the path to the chroot. | |
virtual void | setup_env (chroot const &chroot, environment &env) const |
Set environment. | |
virtual session_flags | get_session_flags (chroot const &chroot) const |
Get the session flags of the chroot. | |
Protected Member Functions | |
chroot_block_device_base () | |
The constructor. | |
chroot_block_device_base (const chroot_block_device_base &rhs) | |
The copy constructor. | |
virtual void | get_details (chroot const &chroot, format_detail &detail) const |
Get detailed information about the chroot for output. | |
virtual void | get_keyfile (chroot const &chroot, keyfile &keyfile) const |
Copy the chroot properties into a keyfile. | |
virtual void | set_keyfile (chroot &chroot, keyfile const &keyfile, string_list &used_keys) |
Set the chroot properties from a keyfile. | |
Protected Attributes | |
std::string | device |
The block device to use. | |
Friends | |
class | chroot |
This class doesn't implement a chroot (get_chroot_type is not implemented).
Originally lvm-snapshot inherited from the block-device chroot, but this was changed when union support was introduced. This design prevents lvm-snapshot offering union based sessions.
chroot_block_device_base::chroot_block_device_base | ( | const chroot_block_device_base & | rhs | ) | [protected] |
The copy constructor.
References device, and set_device().
std::string const & chroot_block_device_base::get_device | ( | ) | const |
Get the block device of the chroot.
References device.
Referenced by get_details(), get_keyfile(), setup_env(), sbuild::chroot_lvm_snapshot::setup_lock(), and sbuild::chroot_block_device::setup_lock().
void chroot_block_device_base::set_device | ( | std::string const & | device | ) |
Set the block device of the chroot.
This is the "source" device. It may be the case that the real device is different (for example, an LVM snapshot PV), but by default will be the device to mount.
device | the device. |
References sbuild::chroot::DEVICE_ABS, and sbuild::is_absname().
Referenced by chroot_block_device_base(), and set_keyfile().
std::string chroot_block_device_base::get_path | ( | ) | const [virtual] |
Get the path to the chroot.
This is the absolute path to the root of the chroot, and is typically the same as the mount location and location concatenated together, but is overridden by the chroot type if required.
Implements sbuild::chroot.
References sbuild::chroot::get_mount_location().
void chroot_block_device_base::setup_env | ( | chroot const & | chroot, | |
environment & | env | |||
) | const [virtual] |
Set environment.
Set the environment that the setup scripts will see during execution.
chroot | the chroot to use. | |
env | the environment to set. |
Implements sbuild::chroot.
Reimplemented in sbuild::chroot_block_device, and sbuild::chroot_lvm_snapshot.
References sbuild::environment::add(), get_device(), and sbuild::chroot::setup_env().
Referenced by sbuild::chroot_lvm_snapshot::setup_env(), and sbuild::chroot_block_device::setup_env().
sbuild::chroot::session_flags chroot_block_device_base::get_session_flags | ( | chroot const & | chroot | ) | 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, and sbuild::chroot_lvm_snapshot.
References sbuild::chroot::SESSION_NOFLAGS.
void chroot_block_device_base::get_details | ( | chroot const & | chroot, | |
format_detail & | detail | |||
) | const [protected, virtual] |
Get detailed information about the chroot for output.
Implements sbuild::chroot.
Reimplemented in sbuild::chroot_block_device, and sbuild::chroot_lvm_snapshot.
References sbuild::format_detail::add(), device, sbuild::chroot::get_details(), and get_device().
Referenced by sbuild::chroot_lvm_snapshot::get_details(), and sbuild::chroot_block_device::get_details().
void chroot_block_device_base::get_keyfile | ( | chroot const & | chroot, | |
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.
Implements sbuild::chroot.
Reimplemented in sbuild::chroot_block_device, and sbuild::chroot_lvm_snapshot.
References get_device(), sbuild::chroot::get_keyfile(), sbuild::chroot::get_name(), and sbuild::basic_keyfile< K, P >::set_object_value().
Referenced by sbuild::chroot_lvm_snapshot::get_keyfile(), and sbuild::chroot_block_device::get_keyfile().
void chroot_block_device_base::set_keyfile | ( | chroot & | chroot, | |
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.
chroot | the chroot to use. | |
keyfile | the keyfile to get the properties from. | |
used_keys | a list of the keys used will be set. |
Implements sbuild::chroot.
Reimplemented in sbuild::chroot_block_device, and sbuild::chroot_lvm_snapshot.
References sbuild::chroot::get_name(), sbuild::basic_keyfile< K, P >::get_object_value(), sbuild::keyfile_base::PRIORITY_REQUIRED, set_device(), and sbuild::chroot::set_keyfile().
Referenced by sbuild::chroot_lvm_snapshot::set_keyfile(), and sbuild::chroot_block_device::set_keyfile().