summaryrefslogtreecommitdiffstats
path: root/discover/network.c
diff options
context:
space:
mode:
authorNishanth Aravamudan <nacc@linux.vnet.ibm.com>2015-08-19 14:05:05 -0700
committerSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2015-12-18 13:06:53 +1100
commit32d3249e252fe201eb81155cbf3b800ce5cf88e0 (patch)
treeb5666989c2906d1a923d297f01208fb01ed8abbb /discover/network.c
parent45e9e7a53540e87e2129bb11fd853501131fb795 (diff)
downloadpetitboot-32d3249e252fe201eb81155cbf3b800ce5cf88e0.zip
petitboot-32d3249e252fe201eb81155cbf3b800ce5cf88e0.tar.gz
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 'discover/network.c')
-rw-r--r--discover/network.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/discover/network.c b/discover/network.c
index 0dad087..f763687 100644
--- a/discover/network.c
+++ b/discover/network.c
@@ -336,7 +336,8 @@ static void configure_interface_dhcp(struct interface *interface)
return;
}
-static void configure_interface_static(struct interface *interface,
+static void configure_interface_static(struct network *network,
+ struct interface *interface,
const struct interface_config *config)
{
int rc;
@@ -370,6 +371,12 @@ static void configure_interface_static(struct interface *interface,
interface->name);
}
+ if (config->static_config.url) {
+ pb_log("config URL %s\n", config->static_config.url);
+ device_handler_process_url(network->handler,
+ config->static_config.url);
+ }
+
return;
}
@@ -438,7 +445,7 @@ static void configure_interface(struct network *network,
configure_interface_dhcp(interface);
} else if (config->method == CONFIG_METHOD_STATIC) {
- configure_interface_static(interface, config);
+ configure_interface_static(network, interface, config);
}
}
OpenPOWER on IntegriCloud