diff options
author | Nishanth Aravamudan <nacc@linux.vnet.ibm.com> | 2015-08-19 14:05:05 -0700 |
---|---|---|
committer | Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> | 2015-12-18 13:06:53 +1100 |
commit | 32d3249e252fe201eb81155cbf3b800ce5cf88e0 (patch) | |
tree | b5666989c2906d1a923d297f01208fb01ed8abbb /lib/pb-protocol | |
parent | 45e9e7a53540e87e2129bb11fd853501131fb795 (diff) | |
download | talos-petitboot-32d3249e252fe201eb81155cbf3b800ce5cf88e0.tar.gz talos-petitboot-32d3249e252fe201eb81155cbf3b800ce5cf88e0.zip |
ui: add URL for static configurations to load a specified file
In certain configurations, e.g. automation, we want to use static
networking but load a particular file, automatically and parse it as a
pxelinux config file. Currently, we support something like this for DHCP
based booting, but not static. Add a URL field to the UI for static
configurations and reuse the logic from device_handler_process_url() to
load the specified file.
Signed-off-by: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Diffstat (limited to 'lib/pb-protocol')
-rw-r--r-- | lib/pb-protocol/pb-protocol.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/pb-protocol/pb-protocol.c b/lib/pb-protocol/pb-protocol.c index ab5ea8a..9d07a58 100644 --- a/lib/pb-protocol/pb-protocol.c +++ b/lib/pb-protocol/pb-protocol.c @@ -260,6 +260,7 @@ static int pb_protocol_interface_config_len(struct interface_config *conf) if (conf->method == CONFIG_METHOD_STATIC) { len += 4 + optional_strlen(conf->static_config.address); len += 4 + optional_strlen(conf->static_config.gateway); + len += 4 + optional_strlen(conf->static_config.url); } return len; @@ -454,6 +455,8 @@ static int pb_protocol_serialise_config_interface(char *buf, conf->static_config.address); pos += pb_protocol_serialise_string(pos, conf->static_config.gateway); + pos += pb_protocol_serialise_string(pos, + conf->static_config.url); } return pos - buf; @@ -900,6 +903,9 @@ static int pb_protocol_deserialise_config_interface(const char **buf, if (read_string(iface, buf, len, &iface->static_config.gateway)) return -1; + + if (read_string(iface, buf, len, &iface->static_config.url)) + return -1; } return 0; |