6 #include "talloc/talloc.h"
8 #include "parser-utils.h"
10 int parse_user_event(struct device *device, struct event *event)
12 struct boot_option *opt;
15 opt = talloc_zero(device, struct boot_option);
20 p = event_get_param(event, "name");
23 pb_log("%s: no name found\n", __func__);
27 opt->id = talloc_asprintf(opt, "%s#%s", device->id, p);
28 opt->name = talloc_strdup(opt, p);
30 p = event_get_param(event, "image");
34 pb_log("%s: no image found\n", __func__);
38 opt->boot_image_file = talloc_strdup(opt, p);
40 p = event_get_param(event, "args");
43 opt->boot_args = talloc_strdup(opt, p);
45 opt->description = talloc_asprintf(opt, "%s %s", opt->boot_image_file,
48 device_add_boot_option(device, opt);