summaryrefslogtreecommitdiffstats
path: root/discover/boot.c
Commit message (Collapse)AuthorAgeFilesLines
* discover/boot: Add booting status messageJeremy Kerr2013-09-231-0/+13
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/boot: Allow printf formatting in update_statusJeremy Kerr2013-09-231-3/+9
| | | | | | | It'd be nice to include arbitrary format strings here, so do a taloc_vasprintf in update_status. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/boot: Fix log message with no newlineJeremy Kerr2013-09-231-1/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/boot: Fix use-after-free in boot()Jeremy Kerr2013-09-191-2/+2
| | | | | | We need boot_task for kexec_reboot. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/process: replace pb_run_cmdJeremy Kerr2013-08-191-28/+10
| | | | | | | This change replaces the pb_run_cmd() function with proper usage of the process API. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/process: replace pb_run_cmd_pipeJeremy Kerr2013-08-191-14/+30
| | | | | | Replace pb_run_cmd_pipe with process_create / process_run_sync. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/boot: talloc struct boot_taskJeremy Kerr2013-08-191-38/+34
| | | | | | | | | Rather than using the stack for struct boot_task, talloc one instead. This gives us a short-lived context (active for the boot() process only), and we don't need to use the externally-provided context directly. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: fix segfault on failed boot image loadJeremy Kerr2013-08-011-2/+3
| | | | | | | | | | If the boot image fails to load, we end up calling talloc_free on an unitialised are of stack (boot_task.local_initrd). Move the initialisers a little earlier, so we always NULL pointers before potentially freeing. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/boot: Allow boot hooks to alter boot dataJeremy Kerr2013-06-241-11/+86
| | | | | | | By exiting with status == 2, boot hooks can update boot data by printing name=value to stdout. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/boot: Add boot hooksJeremy Kerr2013-06-241-0/+63
| | | | | | | | Add a method of running pre-boot hooks. Executable files in /etc/petitboot/boot.d/ are run (in order) before we start the boot process. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/boot: Put all boot params into a struct boot_taskJeremy Kerr2013-06-241-38/+43
| | | | | | This keeps all the boot-specific details in one place. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add initial dtb supportGeoff Levand2013-06-241-8/+41
| | | | | | | Updates & fixes by Jeremy Kerr <jk@ozlabs.org>. Signed-off-by: Geoff Levand <geoff@infradead.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/boot: Allow null boot commandJeremy Kerr2013-06-241-3/+3
| | | | | | If we're booting from a default option, we don't have a boot command. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: kexec harderJeremy Kerr2013-05-061-0/+15
| | | | | | | | `kexec -e` will just call shutdown, which we've already tried, so it's likely to fail. Add a further fallback to force a kexec with -e -f options. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Send boot status messages during boot()Jeremy Kerr2013-05-061-4/+44
| | | | | | | Now what we have protocol support, send status updates during the boot process. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Change parsers to emit resources rather than filenamesJeremy Kerr2013-04-291-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | This change switches the parsers over to populate the resources in discover_boot_option, rather than the string parameters in boot_option. To do this, we need a few things: * Add struct resources to discover_boot_option for the boot_image, initrd and icon data. * Have the parsers populate the resources, rather than the strings. Currently, parsers can all use the devpath resource type. * Add a resolve_resource callback to parsers; this is how the device handler will attempt to resolve resources. * Change load_file to load_url, as we should be only accessing (resolved) resources by URLs. This then allows us to remove the mount map, and associated lookup code, as well as the UUID and label links to devices. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Fix potentially-unused var warningJeremy Kerr2013-04-291-1/+1
| | | | | | | discover/boot.c: In function ‘boot’: discover/boot.c:153:13: error: ‘local_initrd’ may be used uninitialized in this function [-Werror=maybe-uninitialized] Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Fix boot with initrd errorGeoff Levand2013-04-151-2/+2
| | | | | | Fix typo in boot() routine. Signed-off-by: Geoff Levand <geoff@infradead.org>
* Move boot to discover serverJeremy Kerr2013-04-151-6/+151
| | | | | | | | | | | | | | | | | | | | | 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>
* discover: Implement device handler boot pathJeremy Kerr2013-04-151-0/+14
This change adds a funtion, device_handler_boot, which processes the boot command message from the discover server. We add a new file, discover/boot.c (and a corresponding header) with a skeleton for the final kexec code. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud