sbuild  1.6.10
sbuild-chroot-block-device.h
1 /* Copyright © 2005-2008 Roger Leigh <rleigh@debian.org>
2  *
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 3 of the License, or
6  * (at your option) any later version.
7  *
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.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see
15  * <http://www.gnu.org/licenses/>.
16  *
17  *********************************************************************/
18 
19 #ifndef SBUILD_CHROOT_BLOCK_DEVICE_H
20 #define SBUILD_CHROOT_BLOCK_DEVICE_H
21 
22 #include <sbuild/sbuild-config.h>
23 #include <sbuild/sbuild-chroot-block-device-base.h>
24 #include <sbuild/sbuild-chroot-lvm-snapshot.h>
25 
26 namespace sbuild
27 {
28 
35  {
36  public:
39 
40  protected:
43 
46 
47 #ifdef SBUILD_FEATURE_LVMSNAP
50 #endif
51 
52  friend class chroot;
53 #ifdef SBUILD_FEATURE_LVMSNAP
54  friend class chroot_lvm_snapshot;
55 #endif
56 
57  public:
59  virtual ~chroot_block_device ();
60 
61  virtual chroot::ptr
62  clone () const;
63 
64  virtual chroot::ptr
65  clone_session (std::string const& session_id,
66  std::string const& alias,
67  std::string const& user,
68  bool root) const;
69 
70  virtual chroot::ptr
71  clone_source () const;
72 
73  std::string const&
74  get_chroot_type () const;
75 
76  virtual void
77  setup_env (chroot const& chroot,
78  environment& env) const;
79 
80  virtual session_flags
81  get_session_flags (chroot const& chroot) const;
82 
83  protected:
84  virtual void
86  bool lock,
87  int status);
88 
89 
90  virtual void
91  get_details (chroot const& chroot,
92  format_detail& detail) const;
93 
94  virtual void
95  get_keyfile (chroot const& chroot,
96  keyfile& keyfile) const;
97 
98  virtual void
100  keyfile const& keyfile,
101  string_list& used_keys);
102  };
103 
104 }
105 
106 #endif /* SBUILD_CHROOT_BLOCK_DEVICE_H */
107 
108 /*
109  * Local Variables:
110  * mode:C++
111  * End:
112  */
virtual void get_details(chroot const &chroot, format_detail &detail) const
Get detailed information about the chroot for output.
Definition: sbuild-chroot-block-device.cc:177
A chroot stored on an unmounted block device.
Definition: sbuild-chroot-block-device.h:34
Debian source builder components.
Definition: sbuild-auth-null.h:24
virtual chroot::ptr clone_source() const
Create a source chroot.
Definition: sbuild-chroot-block-device.cc:90
std::string const & get_chroot_type() const
Get the type of the chroot.
Definition: sbuild-chroot-block-device.cc:163
Container of environment variables.
Definition: sbuild-environment.h:38
Advisory locking.
Definition: sbuild-lock.h:38
Configuration file parser.
Definition: sbuild-basic-keyfile.h:138
A base class for block-device chroots.
Definition: sbuild-chroot-block-device-base.h:37
virtual void setup_env(chroot const &chroot, environment &env) const
Set environment.
Definition: sbuild-chroot-block-device.cc:104
std::vector< std::string > string_list
A string vector.
Definition: sbuild-types.h:38
virtual chroot::ptr clone() const
Copy the chroot.
Definition: sbuild-chroot-block-device.cc:68
Custom error.
Definition: sbuild-custom-error.h:32
session_flags get_session_flags() const
Get the session flags of the chroot.
Definition: sbuild-chroot.cc:638
virtual ~chroot_block_device()
The destructor.
Definition: sbuild-chroot-block-device.cc:47
session_flags
Chroot session properties.
Definition: sbuild-chroot.h:57
virtual void set_keyfile(chroot &chroot, keyfile const &keyfile, string_list &used_keys)
Set the chroot properties from a keyfile.
Definition: sbuild-chroot-block-device.cc:191
Format names and values for output.
Definition: sbuild-format-detail.h:38
setup_type
Type of setup to perform.
Definition: sbuild-chroot.h:49
virtual void get_keyfile(chroot const &chroot, keyfile &keyfile) const
Copy the chroot properties into a keyfile.
Definition: sbuild-chroot-block-device.cc:184
Common chroot data.
Definition: sbuild-chroot.h:45
virtual chroot::ptr clone_session(std::string const &session_id, std::string const &alias, std::string const &user, bool root) const
Create a session chroot.
Definition: sbuild-chroot-block-device.cc:74
chroot_block_device()
The constructor.
Definition: sbuild-chroot-block-device.cc:39
chroot::error error
Exception type.
Definition: sbuild-chroot-block-device.h:38
std::shared_ptr< chroot > ptr
A shared_ptr to a chroot object.
Definition: sbuild-chroot.h:105
A chroot stored on an LVM logical volume (LV).
Definition: sbuild-chroot-lvm-snapshot.h:32
virtual void setup_lock(chroot::setup_type type, bool lock, int status)
Unlock a chroot during setup.
Definition: sbuild-chroot-block-device.cc:111