]> git.ozlabs.org Git - petitboot/blobdiff - ui/common/loader.c
Add boot command structure to petitboot protocol description
[petitboot] / ui / common / loader.c
index 5c69533ff3cc821f96bbc313259bcb29d0cedf0f..74b3c76ed63ddb44a84e70662b414df7ad81a8b0 100644 (file)
@@ -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, 0);
 
        talloc_free(opts);
 
@@ -122,7 +122,7 @@ fail:
 static char *pb_load_sftp(void *ctx, struct pb_url __attribute__((unused)) *url)
 {
        int result;
-       const char *argv[5];
+       const char *argv[4];
        const char **p;
        char *local;
 
@@ -132,13 +132,12 @@ static char *pb_load_sftp(void *ctx, struct pb_url __attribute__((unused)) *url)
                return NULL;
 
        p = argv;
-       *p++ = pb_system_apps.sftp;     /* 1 */
-       *p++ = url->host;               /* 2 */
-       *p++ = url->path;               /* 3 */
-       *p++ = local;                   /* 4 */
-       *p++ = NULL;                    /* 5 */
+       *p++ = pb_system_apps.sftp;                                     /* 1 */
+       *p++ = talloc_asprintf(local, "%s:%s", url->host, url->path);   /* 2 */
+       *p++ = local;                                                   /* 3 */
+       *p++ = NULL;                                                    /* 4 */
 
-       result = pb_run_cmd(argv);
+       result = pb_run_cmd(argv, 1, 0);
 
        if (result)
                goto fail;
@@ -183,7 +182,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, 0);
 
        if (!result)
                return local;
@@ -203,7 +202,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, 0);
 
        if (!result)
                return local;
@@ -248,7 +247,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, 0);
 
        if (result)
                goto fail;