From af4440337fa03df944afce3a6e0de8f277d15216 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Tue, 24 Mar 2020 08:53:46 -0500 Subject: hscript: Implement 'Image' script option This option is for generating images using Horizon. It skips most disk-related operations, except for preparing /etc/fstab. It also skips setting the running system's hostname. --- hscript/disk.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'hscript/disk.cc') diff --git a/hscript/disk.cc b/hscript/disk.cc index 225148b..b0608b3 100644 --- a/hscript/disk.cc +++ b/hscript/disk.cc @@ -792,7 +792,7 @@ bool Mount::execute() const { #endif /* We have to get the filesystem for the node. */ - if(script->options().test(Simulate)) { + if(script->options().test(Simulate) || script->options().test(Image)) { fstype = "auto"; } #ifdef HAS_INSTALL_ENV @@ -818,6 +818,9 @@ bool Mount::execute() const { std::cout << this->device() << " " << actual_mount << std::endl; } #ifdef HAS_INSTALL_ENV + else if(script->options().test(Image)) { + /* no-op; we don't mount during image creation (but we want fstab) */ + } else { /* mount */ if(!fs::exists(actual_mount, ec)) { -- cgit v1.2.3-60-g2f50