summaryrefslogtreecommitdiffstats
path: root/ui/common
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2018-07-03 16:34:47 +1000
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2018-07-10 13:46:12 +1000
commit99a1f905f585480cca2c9a43ab18ed8e37365192 (patch)
tree9839c5ce9a791cd206388f81d3a844ba82965ff7 /ui/common
parent47c55b245aab729a9c23bfb830329022c7b25d83 (diff)
downloadtalos-petitboot-99a1f905f585480cca2c9a43ab18ed8e37365192.tar.gz
talos-petitboot-99a1f905f585480cca2c9a43ab18ed8e37365192.zip
ui/ncurses: Implement F10-F12 for autoboot device control
Add a few mappings to specify temporary autoboot settings: F10: Only autoboot from disk F11: Only autoboot from USB devices F12: Only autoboot from network These use the new code to prevent cancelling autoboot. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'ui/common')
-rw-r--r--ui/common/discover-client.c18
-rw-r--r--ui/common/discover-client.h4
2 files changed, 22 insertions, 0 deletions
diff --git a/ui/common/discover-client.c b/ui/common/discover-client.c
index 784154e..88d0b4e 100644
--- a/ui/common/discover-client.c
+++ b/ui/common/discover-client.c
@@ -453,3 +453,21 @@ int discover_client_send_plugin_install(struct discover_client *client,
return pb_protocol_write_message(client->fd, message);
}
+
+int discover_client_send_temp_autoboot(struct discover_client *client,
+ const struct autoboot_option *opt)
+{
+ struct pb_protocol_message *message;
+ int len;
+
+ len = pb_protocol_temp_autoboot_len(opt);
+
+ message = pb_protocol_create_message(client,
+ PB_PROTOCOL_ACTION_TEMP_AUTOBOOT, len);
+ if (!message)
+ return -1;
+
+ pb_protocol_serialise_temp_autoboot(opt, message->payload, len);
+
+ return pb_protocol_write_message(client->fd, message);
+}
diff --git a/ui/common/discover-client.h b/ui/common/discover-client.h
index 7224691..2a2ea28 100644
--- a/ui/common/discover-client.h
+++ b/ui/common/discover-client.h
@@ -102,4 +102,8 @@ int discover_client_send_url(struct discover_client *client, char *url);
int discover_client_send_plugin_install(struct discover_client *client,
char *file);
+/* send a temporary autoboot override */
+int discover_client_send_temp_autoboot(struct discover_client *client,
+ const struct autoboot_option *opt);
+
#endif
OpenPOWER on IntegriCloud