summaryrefslogtreecommitdiffstats
path: root/ui/ncurses
Commit message (Collapse)AuthorAgeFilesLines
* ui/ncurses: Use OK & Cancel buttons for boot editor completionJeremy Kerr2013-10-112-6/+47
| | | | | | | Rather than using enter to complete a boot_editor session, add OK and Cancel buttons. Enter will move between fields. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Use 'x' as exit keyJeremy Kerr2013-10-114-5/+6
| | | | | | | | | | | Because terminals will send escape-sequences starting with escape, ncurses will pause after receiving a signle escape, to detect these sequences. This introduces a 1-second delay when exiting the petitboot UI. Instead, use 'x'. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Allow booting custom boot optionsJeremy Kerr2013-10-101-4/+0
| | | | | | | Currently, we can't boot user-created boot options, as they have no option ID associated. This change removes the check for option ID. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Defer item creation until boot editor is doneJeremy Kerr2013-10-108-93/+88
| | | | | | | | | | | | Currently, when creating new menu entries, we create an empty item, add it to the menu, then run the boot editor. This means that cancelling the edit will leave an empty item in the menu. This change defers the creation until the boot editor is done. To do this, we modify the on_open callback to take a menu rather than an item, and pass NULL boot data to the editor. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Use 'New' instead of 'Open'Jeremy Kerr2013-10-102-3/+2
| | | | | | "Open" is ambiguous in the context of the boot menu; use "new" instead. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Display sysinfo type & identifierJeremy Kerr2013-10-096-5/+46
| | | | | | | Hook into the sysinfo updates to display the type & id at the top of the petitboot main menu. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/log: Cleanup log APIJeremy Kerr2013-09-191-9/+5
| | | | | | | | | | 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>
* ui/ncurses: Allow both DEL and ^H to map to backspaceJeremy Kerr2013-09-061-0/+8
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/process: Add dry_run argument to process_initJeremy Kerr2013-08-202-2/+3
| | | | | | | 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>
* lib/process: replace pb_run_cmdJeremy Kerr2013-08-191-3/+3
| | | | | | | This change replaces the pb_run_cmd() function with proper usage of the process API. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/process: replace pb_run_cmd_pipeJeremy Kerr2013-08-191-0/+3
| | | | | | Replace pb_run_cmd_pipe with process_create / process_run_sync. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/waiter: handle -EINTRJeremy Kerr2013-08-191-1/+1
| | | | | | | Now that we're handing non-fatal signals (i.e., SIGCHLD in the process lib), we need to gracefully handle -EINTR from poll(). Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* configure: Update to use AX_WITH_CURSESGeoff Levand2013-07-2310-12/+47
| | | | | | | | | | | For a more portable build system convert to using the autoconf-archive AX_WITH_CURSES macros. Allows building on openSUSE, which has a different header file layout than other distros, and fixes menu entries with UTF-8 characters; this causes fedora installs (codename "Schrödinger´s cat") to break the UI. Signed-off-by: Geoff Levand <geoff@infradead.org>
* ui/ncurses: Add setlocale callJeremy Kerr2013-07-231-0/+3
| | | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
* ui/ncurses: Remove unused 'cod' variableJeremy Kerr2013-06-241-2/+1
| | | | | | | | | | | | When configured with --disable-debug, we get an unused variable warning: ui/ncurses/nc-cui.c: In function 'cui_device_remove': ui/ncurses/nc-cui.c:439:24: error: unused variable 'cod' cc1: all warnings being treated as errors This change just removes the temporary variable. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add initial dtb supportGeoff Levand2013-06-242-6/+14
| | | | | | | Updates & fixes by Jeremy Kerr <jk@ozlabs.org>. Signed-off-by: Geoff Levand <geoff@infradead.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add cancel-default reportingJeremy Kerr2013-06-244-78/+6
| | | | | | | | | When we first see key input, we can tell the discover server to cancel the default boot. Untested on ps3. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui: implement timers with waitsetsJeremy Kerr2013-06-242-6/+0
| | | | | | | A temporary change to the timers; we'll eventually remove these from the ui code. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/waiter: Add timeout waitersJeremy Kerr2013-06-241-2/+2
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: implement global keysJeremy Kerr2013-05-211-0/+16
| | | | | | | Add process_global_keys to handle global key events. Using this, implement ctrl+l to refresh. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: move getch() out of process_key callbacksJeremy Kerr2013-05-215-127/+116
| | | | | | | | All process_key callbacks will want to query the key that was pressed, so do the getch() once in cui_process_key, and pass the result to the callback. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/nc: Don't segfault if we can't open log_fileJeremy Kerr2013-05-091-0/+3
| | | | | | Fallback to logging to /dev/null. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/nc: Handle cui_opt_data with no boot option more gracefullyJeremy Kerr2013-05-091-0/+5
| | | | | | | | | | We can currently segfault petitboot by escaping from the option editor (before entering any details), then trying to boot the new, empty option. This change adds some sanity checks to prevent a segfault. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Simplify menu item namesJeremy Kerr2013-05-091-35/+2
| | | | | | Just use the item name, rather than including boot option details. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Makefiles: remove -I$(includedir)Jeremy Kerr2013-05-071-1/+0
| | | | | | | | | | | Currently, we include the system include dir in some of our makefiles; this is causing build problems when cross-compiling, as the system include dir may not contain files for the host. The compiler should be searing in the proper system include dir, so just remove the redundant -I. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* cui: Show incoming status messagesJeremy Kerr2013-05-061-5/+13
| | | | | | | Add a callback to handle and display boot status messages from the discover server. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* protocol: Separate device add from boot-option add messagesJeremy Kerr2013-04-161-51/+39
| | | | | | | | | | | | | | | | | | | | 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>
* ncurses: Fix build warningGeoff Levand2013-04-151-0/+1
| | | | | | | | Add missing header include. Fixes this warning: ui/ncurses/nc-cui.c: warning: implicit declaration of function 'pb_protocol_device_cmp' Signed-off-by: Geoff Levand <geoff@infradead.org>
* Move --dry-run option to discover serverJeremy Kerr2013-04-153-13/+5
| | | | | | | 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>
* Move boot to discover serverJeremy Kerr2013-04-153-36/+5
| | | | | | | | | | | | | | | | | | | | | 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>
* ui/ncurses: Add discover client to struct cuiJeremy Kerr2013-04-152-5/+5
| | | | | | .. we'll need it later. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover-client: interact directly with waitsetJeremy Kerr2013-04-151-15/+2
| | | | | | | | | | | | | | Currently, clients need to mess with the discover client fd directly, and manually register the waiter. Instead, this change adds a waitset parameter to discover_client_register, so that the discover client can register itself, and call discover_client_process directly. This means no proxy handlers, and no casts to waiter callbacks. We can also get rid of discover_client_get_fd. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui: callback & boot actions: kexec -> bootJeremy Kerr2013-04-154-19/+19
| | | | | | | | | find ui/ -type f | xargs sed -i -e s/kexec_cb/boot_cb/g \ -e s/on_kexec/on_boot/g \ -e s/run_kexec/boot/g Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui: pb_kexec_data -> pb_boot_dataJeremy Kerr2013-04-156-58/+58
| | | | | | | | find ui/ -type f | xargs sed -i -e s/pb_kexec_data/pb_boot_data/g \ -e 's/\<kd\>/bd/g' Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: ked -> boot-editorJeremy Kerr2013-04-157-386/+408
| | | | | | | | | | git mv ui/ncurses/nc-ked.c ui/ncurses/nc-boot-editor.c git mv ui/ncurses/nc-ked.h ui/ncurses/nc-boot-editor.h find ui/ncurses -type f | xargs sed -i -e s/nc-ked\./nc-boot-editor./g \ -e s/ked/boot_editor/g Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* waiter: Don't rely on global variables to keep waiter stateJeremy Kerr2013-04-102-6/+9
| | | | | | | | | 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-102-2/+2
| | | | | | | | | | | | 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>
* ui/ncurses: Fix warning from unnecessary if statementJeremy Kerr2013-03-051-1/+1
| | | | | | | | ui/ncurses/nc-menu.c: In function 'pmenu_process_key': ui/ncurses/nc-menu.c:207:33: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
* nc: Only expand debug macros if DEBUG is definedJeremy Kerr2013-03-051-0/+6
| | | | | | | To reduce debugging output from the UI Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
* Speed up --start-daemon optionGeoff Levand2012-03-301-4/+4
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Cleanup --dry-run option codeGeoff Levand2012-03-304-14/+19
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Add UI option --dry-runGeoff Levand2012-03-271-14/+19
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Log to stderr, allow --log=-Geoff Levand2012-03-262-8/+14
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Add --start-daemon option to ui programsGeoff Levand2012-03-083-10/+35
| | | | | | | | 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>
* Log file cleanupsGeoff Levand2012-03-082-5/+5
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Rename pb-nc, pb-twin to petitboot-nc, petitboot-twinGeoff Levand2012-03-081-7/+7
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Move installed programs from bin to sbinGeoff Levand2012-02-241-2/+2
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Rename pb-nc-generic to pb-ncGeoff Levand2012-02-151-3/+3
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Remove unused file pb-cui.cGeoff Levand2012-02-151-289/+0
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Rename ps3-cui.c to ps3-main.cGeoff Levand2012-02-121-0/+0
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
OpenPOWER on IntegriCloud