- talloc_free(s_initrd);
- talloc_free(s_args);
-
- return result;
-}
-
-/**
- * pb_run_kexec - Run kexec with the supplied boot options.
- */
-
-int pb_run_kexec(const struct pb_kexec_data *kd)
-{
- int result;
- char *l_image = NULL;
- char *l_initrd = NULL;
-
- pb_log("%s: image: '%s'\n", __func__, kd->image);
- pb_log("%s: initrd: '%s'\n", __func__, kd->initrd);
- pb_log("%s: args: '%s'\n", __func__, kd->args);
-
- if (kd->image) {
- l_image = pb_load_file(NULL, kd->image);
- if (!l_image)
- return -1;
- }
-
- if (kd->initrd) {
- l_initrd = pb_load_file(NULL, kd->initrd);
- if (!l_initrd)
- return -1;
- }
-
- if (!l_image && !l_initrd)
- return -1;
-
- result = run_kexec_local(l_image, l_initrd, kd->args);
-
- talloc_free(l_image);
- talloc_free(l_initrd);
-