- }
-
- if (task->state == BOOT_STATE_IMAGE_LOADING) {
- if (result->status == LOAD_ERROR) {
- update_status(task->status_fn, task->status_arg,
- BOOT_STATUS_ERROR,
- "Error loading kernel image");
- goto no_load;
- }
- task->state = BOOT_STATE_INITRD_LOADING;
-
- if (task->initrd_url) {
- update_status(task->status_fn, task->status_arg,
- BOOT_STATUS_INFO, "loading initrd");
- task->initrd = load_url_async(task, task->initrd_url,
- boot_process, task);
- if (!task->initrd) {
- update_status(task->status_fn, task->status_arg,
- BOOT_STATUS_ERROR,
- "Couldn't load initrd image");
- goto no_load;
- }
- return;
- }
- }
-
- if (task->state == BOOT_STATE_INITRD_LOADING) {
- if (result->status) {
- update_status(task->status_fn, task->status_arg,
- BOOT_STATUS_ERROR,
- "Error loading initrd");
- goto no_load;
- }
- task->state = BOOT_STATE_DTB_LOADING;
-
- if (task->dtb_url) {
- update_status(task->status_fn, task->status_arg,
- BOOT_STATUS_INFO,
- "loading device tree");
- task->dtb = load_url_async(task, task->dtb_url,
- boot_process, task);
- if (!task->dtb) {
- update_status(task->status_fn, task->status_arg,
- BOOT_STATUS_ERROR,
- "Couldn't load device tree");
- goto no_load;
- }
- return;
- }
- }
-
- if (task->state == BOOT_STATE_DTB_LOADING) {
- if (result->status) {
- update_status(task->status_fn, task->status_arg,
- BOOT_STATUS_ERROR,
- "Error loading dtb");
- goto no_load;
- }
- task->state = BOOT_STATE_FINISH;
- }