summaryrefslogtreecommitdiffstats
path: root/ui
Commit message (Collapse)AuthorAgeFilesLines
...
* ui/ncurses: Receive config messagesJeremy Kerr2013-11-132-0/+8
| | | | | | We just store the config in the cui for now. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Use nc-widgets for boot editorJeremy Kerr2013-11-132-240/+75
| | | | | | | Now that we have a simple widget set available, use this for the boot editor. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add simple ncurses form widget setJeremy Kerr2013-11-133-1/+804
| | | | | | | | | We're doing a lot of the same stuff with forms, and we'll to implement a lot of fields with the upcoming configuration interface. This change introduces a simple ncurses widget set. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add sysinfo screenJeremy Kerr2013-11-138-8/+332
| | | | | | | | Add a simple screen for displaying the struct system_info. We add this to the main menu as a selectable option, and separate it from the boot option list with an unselectable blank entry. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses/scr: Add definition for frame offsetJeremy Kerr2013-11-132-1/+2
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: nc-menu.h needs assert.hJeremy Kerr2013-11-131-0/+2
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/common: Don't talloc_free sysinfo and status explicitlyJeremy Kerr2013-11-132-8/+21
| | | | | | | | | | | | | Currently, we talloc_free() the sysinfo and status messages in the discover client, right after performing the ui's callback. However, the client may wish to keep a reference to this information beyond the callback invocation. This change introduces a per-message talloc context, which these structures are allocated under. This allows the callbacks to talloc_steal() anything they wish to keep a reference to. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add nc_scr_{un,}post()Jeremy Kerr2013-11-134-11/+29
| | | | | | | We may have nc_scrs that aren't interested in post/unpost information, so create helper functions that allow a NULL callback. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Move general nc init code to cui moduleJeremy Kerr2013-11-133-35/+32
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* config: Implement config messagesJeremy Kerr2013-11-132-0/+19
| | | | | | On client connect, send a PB_PROTOCOL_ACTION_CONFIG message. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* logging: Clean up debug logsJeremy Kerr2013-11-0110-40/+27
| | | | | | | We have quite a few pb_logs which should be pb_debug. This change moves developer-specific info to pb_debug. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* 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-102-6/+1
| | | | | | | 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>
* Add system info messagesJeremy Kerr2013-10-093-0/+50
| | | | | | | | 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>
* lib/log: Cleanup log APIJeremy Kerr2013-09-192-18/+11
| | | | | | | | | | 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>
* discover: populate udev device typesJeremy Kerr2013-09-181-0/+16
| | | | | | Now that we have device types, populate from the udev info. 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-203-3/+4
| | | | | | | 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-194-15/+21
| | | | | | | 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-192-0/+6
| | | | | | 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-192-2/+2
| | | | | | | 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-246-6/+19
| | | | | | | 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/common: Add code to send cancel-default messagesJeremy Kerr2013-06-242-0/+17
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui: implement timers with waitsetsJeremy Kerr2013-06-245-91/+21
| | | | | | | 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-243-6/+6
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/test: print default status of boot optionsJeremy Kerr2013-06-241-0/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/test: Add boot status messages to test clientJeremy Kerr2013-05-211-0/+12
| | | | 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-074-4/+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>
* ui: Receive boot status messagesJeremy Kerr2013-05-062-0/+20
| | | | | | | | Add support in the discover client code to handle boot status messages, and pass them to the UI thorugh a new callback ("update_status") in the client_ops. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Consolidate user events by device IDJeremy Kerr2013-04-161-0/+18
| | | | | | | | | | Currently, we assume all user events are for a new device. This means that we can never add boot options to an existing device. This change tries to find an existing (matching by ID) device before creating a new one in the user event add path. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* protocol: Separate device add from boot-option add messagesJeremy Kerr2013-04-165-115/+141
| | | | | | | | | | | | | | | | | | | | 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>
* pb-protocol: Don't allocate in deserialise functionsJeremy Kerr2013-04-161-2/+5
| | | | | | | | | | | | | 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>
* 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-158-27/+9
| | | | | | | 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-1511-545/+12
| | | | | | | | | | | | | | | | | | | | | 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>
* lib/url: Move URL-handling code to libJeremy Kerr2013-04-154-284/+2
| | | | | | | 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>
OpenPOWER on IntegriCloud