[24167] | 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 | |
---|
| 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 | |
---|
[24314] | 47 | #ifdef SBUILD_FEATURE_LVMSNAP |
---|
[24167] | 48 | /// The copy constructor. |
---|
| 49 | chroot_block_device (const chroot_lvm_snapshot& rhs); |
---|
[24314] | 50 | #endif |
---|
[24167] | 51 | |
---|
| 52 | friend class chroot; |
---|
[24314] | 53 | #ifdef SBUILD_FEATURE_LVMSNAP |
---|
[24167] | 54 | friend class chroot_lvm_snapshot; |
---|
[24314] | 55 | #endif |
---|
[24167] | 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 | |
---|
[24314] | 79 | protected: |
---|
[24167] | 80 | virtual void |
---|
[24314] | 81 | setup_lock (chroot::setup_type type, |
---|
| 82 | bool lock, |
---|
| 83 | int status); |
---|
| 84 | |
---|
| 85 | |
---|
| 86 | virtual void |
---|
[24167] | 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 | */ |
---|