summaryrefslogtreecommitdiff
path: root/hscript
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-13 04:02:41 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-13 04:02:41 -0500
commit48ed179795846b794c2a786b42bc2f7b6f3cecdd (patch)
treec7064bc2a4232029f47ca92f037cb6aa0d137c90 /hscript
parent7a09ff3f1d271258f81d9d1f6505c22daa605eed (diff)
downloadhorizon-48ed179795846b794c2a786b42bc2f7b6f3cecdd.tar.gz
horizon-48ed179795846b794c2a786b42bc2f7b6f3cecdd.tar.bz2
horizon-48ed179795846b794c2a786b42bc2f7b6f3cecdd.tar.xz
horizon-48ed179795846b794c2a786b42bc2f7b6f3cecdd.zip
hscript: Implement Mount::execute simulation
Diffstat (limited to 'hscript')
-rw-r--r--hscript/disk.cc19
1 files changed, 17 insertions, 2 deletions
diff --git a/hscript/disk.cc b/hscript/disk.cc
index d30778d..665e209 100644
--- a/hscript/disk.cc
+++ b/hscript/disk.cc
@@ -75,6 +75,21 @@ bool Mount::validate(ScriptOptions options) const {
return(access(this->device().c_str(), F_OK));
}
-bool Mount::execute(ScriptOptions) const {
- return false;
+bool Mount::execute(ScriptOptions options) const {
+ const std::string actual_mount = "/target" + this->mountpoint();
+
+ if(options.test(Simulate)) {
+ output_info("installfile:" + std::to_string(this->lineno()),
+ "mount: mounting " + this->device() + " on " +
+ this->mountpoint());
+ std::cout << "mount ";
+ if(!this->options().empty()) {
+ std::cout << "-o " << this->options() << " ";
+ }
+ std::cout << this->device() << " " << actual_mount << std::endl;
+ return true;
+ }
+
+ /* mount */
+ return true;
}