-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInstallerLiveCD.hpp
122 lines (99 loc) · 3.41 KB
/
InstallerLiveCD.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/*
* libcloudos
* Copyright (C) 2014 Tony Wolf <wolf@os-forge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef CLOUDOS_SYSTEM_INSTALLER_MANAGEMENT_SYSTEM_HPP__
#define CLOUDOS_SYSTEM_INSTALLER_MANAGEMENT_SYSTEM_HPP__
#include <vector>
#include <boost/container/stable_vector.hpp>
#include <cloudos/system/InstallerExtended.hpp>
namespace cloudos {
namespace system {
class InstallerLiveCD;
typedef boost::shared_ptr<InstallerLiveCD> InstallerLiveCDPointer;
/**
* Why we need this class?
* This class is able to create a tar file for our live cd system
*
* What is possible with this class?
* Create an tar file of a bootstrapped and stripped cloud os system
*
* Is there a special behaviour, on special circumstances?
* Non known
*
* How to use this class as an object?
* InstallerLiveCD live("/tmp/path/to/install/");
* live.setup();
*/
class InstallerLiveCD : public InstallerExtended {
public:
/**
* Every CoreSystem needs at least a base path, where it will be installed in.
* This directory will be givven by p_root_dir
*/
InstallerLiveCD ( const std::string& p_root_dir );
/**
* Every CoreSystem needs at least a base path, where it will be installed in.
* This directory will be givven by p_root_dir
*/
InstallerLiveCD ( const fs::path& p_root_dir );
/**
* Every CoreSystem needs at least a base path, where it will be installed in.
* This directory will be givven by p_root_dir
*/
InstallerLiveCD ( std::string && p_root_dir );
/**
* Every CoreSystem needs at least a base path, where it will be installed in.
* This directory will be givven by p_root_dir
*/
InstallerLiveCD ( fs::path && p_root_dir );
/**
* Returns the path to the tar file from the created live cd image.
*
* You need to call setup() first, else the returned filepath will be empty!
*/
const fs::path& getTarFilePath() const;
protected:
/**
* Inits all class members...
*/
virtual void init() override;
/**
* Calls zypper to install our packages
*/
bool stepInstallLiveCDPackages();
/**
* Removes unwanted files from our tar file
*/
virtual bool stepCleanUpSetup() override;
/**
* Copy file basesystem-rpms.tar to our live cd image
*/
bool stepCopyBasesystemRpms();
/**
* Creates the tar file from our created image directory
*/
bool stepCreateTarFile();
/**
* Removes our build dir (RootPath)
*/
bool stepCleanUpEnvironment();
private:
fs::path c_tar_file;
void removeFiles( std::vector<std::string>&& p_elements, fs::path&& p_prepend_path, FileLookupMode p_mode );
};
}}
#endif