summaryrefslogtreecommitdiff
path: root/hscript/meta.cc
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2020-03-24 08:53:46 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2020-03-24 08:53:46 -0500
commitaf4440337fa03df944afce3a6e0de8f277d15216 (patch)
tree41cd9fc874964460578ef9e2e9bb4a7fef4fad21 /hscript/meta.cc
parentf72d30cf04308309bee4728fabb3e746236b2a98 (diff)
downloadhorizon-af4440337fa03df944afce3a6e0de8f277d15216.tar.gz
horizon-af4440337fa03df944afce3a6e0de8f277d15216.tar.bz2
horizon-af4440337fa03df944afce3a6e0de8f277d15216.tar.xz
horizon-af4440337fa03df944afce3a6e0de8f277d15216.zip
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.
Diffstat (limited to 'hscript/meta.cc')
-rw-r--r--hscript/meta.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/hscript/meta.cc b/hscript/meta.cc
index 2f4e4eb..e0c2b52 100644
--- a/hscript/meta.cc
+++ b/hscript/meta.cc
@@ -95,7 +95,9 @@ bool Hostname::execute() const {
std::cout << "hostname " << actual << std::endl;
}
#ifdef HAS_INSTALL_ENV
- else {
+ else if(script->options().test(Image)) {
+ /* no-op; we don't want to set the image builder's hostname */
+ } else {
if(sethostname(actual.c_str(), actual.size()) == -1) {
output_error("installfile:" + std::to_string(this->lineno()),
"hostname: failed to set host name",