diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2018-07-03 16:34:47 +1000 |
---|---|---|
committer | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2018-07-10 13:46:12 +1000 |
commit | 99a1f905f585480cca2c9a43ab18ed8e37365192 (patch) | |
tree | 9839c5ce9a791cd206388f81d3a844ba82965ff7 /ui/common/discover-client.c | |
parent | 47c55b245aab729a9c23bfb830329022c7b25d83 (diff) | |
download | talos-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/discover-client.c')
-rw-r--r-- | ui/common/discover-client.c | 18 |
1 files changed, 18 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); +} |