diff options
author | Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> | 2014-07-24 15:05:36 +1000 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2014-07-28 16:02:43 +0800 |
commit | e1f6ffb9ca9e35738385a3524ba46896a0b519e6 (patch) | |
tree | 823a6baad3d7ec7a34e44254c5f84043de7be812 /discover/user-event.c | |
parent | a5dad9c05cd72820e64e0461889e9e77eaf8202d (diff) | |
download | talos-petitboot-e1f6ffb9ca9e35738385a3524ba46896a0b519e6.tar.gz talos-petitboot-e1f6ffb9ca9e35738385a3524ba46896a0b519e6.zip |
discover: Enable 'url' pb-events
Adds a new option to pb-event;
./pb-event url@dev url=scheme://path/to/petitboot.conf
Specifies a remote conf file to parse for boot options
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/user-event.c')
-rw-r--r-- | discover/user-event.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/discover/user-event.c b/discover/user-event.c index 1f70045..69defa3 100644 --- a/discover/user-event.c +++ b/discover/user-event.c @@ -54,6 +54,8 @@ static const char *event_action_name(enum event_action action) return "add"; case EVENT_ACTION_REMOVE: return "remove"; + case EVENT_ACTION_URL: + return "url"; case EVENT_ACTION_DHCP: return "dhcp"; default: @@ -430,6 +432,18 @@ static int user_event_remove(struct user_event *uev, struct event *event) return 0; } +static int user_event_url(struct user_event *uev, struct event *event) +{ + struct device_handler *handler = uev->handler; + const char *url; + + url = event_get_param(event, "url"); + if (url) + device_handler_process_url(handler, url); + + return 0; +} + static void user_event_handle_message(struct user_event *uev, char *buf, int len) { @@ -453,6 +467,9 @@ static void user_event_handle_message(struct user_event *uev, char *buf, case EVENT_ACTION_REMOVE: result = user_event_remove(uev, event); break; + case EVENT_ACTION_URL: + result = user_event_url(uev, event); + break; case EVENT_ACTION_CONF: result = user_event_conf(uev, event); break; |