summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}