diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-03-24 08:53:46 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-03-24 08:53:46 -0500 |
commit | af4440337fa03df944afce3a6e0de8f277d15216 (patch) | |
tree | 41cd9fc874964460578ef9e2e9bb4a7fef4fad21 /hscript/script_e.cc | |
parent | f72d30cf04308309bee4728fabb3e746236b2a98 (diff) | |
download | horizon-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/script_e.cc')
-rw-r--r-- | hscript/script_e.cc | 76 |
1 files changed, 39 insertions, 37 deletions
diff --git a/hscript/script_e.cc b/hscript/script_e.cc index 775f93a..91ebe0f 100644 --- a/hscript/script_e.cc +++ b/hscript/script_e.cc @@ -96,53 +96,55 @@ bool Script::execute() const { /**************** DISK SETUP ****************/ output_step_start("disk"); + if(!opts.test(Image)) { #ifdef HAS_INSTALL_ENV - if(opts.test(InstallEnvironment)) ped_device_probe_all(); + if(opts.test(InstallEnvironment)) ped_device_probe_all(); #endif /* HAS_INSTALL_ENV */ - /* REQ: Runner.Execute.diskid */ - for(auto &diskid : internal->diskids) { - EXECUTE_OR_FAIL("diskid", diskid) - } + /* REQ: Runner.Execute.diskid */ + for(auto &diskid : internal->diskids) { + EXECUTE_OR_FAIL("diskid", diskid) + } - /* REQ: Runner.Execute.disklabel */ - for(auto &label : internal->disklabels) { - EXECUTE_OR_FAIL("disklabel", label) - } + /* REQ: Runner.Execute.disklabel */ + for(auto &label : internal->disklabels) { + EXECUTE_OR_FAIL("disklabel", label) + } - /* REQ: Runner.Execute.partition */ - /* Ensure partitions are created in on-disk order. */ - std::sort(internal->partitions.begin(), internal->partitions.end(), - [](std::unique_ptr<Partition> const &e1, - std::unique_ptr<Partition> const &e2) { - return (e1->device() + "p" + std::to_string(e1->partno())) < - (e2->device() + "p" + std::to_string(e2->partno())); - }); - for(auto &part : internal->partitions) { - EXECUTE_OR_FAIL("partition", part) - } + /* REQ: Runner.Execute.partition */ + /* Ensure partitions are created in on-disk order. */ + std::sort(internal->partitions.begin(), internal->partitions.end(), + [](std::unique_ptr<Partition> const &e1, + std::unique_ptr<Partition> const &e2) { + return (e1->device() + "p" + std::to_string(e1->partno())) < + (e2->device() + "p" + std::to_string(e2->partno())); + }); + for(auto &part : internal->partitions) { + EXECUTE_OR_FAIL("partition", part) + } - /* encrypt PVs */ + /* encrypt PVs */ - /* REQ: Runner.Execute.lvm_pv */ - for(auto &pv : internal->lvm_pvs) { - EXECUTE_OR_FAIL("lvm_pv", pv) - } + /* REQ: Runner.Execute.lvm_pv */ + for(auto &pv : internal->lvm_pvs) { + EXECUTE_OR_FAIL("lvm_pv", pv) + } - /* REQ: Runner.Execute.lvm_vg */ - for(auto &vg : internal->lvm_vgs) { - EXECUTE_OR_FAIL("lvm_vg", vg) - } + /* REQ: Runner.Execute.lvm_vg */ + for(auto &vg : internal->lvm_vgs) { + EXECUTE_OR_FAIL("lvm_vg", vg) + } - /* REQ: Runner.Execute.lvm_lv */ - for(auto &lv : internal->lvm_lvs) { - EXECUTE_OR_FAIL("lvm_lv", lv) - } + /* REQ: Runner.Execute.lvm_lv */ + for(auto &lv : internal->lvm_lvs) { + EXECUTE_OR_FAIL("lvm_lv", lv) + } - /* encrypt */ + /* encrypt */ - /* REQ: Runner.Execute.fs */ - for(auto &fs : internal->fses) { - EXECUTE_OR_FAIL("fs", fs) + /* REQ: Runner.Execute.fs */ + for(auto &fs : internal->fses) { + EXECUTE_OR_FAIL("fs", fs) + } } /* REQ: Runner.Execute.mount */ |