]> git.ozlabs.org Git - petitboot/blobdiff - ui/ncurses/ps3-main.c
Add boot command structure to petitboot protocol description
[petitboot] / ui / ncurses / ps3-main.c
index 69913edc73910dcca30173649d6ceeb319b364e4..3b9fab167af22e444e4a3f67e1fc68240dbea32e 100644 (file)
@@ -267,13 +267,13 @@ static int ps3_svm_cb(struct pmenu_item *item)
 }
 
 /**
- * ps3_kexec_cb - The kexec callback.
+ * ps3_boot_cb - The kexec callback.
  *
- * Writes config data to PS3 flash then calls pb_run_kexec().
+ * Writes config data to PS3 flash then calls pb_boot().
  * Adds a video mode arg to the kernel command line if needed.
  */
 
-static int ps3_kexec_cb(struct cui *cui, struct cui_opt_data *cod)
+static int ps3_boot_cb(struct cui *cui, struct cui_opt_data *cod)
 {
        struct ps3_cui *ps3 = ps3_from_cui(cui);
        int result;
@@ -294,24 +294,24 @@ static int ps3_kexec_cb(struct cui *cui, struct cui_opt_data *cod)
 
        /* Add a default kernel video mode. */
 
-       if (!cod->kd->args) {
+       if (!cod->bd->args) {
                altered_args = 1;
                orig_args = NULL;
-               cod->kd->args = talloc_asprintf(NULL, "video=ps3fb:mode:%u",
+               cod->bd->args = talloc_asprintf(NULL, "video=ps3fb:mode:%u",
                        (unsigned int)ps3->values.video_mode);
-       } else if (!strstr(cod->kd->args, "video=")) {
+       } else if (!strstr(cod->bd->args, "video=")) {
                altered_args = 1;
-               orig_args = cod->kd->args;
-               cod->kd->args = talloc_asprintf(NULL, "%s video=ps3fb:mode:%u",
+               orig_args = cod->bd->args;
+               cod->bd->args = talloc_asprintf(NULL, "%s video=ps3fb:mode:%u",
                        orig_args, (unsigned int)ps3->values.video_mode);
        } else
                altered_args = 0;
 
-       result = pb_run_kexec(cod->kd);
+       result = pb_boot(cod->bd, ps3->cui->dry_run);
 
        if (altered_args) {
-               talloc_free(cod->kd->args);
-               cod->kd->args = orig_args;
+               talloc_free(cod->bd->args);
+               cod->bd->args = orig_args;
        }
 
        return result;
@@ -658,7 +658,7 @@ int main(int argc, char *argv[])
        if (!result && (ps3.values.video_mode != (uint16_t)mode))
                ps3_set_video_mode(ps3.values.video_mode);
 
-       ps3.cui = cui_init(&ps3, ps3_kexec_cb, ps3_sixaxis_map);
+       ps3.cui = cui_init(&ps3, ps3_boot_cb, ps3_sixaxis_map);
 
        if (!ps3.cui)
                return EXIT_FAILURE;