summaryrefslogtreecommitdiffstats
path: root/ui/common
diff options
context:
space:
mode:
Diffstat (limited to 'ui/common')
-rw-r--r--ui/common/loader.c10
-rw-r--r--ui/common/ui-system.c30
-rw-r--r--ui/common/ui-system.h1
3 files changed, 33 insertions, 8 deletions
diff --git a/ui/common/loader.c b/ui/common/loader.c
index 5c69533..009871d 100644
--- a/ui/common/loader.c
+++ b/ui/common/loader.c
@@ -94,7 +94,7 @@ static char *pb_load_nfs(void *ctx, struct pb_url *url)
*p++ = local; /* 7 */
*p++ = NULL; /* 8 */
- result = pb_run_cmd(argv);
+ result = pb_run_cmd(argv, 1);
talloc_free(opts);
@@ -138,7 +138,7 @@ static char *pb_load_sftp(void *ctx, struct pb_url __attribute__((unused)) *url)
*p++ = local; /* 4 */
*p++ = NULL; /* 5 */
- result = pb_run_cmd(argv);
+ result = pb_run_cmd(argv, 1);
if (result)
goto fail;
@@ -183,7 +183,7 @@ static char *pb_load_tftp(void *ctx, struct pb_url *url)
*p++ = url->port; /* 8 */
*p++ = NULL; /* 9 */
- result = pb_run_cmd(argv);
+ result = pb_run_cmd(argv, 1);
if (!result)
return local;
@@ -203,7 +203,7 @@ static char *pb_load_tftp(void *ctx, struct pb_url *url)
*p++ = local; /* 9 */
*p++ = NULL; /* 10 */
- result = pb_run_cmd(argv);
+ result = pb_run_cmd(argv, 1);
if (!result)
return local;
@@ -248,7 +248,7 @@ static char *pb_load_wget(void *ctx, struct pb_url *url, enum wget_flags flags)
*p++ = "--no-check-certificate"; /* 6 */
*p++ = NULL; /* 7 */
- result = pb_run_cmd(argv);
+ result = pb_run_cmd(argv, 1);
if (result)
goto fail;
diff --git a/ui/common/ui-system.c b/ui/common/ui-system.c
index 0140f0e..8604848 100644
--- a/ui/common/ui-system.c
+++ b/ui/common/ui-system.c
@@ -33,6 +33,30 @@
#include "ui-system.h"
/**
+ * pb_start_daemon - start the pb-discover daemon.
+ */
+
+int pb_start_daemon(void)
+{
+ int result;
+ const char *argv[2];
+ char *name = talloc_asprintf(NULL, "%s/sbin/pb-discover",
+ pb_system_apps.prefix);
+
+ argv[0] = name;
+ argv[1] = NULL;
+
+ result = pb_run_cmd(argv, 0);
+
+ talloc_free(name);
+
+ if (result)
+ pb_log("%s: failed: (%d)\n", __func__, result);
+
+ return result;
+}
+
+/**
* kexec_load - kexec load helper.
* @l_image: The local image file for kexec to execute.
* @l_initrd: Optional local initrd file for kexec --initrd, can be NULL.
@@ -67,7 +91,7 @@ static int kexec_load(const char *l_image, const char *l_initrd,
*p++ = l_image; /* 5 */
*p++ = NULL; /* 6 */
- result = pb_run_cmd(argv);
+ result = pb_run_cmd(argv, 1);
if (result)
pb_log("%s: failed: (%d)\n", __func__, result);
@@ -98,7 +122,7 @@ static int kexec_reboot(void)
*p++ = "now"; /* 3 */
*p++ = NULL; /* 4 */
- result = pb_run_cmd(argv);
+ result = pb_run_cmd(argv, 1);
/* On error, force a kexec with the -e option */
@@ -108,7 +132,7 @@ static int kexec_reboot(void)
*p++ = "-e"; /* 2 */
*p++ = NULL; /* 3 */
- result = pb_run_cmd(argv);
+ result = pb_run_cmd(argv, 1);
}
if (result)
diff --git a/ui/common/ui-system.h b/ui/common/ui-system.h
index ca5edb4..87ab891 100644
--- a/ui/common/ui-system.h
+++ b/ui/common/ui-system.h
@@ -32,6 +32,7 @@ struct pb_kexec_data {
};
int pb_run_kexec(const struct pb_kexec_data *kd);
+int pb_start_daemon(void);
unsigned int pb_elf_hash(const char *str);
unsigned int pb_cat_hash(const char *a, const char *b);
OpenPOWER on IntegriCloud