+ image_res = add_boot_resource(boot_task, _("kernel image"), image,
+ &boot_task->local_image);
+ initrd_res = add_boot_resource(boot_task, _("initrd"), initrd,
+ &boot_task->local_initrd);
+ dtb_res = add_boot_resource(boot_task, _("dtb"), dtb,
+ &boot_task->local_dtb);
+
+ /* start async loads for boot resources */
+ rc = start_url_load(boot_task, image_res)
+ || start_url_load(boot_task, initrd_res)
+ || start_url_load(boot_task, dtb_res);
+
+ if (boot_task->verify_signature) {
+ /* Generate names of associated signature files and load */
+ if (image) {
+ image_sig = gpg_get_signature_url(ctx, image);
+ tmp = add_boot_resource(boot_task,
+ _("kernel image signature"), image_sig,
+ &boot_task->local_image_signature);
+ rc |= start_url_load(boot_task, tmp);
+ }
+ if (initrd) {
+ initrd_sig = gpg_get_signature_url(ctx, initrd);
+ tmp = add_boot_resource(boot_task,
+ _("initrd signature"), initrd_sig,
+ &boot_task->local_initrd_signature);
+ rc |= start_url_load(boot_task, tmp);
+ }
+ if (dtb) {
+ dtb_sig = gpg_get_signature_url(ctx, dtb);
+ tmp = add_boot_resource(boot_task,
+ _("dtb signature"), dtb_sig,
+ &boot_task->local_dtb_signature);
+ rc |= start_url_load(boot_task, tmp);
+ }
+ }
+
+ if (boot_task->verify_signature || boot_task->decrypt_files) {
+ tmp = add_boot_resource(boot_task,
+ _("kernel command line signature"), cmdline_sig,
+ &boot_task->local_cmdline_signature);
+ rc |= start_url_load(boot_task, tmp);
+ }
+
+ /* If all URLs are local, we may be done. */
+ if (rc) {
+ /* Don't call boot_cancel() to preserve the status update */
+ boot_task->cancelled = true;
+ cleanup_cancellations(boot_task, NULL);
+ return NULL;
+ }
+
+ boot_process(NULL, boot_task);
+
+ return boot_task;
+}
+
+void boot_cancel(struct boot_task *task)
+{
+ task->cancelled = true;
+
+ update_status(task->status_fn, task->status_arg, STATUS_INFO,
+ _("Boot cancelled"));
+
+ cleanup_cancellations(task, NULL);