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

 ChrootBlockDevice ()
 The constructor.
 ChrootBlockDevice (const keyfile &keyfile, const std::string &group)
 The constructor.
virtual ~ChrootBlockDevice ()
 The destructor.
virtual Chrootclone () const
 Copy the chroot.
const std::string & get_device () const
 Get the block device of the chroot.
void set_device (const std::string &device)
 Set the block device of the chroot.This is the "source" device.
virtual const std::string & get_mount_device () const
 Get the mount device of the chroot.
const std::string & get_mount_options () const
 Get the filesystem mount_options of the chroot block device.
void set_mount_options (const std::string &mount_options)
 Set the filesystem mount_options of the chroot block device.
virtual const std::string & get_chroot_type () const
 Get the type of the chroot.
virtual void setup_env (env_list &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.

Private Member Functions

void read_keyfile (const keyfile &keyfile, const std::string &group)
 Read chroot configuration from a keyfile.

Private Attributes

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

Detailed Description

A chroot stored on an unmounted block device.

The device will be mounted on demand.


Constructor & Destructor Documentation

ChrootBlockDevice::ChrootBlockDevice const keyfile keyfile,
const std::string &  group
 

The constructor.

Initialise from an open keyfile.

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


Member Function Documentation

Chroot * ChrootBlockDevice::clone  )  const [virtual]
 

Copy the chroot.

This is a virtual copy constructor.

Returns:
a copy of the chroot.

Implements sbuild::Chroot.

Reimplemented in sbuild::ChrootLvmSnapshot.

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

Get the type of the chroot.

Returns:
the chroot type.

Implements sbuild::Chroot.

Reimplemented in sbuild::ChrootLvmSnapshot.

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

Get the block device of the chroot.

Returns:
the device.

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

Get the mount device of the chroot.

Returns:
the device.

Reimplemented from sbuild::Chroot.

Reimplemented in sbuild::ChrootLvmSnapshot.

const std::string & 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::read_keyfile const keyfile keyfile,
const std::string &  group
[private]
 

Read chroot configuration from a keyfile.

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

Reimplemented from sbuild::Chroot.

Reimplemented in sbuild::ChrootLvmSnapshot.

void ChrootBlockDevice::set_device const std::string &  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 const std::string &  mount_options  ) 
 

Set the filesystem mount_options of the chroot block device.

Parameters:
mount_options the mount options.

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


The documentation for this class was generated from the following files:
Generated on Thu Dec 29 17:20:04 2005 for schroot by  doxygen 1.4.5