| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
We'd like to correlate incoming network boot options with a device, so
register the interface with the device hander.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, we pass "events" between the udev, user-event and
device-handler layers. These events all get sent through
device_handler_event, then de-multiplexed to an appropriate handler,
depending on their source.
Instead, just export relevant device_handler functions, and have the
(old) event sources call these functions directly.
This also means we can include a lot more of the device hander code in
the parser tests.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
Rather than exposing log internals (through always_flush and
set_stream), do all logging init through pb_log_init(). If pb_log_init()
hasn't been called, pb_log will drop messages.
Also, add a pb_debug() function, specifically for debugging information.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Implement dry-run behaviour on the discover server by passing a bool to
process_init. UIs don't need to support dry runs.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
Replace pb_run_cmd_pipe with process_create / process_run_sync.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
We can rely on the ctx free to destroy the waitset.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Add new routine config_set_autoboot(), and use it to set
the --no-autoboot option.
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
|
|
|
| |
Add the command line option --no-autoboot to pb-discover
and update the pb-discover manpage.
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
| |
Add a library for (name, value) configuration.
Different storage backends are allowed (although currently hardcoded to
powerpc nvram), and config is read-only at present.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
When we see a boot option with is_default set, store it in the handler
and register a timeout waiter.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
With the switch of the discover server to use the libudev
enumeration support the udev_trigger() routine has becone
empty and is no longer needed.
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
|
|
|
| |
To avoid symbol clashes with libudev, rename struct udev to
struct pb_udev. No functional changes.
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
| |
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
|
|
|
| |
Now that the server does the booting, we should move the --dry-run
argument to the server.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
| |
Rather than defining the set of waiters (and pollfds) in waiter.c, add a
struct waitset to contain these. A waitset is created with
waitset_create, which is passed to the waiter_* functions.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
| |
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
| |
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
|
|
| |
Add --help, --log, and --version command line options to the discover server.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
|
|
|
|
|
|
|
| |
Add a gereric event interface to pb-discover.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
Add a new routine udev_trigger() that requests a replay of
system udev events.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Log discover server messages to a file. Helps in debugging
the server when is has problems at system startup.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Move the log routines to the petitboot library. The log
routines are generic enough to be used for both server and
client. Does not change the log source.
jk: move to lib/log/ instead of lib/
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
| |
Move the waiter routines into the petitboot library. The waiter
routines are generic enough to be used for both server and
client. Does not change the waiter source.
jk: move to lib/waiter/ instead of lib/
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>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
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>
|