source: trunk/debathena/third/schroot/sbuild/sbuild-chroot-block-device.h @ 24314

Revision 24314, 2.6 KB checked in by geofft, 14 years ago (diff)
In schroot: * Merge with Debian unstable; remaining changes: - Backport to Karmic, and adjust build-deps.
Line 
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
26namespace sbuild
27{
28
29  /**
30   * A chroot stored on an unmounted block device.
31   *
32   * The device will be mounted on demand.
33   */
34  class chroot_block_device : public chroot_block_device_base
35  {
36  public:
37    /// Exception type.
38    typedef chroot::error error;
39
40  protected:
41    /// The constructor.
42    chroot_block_device ();
43
44    /// The copy constructor.
45    chroot_block_device (const chroot_block_device& rhs);
46
47#ifdef SBUILD_FEATURE_LVMSNAP
48    /// The copy constructor.
49    chroot_block_device (const chroot_lvm_snapshot& rhs);
50#endif
51
52    friend class chroot;
53#ifdef SBUILD_FEATURE_LVMSNAP
54    friend class chroot_lvm_snapshot;
55#endif
56
57  public:
58    /// The destructor.
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& user,
67                   bool               root) const;
68
69    virtual chroot::ptr
70    clone_source () const;
71
72    virtual void
73    setup_env (chroot const& chroot,
74               environment& env) const;
75
76    virtual session_flags
77    get_session_flags (chroot const& chroot) const;
78
79  protected:
80    virtual void
81    setup_lock (chroot::setup_type type,
82                bool               lock,
83                int                status);
84
85
86    virtual void
87    get_details (chroot const&  chroot,
88                 format_detail& detail) const;
89
90    virtual void
91    get_keyfile (chroot const& chroot,
92                 keyfile&      keyfile) const;
93
94    virtual void
95    set_keyfile (chroot&        chroot,
96                 keyfile const& keyfile,
97                 string_list&   used_keys);
98  };
99
100}
101
102#endif /* SBUILD_CHROOT_BLOCK_DEVICE_H */
103
104/*
105 * Local Variables:
106 * mode:C++
107 * End:
108 */
Note: See TracBrowser for help on using the repository browser.