summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* waiter: Don't rely on global variables to keep waiter stateJeremy Kerr2013-04-102-34/+57
| | | | | | | | | 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>
* lib/types: Create common file for type definitionsJeremy Kerr2013-04-103-26/+34
| | | | | | | | | | | | 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>
* Allow host programs to be configuredJeremy Kerr2013-03-051-10/+10
| | | | | | | | | | | | | | | 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>
* Add udevadm to pb_system_appsJeremy Kerr2013-03-052-0/+2
| | | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
* lib/pb-protocol: suppress warning for unused buf_len argJeremy Kerr2013-03-051-0/+1
| | | | | | | 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>
* Cleanup --dry-run option codeGeoff Levand2012-03-302-4/+11
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Add new macro DEFINE_LIST()Geoff Levand2012-03-261-1/+3
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Log to stderr, allow --log=-Geoff Levand2012-03-261-3/+3
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Add --start-daemon option to ui programsGeoff Levand2012-03-083-3/+9
| | | | | | | | 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>
* Convert build to use automakeGeoff Levand2012-02-121-0/+35
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Add custom TALLOC_ABORTGeoff Levand2011-11-121-0/+7
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Add va-copy check to configure.acGeoff Levand2011-11-121-6/+7
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Add list_prev_entry, list_next_entryGeoff Levand2011-11-111-4/+9
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Return NULL for head list_entryGeoff Levand2011-11-111-7/+9
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Cleanup list formattingGeoff Levand2011-11-111-12/+12
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Add STATIC_LIST initializerGeoff Levand2011-11-111-0/+7
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Fix waiter_register return valueGeoff Levand2011-11-031-1/+5
|
* Add pb_protocol_dump_deviceGeoff Levand2011-10-302-0/+25
|
* Add n_options to struct deviceGeoff Levand2011-10-272-0/+3
|
* Fix seg fault on ps3 flash errorGeoff Levand2009-08-251-1/+1
| | | | Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
* Delete kexec temporary files before rebootingGeoff Levand2009-07-092-0/+2
| | | | Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
* Log child outputGeoff Levand2009-07-091-2/+14
| | | | | | Redirect the output of child processes to pb_log. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
* Move common system routines to libGeoff Levand2009-06-302-0/+177
| | | | | | | | | | | | 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 protocol payload size to 64KiBGeoff Levand2009-06-301-1/+1
| | | | | | | | | | | 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>
* Fix memmove sizeGeoff Levand2009-06-301-1/+2
| | | | | | | 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>
* Get log streamGeoff Levand2009-03-302-0/+6
| | | | | | | | | 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>
* Increase protocol payload sizeGeoff Levand2009-03-302-4/+18
| | | | | | | | | | | | 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 types header in tallocGeoff Levand2009-03-231-0/+1
| | | | | | | | | | | 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>
* Rename symbol newGeoff Levand2009-03-232-16/+16
| | | | | | | 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 list_for_each_entry_continue routineGeoff Levand2009-03-231-0/+4
| | | | | | | 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 boot_option_copy routineGeoff Levand2009-02-212-22/+0
| | | | | | | | | | 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 list insert routinesGeoff Levand2009-02-212-9/+23
| | | | | | | | 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 protocol object compare routinesGeoff Levand2009-02-212-0/+15
| | | | | | | | | 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>
* [pb-protocol] Add ui_info member to devices and boot optionsJeremy Kerr2009-02-011-0/+4
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Make device instance constantGeoff Levand2009-02-012-11/+13
| | | | | | | 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>
* Add boot_option_copy routineGeoff Levand2009-02-012-0/+21
| | | | | | | Add the convenience routine boot_option_copy(). Does a deep copy. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Flush log stream on writeGeoff Levand2009-02-012-0/+11
| | | | | | | | | Flush the pb_log stream when the stream is changed, and add an option to flush the pb_log stream on every write. Useful while debugging. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Move log to libraryGeoff Levand2009-02-012-0/+32
| | | | | | | | | | | 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>
* Fix waiter allocGeoff Levand2009-02-011-1/+2
| | | | | | | | Add the missing assignment of the global n_pollfds variable. Fix a minor memory leak in waiter_poll(). Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Move waiter to libraryGeoff Levand2009-02-012-0/+106
| | | | | | | | | | | 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 build warningsGeoff Levand2009-02-011-4/+9
| | | | | | | | | | | | | | | | | | | | | | 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>
* Use enum type in pb_protocol_create_messageGeoff Levand2009-02-012-2/+2
| | | | | | | | To better illustrate the usage of pb_protocol_create_message(), change the type of the arg action from int to enum pb_protocol_action. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Use a list for device->boot_optionsJeremy Kerr2009-01-022-22/+38
| | | | | | Makes adding and removing options easier for parsers. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Use talloc for device handler destructionJeremy Kerr2008-12-161-7/+0
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add device handler cleanupJeremy Kerr2008-12-161-0/+7
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Initial support for multiple UIsJeremy Kerr2008-12-156-0/+1694
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>
OpenPOWER on IntegriCloud