summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2020-05-24 21:44:33 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2020-05-24 21:44:33 -0500
commit5f79593f3d3c4b0dd56b7438de032746f0b07bb2 (patch)
tree732be1cc4944602fe4e5179ada1625008f987d70
parente355395ee830bdffe3f88c39c77e3aca2043a19c (diff)
downloadhorizon-5f79593f3d3c4b0dd56b7438de032746f0b07bb2.tar.gz
horizon-5f79593f3d3c4b0dd56b7438de032746f0b07bb2.tar.bz2
horizon-5f79593f3d3c4b0dd56b7438de032746f0b07bb2.tar.xz
horizon-5f79593f3d3c4b0dd56b7438de032746f0b07bb2.zip
Image creator: Run backend `prepare()` before script
This ensures that the backend preparation method can do things that affect the target environment. Necessary for ISO prep, at least.
-rw-r--r--image/creator.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/image/creator.cc b/image/creator.cc
index c83c597..8a6cc73 100644
--- a/image/creator.cc
+++ b/image/creator.cc
@@ -158,13 +158,6 @@ int main(int argc, char *argv[]) {
} else {
int ret;
- my_script->setTargetDirectory(ir_dir);
-
- if(!my_script->execute()) {
- exit_code = EXIT_FAILURE;
- goto trouble;
- }
-
#define RUN_PHASE_OR_TROUBLE(_PHASE, _FRIENDLY) \
ret = backend->_PHASE();\
if(ret != 0) {\
@@ -175,6 +168,14 @@ int main(int argc, char *argv[]) {
}
RUN_PHASE_OR_TROUBLE(prepare, "preparation");
+
+ my_script->setTargetDirectory(ir_dir);
+
+ if(!my_script->execute()) {
+ exit_code = EXIT_FAILURE;
+ goto trouble;
+ }
+
RUN_PHASE_OR_TROUBLE(create, "creation");
RUN_PHASE_OR_TROUBLE(finalise, "finalisation");
}