| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Add a function to unparse a URL, to make comparisons in tests easy.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We were incorrectly dropping the first strlen("file://") characters from
URLs with no scheme:
--- test/urls/data/localpath.test 2013-05-02 17:26:48.826359036 +0800
+++ /tmp/tmp.gn4JsWLw5o 2013-05-02 17:26:50.262364613 +0800
@@ -2,6 +2,6 @@
scheme file
host (null)
port (null)
-path /test/path/to/local/file
-dir /test/path/to/local/
+path ath/to/local/file
+dir ath/to/local/
file file
This change fixes the issue by indicating "no scheme found" by a NULL
return from pb_url_find_scheme, and hadling it appropriately. We add a
testcase too.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Add code to the pb-protocol layer to serialise and deserialise
boot_status messages.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
Add an initial definition for boot status messages sent to clients
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
Since we interact with libudev now, we no longer need to run udevadm.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
| |
The current list_for_each_entry_safe marco SEGVs on empty lists; the
list_entry will give us a NULL tmp on the first iteration.
This change removes the use of list_entry, as we're effectively
by-passing its NULL return semantics with our own.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
|
|
| |
Add a a function to join a string to a base URL
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
|
|
|
| |
Add a list iterator that is safe against deletion of the current
element.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We want to cater for situations where boot options may be discovered
some time after we get notificiation about devices. For instance,
discovering boot options from DHCP configuration parameters. In this
case, we'll need to notify UIs of boot options appear some time after
the device (and/or other boot options on the same device) has appeared.
This change adds a new protocol message type,
PB_PROTOCOL_ACTION_BOOT_OPTION_ADD. We also rename
PB_PROTOCOL_ACTION_ADD to make it clear that it is just for devices.
The discover server is updated to send boot option add events at device
discover time, but we are now able to decouple this later.
We also update the clients to handle the boot option add events
separately.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Curently, the protocol deserialise functions are allocating device and
boot_command structures. This (implicitly) makes them responsible for
initialisation of these structures too.
Rather that making the protocol responsible for initialising the devices
and boot commands, this change gives the deserialise functions an
argument to an already-instanciated structure. This means that the
creation is no longer implied by the deserialise.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Add a function in the protocol code to deserialise a boot message, and
use it to extract a boot_command in the discover server.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
We'll need to use the URL handling code in the server, so move it to the
lib/ directory.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
This change implements the client side of the server-based boot
interface. We add a funcion, discover_client_boot, which serialises a
boot message, then sends it to the server.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The device and boot_option types are defined in pb-protocol.h, but
aren't really specific to the procotol. This means a lot of
non-messaging-related files are #including the protocol definitions
unnecessarily.
This change separates the types out into lib/types/types.h.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rather than hard-coding in lib/system/system.c, this change adds a set
of #defines for host programs, through the autoheader config.h
These host programs can then be set through configure:
./configure HOST_PROG_MOUNT=/usr/bin/mount
Because we need to define nine host programs, we add an autoconf macro
to avoid repeating the definition code.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
|
|
|
| |
When assert is disabled, we end up with an warning for buf_len.
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>
|
|
|
|
| |
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
|
|
|
|
| |
Add the option --start-daemon to automatically start
pb-discover if it is not already started. For use
when running as a stand-alone app.
Signed-off-by: Geoff Levand <geoff@infradead.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>
|
|
|
|
| |
Signed-off-by: Geoff Levand <geoff@infradead.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>
|
| |
|
| |
|
| |
|
|
|
|
| |
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
|
|
|
|
| |
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
|
|
|
|
|
|
| |
Redirect the output of child processes to pb_log.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move some of the common system operations to lib system routines.
Creates these common routines:
pb_mkdir_recursive()
pb_rmdir_recursive()
pb_run_cmd()
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
| |
Increase the protocol payload size from 8 KiB to 64 KiB.
Udev uses some really long device names for USB mass storage
devices so the config file data can easily excceed the protocol
payload.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Correct the byte count for several memmove calls.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
| |
Add a new convenience routine pb_log_get_stream() that returns the
current PB_log stream. Used to setup the ps3-utils library to log
to the pb_log.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes the problem of big conf files not showing up in the UI.
Increases the protocol payload from 4 KiB to 8 KiB.
Also, adds some log messages when I/O errors occur, or the payload
is too large for the protocol.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
| |
Include sys/types.h in talloc.h.
talloc.h uses off_t, which is defined in sys/types.h.
Fixes this OpenWRT build error:
./lib/talloc/talloc.h:114: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'talloc_total_size'
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
|
|
|
|
|
|
|
| |
Change the symbol 'new' to an alternative. The symbol new is
reserved for C++ compilers.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
|
|
|
|
|
|
|
| |
Add a new list iteration routine list_for_each_entry_continue(). Continues
iteration from a user specified list item.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
|
|
|
|
|
|
|
|
|
|
| |
Remove the now uneeded boot_option_copy() routine.
The addition of persistant client device and boot option info
make this routine uneeded.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
Add new list insertion routines list_insert_before(), list_insert_after(),
and list_add_tail(). Also, change list_add() to use list_insert_after().
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
| |
Add routines pb_protocol_device_cmp() and pb_protocol_boot_option_cmp()
to hide the implemention details of the device. The implementation
of the id can be changed without effecting the users of it.
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>
|
|
|
|
|
|
|
| |
Make the instance of devices read-only.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|