diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-26 01:09:57 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-26 01:09:57 -0500 |
commit | cd2ab0ea31fd4dc9305c1d5e08100eafaff19f7e (patch) | |
tree | 56f0f158ae77150952014557b716986199ad4938 /hscript/disk.cc | |
parent | a5da0c07e7202f44b03acfc1324fb410bff94496 (diff) | |
download | horizon-cd2ab0ea31fd4dc9305c1d5e08100eafaff19f7e.tar.gz horizon-cd2ab0ea31fd4dc9305c1d5e08100eafaff19f7e.tar.bz2 horizon-cd2ab0ea31fd4dc9305c1d5e08100eafaff19f7e.tar.xz horizon-cd2ab0ea31fd4dc9305c1d5e08100eafaff19f7e.zip |
hscript: Implement lvm_pv, add tests
Diffstat (limited to 'hscript/disk.cc')
-rw-r--r-- | hscript/disk.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/hscript/disk.cc b/hscript/disk.cc index c41e6d0..3423928 100644 --- a/hscript/disk.cc +++ b/hscript/disk.cc @@ -381,6 +381,29 @@ bool Partition::execute(ScriptOptions) const { } +Key *LVMPhysical::parseFromData(const std::string &data, int lineno, + int *errors, int *warnings) { + if(data.size() < 6 || data.substr(0, 5) != "/dev/") { + if(errors) *errors += 1; + output_error("installfile:" + std::to_string(lineno), + "lvm_pv: expected an absolute path to a block device"); + return nullptr; + } + + /*if(access(data.c_str(), F_OK) != 0) { + if(warnings) *warnings += 1; + output_warning("installfile:" + std::to_string(lineno), + "lvm_pv: device may not exist"); + }*/ + + return new LVMPhysical(lineno, data); +} + +bool LVMPhysical::execute(ScriptOptions) const { + return false; +} + + Key *Mount::parseFromData(const std::string &data, int lineno, int *errors, int *warnings) { std::string dev, where, opt; |