- rc = pb_run_cmd_pipe(argv, 1, task->dry_run, task,
- &buf, &buf_len);
-
- /* if the hook returned with BOOT_HOOK_EXIT_UPDATE,
- * then we process stdout to look for updated params
- */
- if (rc == BOOT_HOOK_EXIT_UPDATE) {
- boot_hook_update(task, hooks[i]->d_name, buf);
- boot_hook_setenv(task);
+ process->path = path;
+ process->argv = argv;
+ process->keep_stdout = true;
+
+ pb_log("running boot hook %s\n", hooks[i]->d_name);
+
+ rc = process_run_sync(process);
+ if (rc) {
+ pb_log("boot hook exec failed!\n");
+
+ } else if (WIFEXITED(process->exit_status) &&
+ WEXITSTATUS(process->exit_status)
+ == BOOT_HOOK_EXIT_UPDATE) {
+ /* if the hook returned with BOOT_HOOK_EXIT_UPDATE,
+ * then we process stdout to look for updated params
+ */
+ if (rc == BOOT_HOOK_EXIT_UPDATE) {
+ boot_hook_update(task, hooks[i]->d_name,
+ process->stdout_buf);
+ boot_hook_setenv(task);
+ }