| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
When DEBUG is undefed, we run out of wget arguments for loading https
URLs. We need an extra element in the argv array to handle all possible
arguments.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
We have a few incorrect checks for the exit status of a process; this
change adds a helper with the correct WIFEXITED && WEXITSTATUS==0 logic.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
Currently, we may report incorrect success when loading a URL, as we
only check the return value of process_run_sync() (and not the process
exit status itself) in load_process_to_local_file.
This fix adds a check to the synchronous load.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Busybox tftp doesn't support -V, so prints an error to stderr. We'll
only see the Busybox identifier if we capture stderr too.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Rather than #defining _GNU_SOURCE in our .c files, we can define this
from config.h instead.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
We're getting warnings from some compilers about tempnam being unsafe.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
We'd like a way to cancel pending loads, as part of aborting the boot
process.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
Make the error case for local files the same as for remotes.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, load_url and load_url_async return a filename parameter and a
tempfile flag (indicating whether the file needs to be cleaned after
use).
Instead, encapsulate this data in a struct load_url_result, which the
caller (and async callbacks) can read the status, filename and clean
parameters.
For internal use in load_url and helpers, we add a struct load_task to
hold a pointer to the load_url_result and async data.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
Rather than always trying both TFTP client types, do a runtime detection
on first invocation. This can be fixed at build-time with
--with-tftp=TYPE.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
We don't need a pointer here, just the status value.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
| |
A new load_url_async() function handles retrieving the resources by
forking an external process which currently blocks the parent waiting
for the process to complete. This patch modifies the load_*() functions
to handle it asynchronously by providing the exit callback and returning
without waiting for the child process to exit.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
|
|
|
|
|
|
|
| |
This change replaces the pb_run_cmd() function with proper usage of the
process API.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, load_url took a char * argument, from which it parsed a
newly allocated URL, and freed the URL before returning.
Commit 5be946c changed load_url (then load_file) to accept a parsed URL
instead of a char *, but didn't remove the free. Any URLs passed to
load_url are currently being unintionally free()ed.
This change removes the invalid free.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
|
|
|
| |
This is now old enough to be retired and allow config files
on ps3d devices to refer to scsi devices.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
|
|
|
|
|
|
|
|
|
|
| |
Add a check to discover's resolve_path() to test if the path
is a URL, and if so just return that path.
If the path has "file://", treat it as a local path.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix various minor build warnings:
lib/pb-protocol/pb-protocol.c:72: warning: comparison between signed and unsigned
lib/pb-protocol/pb-protocol.c:78: warning: comparison between signed and unsigned
lib/pb-protocol/pb-protocol.c:141: warning: unused parameter 'buf_len'
lib/pb-protocol/pb-protocol.c:241: warning: comparison between signed and unsigned
discover/pb-discover.c:14: warning: no previous prototype for 'sigint_handler'
discover/pb-discover.c:13: warning: unused parameter 'signum'
discover/log.c:22: warning: no previous prototype for 'pb_log_set_stream'
discover/discover-server.c:159: warning: no previous prototype for 'discover_server_notify_add'
discover/discover-server.c:169: warning: no previous prototype for 'discover_server_notify_remove'
discover/discover-server.c:179: warning: no previous prototype for 'discover_server_set_device_source'
discover/discover-server.c:184: warning: no previous prototype for 'discover_server_init'
discover/discover-server.c:229: warning: no previous prototype for 'discover_server_destroy'
discover/device-handler.c:395: warning: comparison between signed and unsigned
discover/paths.c:44: warning: comparison between signed and unsigned
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
Mount discovered devices, and set up symlinks for UUID and LABELs
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
Move the device discovery code from separate udev helpers to a single
process to listen on two sockets: one SOCK_DGRAM for incoming udev
events, and one SOCK_STREAM for UIs to connect.
Initial support for client/server infrastructure, still need to wire-up
the udev messages.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|