1
/* Copyright © 2005-2006 Roger Leigh <rleigh@debian.org>
3
* schroot is free software; you can redistribute it and/or modify it
4
* under the terms of the GNU General Public License as published by
5
* the Free Software Foundation; either version 2 of the License, or
6
* (at your option) any later version.
8
* schroot is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
* General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18
*********************************************************************/
20
#ifndef SBUILD_CHROOT_BLOCK_DEVICE_H
21
#define SBUILD_CHROOT_BLOCK_DEVICE_H
23
#include "sbuild-chroot.h"
29
* A chroot stored on an unmounted block device. The device will be
32
class chroot_block_device : virtual public chroot
36
chroot_block_device ();
42
virtual ~chroot_block_device ();
48
* Get the block device of the chroot.
50
* @returns the device.
56
* Set the block device of the chroot. This is the "source" device.
57
* It may be the case that the real device is different (for
58
* example, an LVM snapshot PV), but by default will be the device
61
* @param device the device.
64
set_device (std::string const& device);
66
virtual std::string const&
67
get_mount_device () const;
70
* Get the filesystem mount_options of the chroot block device.
72
* @returns the mount options.
75
get_mount_options () const;
78
* Set the filesystem mount_options of the chroot block device.
80
* @param mount_options the mount options.
83
set_mount_options (std::string const& mount_options);
86
* Get the location. This is a path to the chroot directory
87
* inside the LV (absolute path from the LV root).
89
* @returns the location.
91
virtual std::string const&
92
get_location () const;
95
* Set the location. This is a path to the chroot directory
96
* inside the LV (absolute path from the LV root).
98
* @param location the location.
101
set_location (std::string const& location);
103
virtual std::string const&
104
get_chroot_type () const;
107
setup_env (environment& env);
109
virtual session_flags
110
get_session_flags () const;
114
setup_lock (setup_type type,
119
print_details (std::ostream& stream) const;
122
get_keyfile (keyfile& keyfile) const;
125
set_keyfile (keyfile const& keyfile);
128
/// The block device to use.
130
/// The options to mount the device with.
131
std::string mount_options;
136
#endif /* SBUILD_CHROOT_BLOCK_DEVICE_H */