6 #include "talloc/talloc.h"
8 #include "parser-utils.h"
11 * parse_user_event - Parse a user event.
13 * Understands params: name, image, args.
16 int parse_user_event(struct device *device, struct event *event)
18 struct boot_option *opt;
21 opt = talloc_zero(device, struct boot_option);
26 p = event_get_param(event, "name");
29 pb_log("%s: no name found\n", __func__);
33 opt->id = talloc_asprintf(opt, "%s#%s", device->id, p);
34 opt->name = talloc_strdup(opt, p);
36 p = event_get_param(event, "image");
40 pb_log("%s: no image found\n", __func__);
44 opt->boot_image_file = talloc_strdup(opt, p);
46 p = event_get_param(event, "args");
49 opt->boot_args = talloc_strdup(opt, p);
51 opt->description = talloc_asprintf(opt, "%s %s", opt->boot_image_file,
54 device_add_boot_option(device, opt);