summaryrefslogtreecommitdiff
path: root/image/backends/basic.cc
diff options
context:
space:
mode:
Diffstat (limited to 'image/backends/basic.cc')
-rw-r--r--image/backends/basic.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/image/backends/basic.cc b/image/backends/basic.cc
index 0aa1afa..dc4d9ea 100644
--- a/image/backends/basic.cc
+++ b/image/backends/basic.cc
@@ -12,6 +12,9 @@
#include "basic.hh"
+#include <sys/mount.h> /* umount */
+#include "hscript/util.hh" /* run_command */
+
namespace Horizon {
namespace Image {
@@ -38,5 +41,12 @@ int BasicBackend::finalise() {
return 0;
}
+void BasicBackend::cleanup() {
+ /* The default implementation unmounts /dev, /proc, and /sys from the target. */
+ run_command("umount", {"-R", (ir_dir + "/target/sys")});
+ ::umount((ir_dir + "/target/proc").c_str());
+ run_command("umount", {"-R", (ir_dir + "/target/dev")});
+}
+
}
}