~ubuntu-branches/ubuntu/intrepid/schroot/intrepid

« back to all changes in this revision

Viewing changes to schroot/sbuild-chroot-block-device.h

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2006-07-08 18:33:28 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060708183328-rlo4mpldmyoda55q
Tags: 0.99.2-2ubuntu1
* remerge ubuntu changes:
  + debian/control: libpam-dev (>> 0.79-3ubuntu6)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright © 2005-2006  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 2 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, write to the Free Software
15
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
16
 
 * MA  02111-1307  USA
17
 
 *
18
 
 *********************************************************************/
19
 
 
20
 
#ifndef SBUILD_CHROOT_BLOCK_DEVICE_H
21
 
#define SBUILD_CHROOT_BLOCK_DEVICE_H
22
 
 
23
 
#include "sbuild-chroot.h"
24
 
 
25
 
namespace sbuild
26
 
{
27
 
 
28
 
  /**
29
 
   * A chroot stored on an unmounted block device.  The device will be
30
 
   * mounted on demand.
31
 
   */
32
 
  class chroot_block_device : virtual public chroot
33
 
  {
34
 
  protected:
35
 
    /// The constructor.
36
 
    chroot_block_device ();
37
 
 
38
 
    friend class chroot;
39
 
 
40
 
  public:
41
 
    /// The destructor.
42
 
    virtual ~chroot_block_device ();
43
 
 
44
 
    virtual chroot::ptr
45
 
    clone () const;
46
 
 
47
 
    /**
48
 
     * Get the block device of the chroot.
49
 
     *
50
 
     * @returns the device.
51
 
     */
52
 
    std::string const&
53
 
    get_device () const;
54
 
 
55
 
    /**
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
59
 
     * to mount.
60
 
     *
61
 
     * @param device the device.
62
 
     */
63
 
    void
64
 
    set_device (std::string const& device);
65
 
 
66
 
    virtual std::string const&
67
 
    get_mount_device () const;
68
 
 
69
 
    /**
70
 
     * Get the filesystem mount_options of the chroot block device.
71
 
     *
72
 
     * @returns the mount options.
73
 
     */
74
 
    std::string const&
75
 
    get_mount_options () const;
76
 
 
77
 
    /**
78
 
     * Set the filesystem mount_options of the chroot block device.
79
 
     *
80
 
     * @param mount_options the mount options.
81
 
     */
82
 
    void
83
 
    set_mount_options (std::string const& mount_options);
84
 
 
85
 
    /**
86
 
     * Get the location.  This is a path to the chroot directory
87
 
     * inside the LV (absolute path from the LV root).
88
 
     *
89
 
     * @returns the location.
90
 
     */
91
 
    virtual std::string const&
92
 
    get_location () const;
93
 
 
94
 
    /**
95
 
     * Set the location.  This is a path to the chroot directory
96
 
     * inside the LV (absolute path from the LV root).
97
 
     *
98
 
     * @param location the location.
99
 
     */
100
 
    virtual void
101
 
    set_location (std::string const& location);
102
 
 
103
 
    virtual std::string const&
104
 
    get_chroot_type () const;
105
 
 
106
 
    virtual void
107
 
    setup_env (environment& env);
108
 
 
109
 
    virtual session_flags
110
 
    get_session_flags () const;
111
 
 
112
 
  protected:
113
 
    virtual void
114
 
    setup_lock (setup_type type,
115
 
                bool       lock,
116
 
                int        status); 
117
 
 
118
 
    virtual void
119
 
    print_details (std::ostream& stream) const;
120
 
 
121
 
    virtual void
122
 
    get_keyfile (keyfile& keyfile) const;
123
 
 
124
 
    virtual void
125
 
    set_keyfile (keyfile const& keyfile);
126
 
 
127
 
  private:
128
 
    /// The block device to use.
129
 
    std::string device;
130
 
    /// The options to mount the device with.
131
 
    std::string mount_options;
132
 
  };
133
 
 
134
 
}
135
 
 
136
 
#endif /* SBUILD_CHROOT_BLOCK_DEVICE_H */
137
 
 
138
 
/*
139
 
 * Local Variables:
140
 
 * mode:C++
141
 
 * End:
142
 
 */