sbuild::ChrootBlockDevice Class Reference

A chroot stored on an unmounted block device. More...

#include <sbuild-chroot-block-device.h>

Inheritance diagram for sbuild::ChrootBlockDevice:

Inheritance graph
[legend]
Collaboration diagram for sbuild::ChrootBlockDevice:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual ~ChrootBlockDevice ()
 The destructor.
virtual Chroot::chroot_ptr clone () const
 Copy the chroot.
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 const & get_mount_device () const
 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_chroot_type () const
 Get the type of the chroot.
virtual void setup_env (environment &env)
 Set environment.
virtual void setup_lock (SetupType type, bool lock)
virtual SessionFlags get_session_flags () const
 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.

Protected Member Functions

 ChrootBlockDevice ()
 The constructor.
 ChrootBlockDevice (keyfile const &keyfile, std::string const &group)
 The constructor.

Private Attributes

std::string device
 The block device to use.
std::string mount_options
 The options to mount the device with.

Friends

class Chroot

Detailed Description

A chroot stored on an unmounted block device.

The device will be mounted on demand.


Constructor & Destructor Documentation

ChrootBlockDevice::ChrootBlockDevice  )  [protected]
 

The constructor.

ChrootBlockDevice::ChrootBlockDevice keyfile const &  keyfile,
std::string const &  group
[protected]
 

The constructor.

Initialise from an open keyfile.

Parameters:
keyfile the configuration file
group the keyfile group (chroot name)

ChrootBlockDevice::~ChrootBlockDevice  )  [virtual]
 

The destructor.


Member Function Documentation

Chroot::chroot_ptr ChrootBlockDevice::clone  )  const [virtual]
 

Copy the chroot.

This is a virtual copy constructor.

Returns:
a shared_ptr to the new copy of the chroot.

Implements sbuild::Chroot.

Reimplemented in sbuild::ChrootLvmSnapshot.

std::string const & ChrootBlockDevice::get_chroot_type  )  const [virtual]
 

Get the type of the chroot.

Returns:
the chroot type.

Implements sbuild::Chroot.

Reimplemented in sbuild::ChrootLvmSnapshot.

std::string const & ChrootBlockDevice::get_device  )  const
 

Get the block device of the chroot.

Returns:
the device.

std::string const & ChrootBlockDevice::get_mount_device  )  const [virtual]
 

Get the mount device of the chroot.

Returns:
the device.

Reimplemented from sbuild::Chroot.

Reimplemented in sbuild::ChrootLvmSnapshot.

std::string const & ChrootBlockDevice::get_mount_options  )  const
 

Get the filesystem mount_options of the chroot block device.

Returns:
the mount options.

Chroot::SessionFlags ChrootBlockDevice::get_session_flags  )  const [virtual]
 

Get the session flags of the chroot.

These determine how the Session controlling the chroot will operate.

Returns:
the session flags.

Implements sbuild::Chroot.

Reimplemented in sbuild::ChrootLvmSnapshot.

void ChrootBlockDevice::print_config std::ostream &  stream  )  const [virtual]
 

Print the configuration group for a chroot in the format required by schroot.conf.

Parameters:
stream the stream to output to.
Todo:
Replace with proper serialisation code to stream to a keyfile.

Reimplemented from sbuild::Chroot.

Reimplemented in sbuild::ChrootLvmSnapshot.

void ChrootBlockDevice::print_details std::ostream &  stream  )  const [virtual]
 

Print detailed information about the chroot to a stream.

The information is printed in plain text with one line per property.

Parameters:
stream the stream to output to.

Reimplemented from sbuild::Chroot.

Reimplemented in sbuild::ChrootLvmSnapshot.

void ChrootBlockDevice::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.

Parameters:
device the device.

void ChrootBlockDevice::set_mount_options std::string const &  mount_options  ) 
 

Set the filesystem mount_options of the chroot block device.

Parameters:
mount_options the mount options.

void ChrootBlockDevice::setup_env environment env  )  [virtual]
 

Set environment.

Set the environment that the setup scripts will see during execution.

Parameters:
env the environment to set.

Reimplemented from sbuild::Chroot.

Reimplemented in sbuild::ChrootLvmSnapshot.

void ChrootBlockDevice::setup_lock SetupType  type,
bool  lock
[virtual]
 

Reimplemented in sbuild::ChrootLvmSnapshot.


Friends And Related Function Documentation

friend class Chroot [friend]
 

Reimplemented in sbuild::ChrootLvmSnapshot.


Member Data Documentation

std::string sbuild::ChrootBlockDevice::device [private]
 

The block device to use.

std::string sbuild::ChrootBlockDevice::mount_options [private]
 

The options to mount the device with.


The documentation for this class was generated from the following files:
Generated on Mon Jan 30 13:23:55 2006 for schroot by  doxygen 1.4.6