diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2013-02-27 16:45:21 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2013-04-15 15:42:27 +0800 |
commit | c62667e5c78ea212e5ac49244e9792954a1d8f71 (patch) | |
tree | 4206cfff1ddd26ad16e279b065fdf41c00664bb6 /ui/twin/pbt-client.c | |
parent | b8122dc9340e2f208220f0c88b4d71f91b78774f (diff) | |
download | petitboot-c62667e5c78ea212e5ac49244e9792954a1d8f71.zip petitboot-c62667e5c78ea212e5ac49244e9792954a1d8f71.tar.gz |
Move boot to discover server
This change moves the boot-via-kexec functionality from the UIs to the
discover server.
On the UI side: rather than run kexec directly, we just send a message
to the discover server. Because this is generic discover client
functionality, we no longer need the boot callbacks in the twin- and
ncurses-specific code.
We also remove the kexec and URL-loading code from the UIs, and add it
to the discover server code, in paths.c. We expose this to the server
though a new function:
load_path(void *, const char *, unsigned int *);
On the server side, we simply move hook up the boot() function to use
the load_file and kexec calls.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui/twin/pbt-client.c')
-rw-r--r-- | ui/twin/pbt-client.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/ui/twin/pbt-client.c b/ui/twin/pbt-client.c index dfbe955..c664740 100644 --- a/ui/twin/pbt-client.c +++ b/ui/twin/pbt-client.c @@ -62,18 +62,15 @@ static int pbt_client_boot(struct pbt_item *item) pbt_frame_status_printf(&item->pbt_client->frame, "Booting %s...", pbt_item_name(item)); - assert(item->pbt_client->boot_cb); - result = item->pbt_client->boot_cb(item->pbt_client, opt_data); + result = discover_client_boot(item->pbt_client->discover_client, + opt_data->dev, opt_data->opt, opt_data->bd); - if (!result) { - sleep(item->pbt_client->dry_run ? 1 : 60); + if (result) { + pb_log("%s: failed: %s\n", __func__, opt_data->bd->image); + pbt_frame_status_printf(&item->pbt_client->frame, + "Failed: kexec %s", opt_data->bd->image); } - pb_log("%s: failed: %s\n", __func__, opt_data->bd->image); - - pbt_frame_status_printf(&item->pbt_client->frame, "Failed: kexec %s", - opt_data->bd->image); - return 0; } @@ -265,7 +262,6 @@ static void pbt_client_destructor(struct pbt_client *client) struct pbt_client *pbt_client_init(enum pbt_twin_backend backend, unsigned int width, unsigned int height, - int (*boot_cb)(struct pbt_client *, struct pb_opt_data *), int start_deamon, int dry_run) { struct pbt_client *pbt_client; @@ -284,7 +280,6 @@ struct pbt_client *pbt_client_init(enum pbt_twin_backend backend, pbt_client->waitset = waitset_create(pbt_client); pbt_client->sig = "pbt_client"; - pbt_client->boot_cb = boot_cb; pbt_client->dry_run = dry_run; pbt_client->frame.scr = pbt_scr_init(pbt_client, pbt_client->waitset, backend, width, height, NULL, NULL); |