diff options
-rw-r--r-- | hscript/disk.cc | 4 | ||||
-rw-r--r-- | hscript/script.cc | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/hscript/disk.cc b/hscript/disk.cc index 634e56f..bec5d3e 100644 --- a/hscript/disk.cc +++ b/hscript/disk.cc @@ -531,6 +531,7 @@ bool LVMGroup::validate(ScriptOptions) const { } bool LVMGroup::test_pv(ScriptOptions) const { +#ifdef HAS_INSTALL_ENV const char *fstype = blkid_get_tag_value(nullptr, "TYPE", this->pv().c_str()); if(fstype == nullptr) { @@ -539,6 +540,9 @@ bool LVMGroup::test_pv(ScriptOptions) const { } return (strcmp(fstype, "LVM2_member") == 0); +#else + return true; +#endif } bool LVMGroup::execute(ScriptOptions) const { diff --git a/hscript/script.cc b/hscript/script.cc index 9913b2a..357ed15 100644 --- a/hscript/script.cc +++ b/hscript/script.cc @@ -872,12 +872,14 @@ bool Script::validate() const { if(seen_pvs.find(vg->pv()) == seen_pvs.end()) { /* Okay, let's see if a PV already exists there... */ if(opts.test(InstallEnvironment)) { +#ifdef HAS_INSTALL_ENV if(!vg->test_pv(opts)) { failures++; output_error("installfile:" + std::to_string(vg->lineno()), "lvm_vg: a physical volume does not exist on " + vg->pv()); } +#endif } else { /* We can't tell if we aren't running on the target. */ output_warning("installfile:" + std::to_string(vg->lineno()), |