| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
This change adds a debug flag to the config, and groups it under
not-user-modifiable parts of struct config.
This means we no longer need the pb-sysinfo helper, as the last
remaining function (--debug-enabled) can be implemented with pb-config.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
We want the discover server to respect the configured language, so we'll
need to add appropriate setlocale() calls. We use the config->lang
setting to use any previously-saved language.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
We need to check for equality with opt_yes, not just check for non-zero.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, we need to compile with -DDEBUG to implement debug-level
logging in the UIs and discover server.
Since we may not be able to easily replace a system's petitboot
binaries, this change introduces a -v|--verbose option to the discver
server and ncurses UI, which enables debug at runtime. We also move some
of the udev debug code out of an #ifdef DEBUG block.
Since petitboot is generally started on boot, we also add a little
infrastructure to pass -v to petitboot on certain system contitions:
either petitboot.debug on the kernel command line, or a petitboot,debug?
NVRAM property containing the value 'true'.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, the pb-discover main() function initialises the device
handler and the device sources.
We want to eventually be able to re-init the device sources, which will
be initiated by the handler. In this case, the handler will need
references to the sources.
This change moves the creation of the device sources to be internal to
the handler. This way, the device handler gets a reference to
everything, without having to pass pointers around in main().
We also remove the _destroy functions, as we handle everything through
talloc destructors, as all sources are parented to the handler. We also
change user_event_init and udev_init to take the handler as the first
('context') argument, to make them consistent with network_init.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There's no need to include the config storage code in lib/ as only the
discover server should be using it.
This change moves the config-storage code to discover/, with the
platform-specific parts moved to a 'struct platform'. Each platform has
a probe function, which is called during init. The first probe function
to return a platform is used.
At present we only have the one platform, but it's now non-intrusive to
add others.
We keep an array of platform pointers in a separate ("platforms")
section, to allow the test module to drop-in its own test "platform".
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
We want to down the interfaces that we brought up, so hook up the
network_shutdown function to the discover exit path. Also, we only want
to down interfaces that we've configured, and exclude lo.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
We have a few allocations hanging around at the end of pb-discover; free
them.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
Add a little infrastructure for communicating information about the
system to the petitboot UIs. We just send some identifying info (type
and identifier), as well as the interfaces.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
Change f611bde3 shifted the config_init until after process_init, as we
need to run processes during config init. We also needed to move the
config_set_autoboot invocation too.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
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>
|