summaryrefslogtreecommitdiffstats
path: root/ui
Commit message (Collapse)AuthorAgeFilesLines
* ui/ncurses: Make server connect message more clearv1.3.2Samuel Mendoza-Jonas2016-11-241-3/+5
| | | | | | | | | The current message mentions a "server" which can give the misleading impression that the UI is waiting for a remote network server. The delay is actually in waiting for the pb-discover process to be ready, so update the message to reflect that. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* Support HTTP(S) proxies when downloading resourcesSamuel Mendoza-Jonas2016-11-242-1/+32
| | | | | | | | Allow the user to specify a HTTP and HTTPS proxy server. The discover server will set the http_proxy and https_proxy environment variables, enabling the proxy servers for any further HTTP(S) requests. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Spin child to ensure autoboot cancelled on exitSamuel Mendoza-Jonas2016-11-231-0/+43
| | | | | | | | | | If the client is not connected to the server instance when exiting, fork and have the child process spin until the server is available and can be told to cancel autoboot. This prevents the scenario of a user exiting the UI and having the server continue to autoboot while they are using the command line. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* Consolidate petitboot,tty and petitboot,consoleSamuel Mendoza-Jonas2016-09-081-7/+20
| | | | | | | | | | | | | | | | | | | | Commit ce54f86 "Add petitboot,tty and track available consoles" added the petitboot,tty parameter, but the petitboot,console parameter is also recognised by Petitboot. These are ultimately handled by the 30-add-offb and 80-set-stdout hooks respectively, but exist for mostly the same purpose. We consolidate these down to just the original petitboot,console parameter. If the contents of petitboot,console have been configured by Petitboot (ie. it is of the form /dev/dev# [ Description ]) we behave as normal, otherwise we assume that petitboot,console contains a full OF path to the intended console device and do not allow it to be modified. This follows petitboot,console's original intent to be a debug aid, and takes precedence over any other use. The 80-set-stdout hook is removed as 30-add-offb now accounts for both use cases. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* Use 'consoles' instead of 'tty' to refer to interfacesSamuel Mendoza-Jonas2016-09-082-35/+35
| | | | | | | 'Console' is more readily understandable and technically more correct than 'tty' for referring to the interfaces that Petitboot starts a UI on. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Display warning when net override activeSamuel Mendoza-Jonas2016-09-081-9/+27
| | | | | | | | If the current interface config has been set by an IPMI network override, display a warning in nc-config that saving the current config will overwrite any saved interface config. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* Disable shell access when lockdown is activetpearson@raptorengineering.com2016-08-261-1/+21
| | | | | | | | This patch disables direct command line access when the /etc/pb-lockdown file is present. Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* Add support for GPG signature enforcement on bootedtpearson@raptorengineering.com2016-08-264-4/+66
| | | | | | | | | | | | | kernels and related blobs This can be used to implement a form of organization-controlled secure boot, whereby kernels may be loaded from a variety of sources but they will only boot if a valid signature file is found for each component, and only if the signature is listed in the /etc/pb-lockdown file. Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> (Minor build fixes and gpgme.m4, comment on secure boot in gpg.c)
* ui/ncurses: Treat left/right arrow keys properlySamuel Mendoza-Jonas2016-08-231-2/+6
| | | | | | | | | It turns out ncurses helpfully provides REQ_LEFT_FIELD and REQ_RIGHT_FIELD to navigate between visually horizontal fields. Update widgetset_process_key() to use these for KEY_LEFT and KEY_RIGHT respectively. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Call widget process_key handlers firstSamuel Mendoza-Jonas2016-07-211-5/+15
| | | | | | | | | | | | | | | Adding KEY_LEFT and KEY_RIGHT brought to light the problem that widgetset_process_keys() may handle keystrokes that would have also been handled by a widget's process_keys function. In particular the cursor in a textbox widget could no longer be moved with the left/right keys. This updates widgetset_process_keys() to call the focussed widget's process_keys function before handling the key in any other way. All of the widget process_keys functions correctly return false if the key is not relevant to the widget except for textbox_process_key() which is updated to ignore the main navigational keys. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Properly set focus when updating subsetSamuel Mendoza-Jonas2016-07-132-2/+7
| | | | | | | | | | | When a subset widget is made empty focus is switched to the first visible field. It should actually be set to the first visible and active field, otherwise we can try to focus an un-selectable label. While we're here, also properly set the visibility for the autoboot enable/disable widget. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Update keybindings for subsetsSamuel Mendoza-Jonas2016-07-132-21/+8
| | | | | | | | | | We now use KEY_LEFT and KEY_RIGHT for general navigation; update subset_process_key() to use the following keybindings: Reorder items up/down: Minus/Plus keys (-/+) Delete item: Delete or Backspace Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: define KEY_DC (delete key)Samuel Mendoza-Jonas2016-07-121-0/+1
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: List available consoles in nc-configSamuel Mendoza-Jonas2016-06-291-3/+53
| | | | | | | | | Include a list of available consoles as specified by the discover server in nc-config from which the user can select a default. The selected console specifies the which console to be set as the primary console when a kernel is kexec'd. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/common: Set current console on boot commandSamuel Mendoza-Jonas2016-06-291-0/+1
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Remember to abort boot on server connectSamuel Mendoza-Jonas2016-05-261-4/+14
| | | | | | | | | The UI can now come up before the server, but in order for a key press to cancel autoboot a key has to be pressed once the server connects. Instead remember to cancel autoboot if a key has been pressed at any point. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* Extend the "add url" function to allow file:// URLsSamuel Mendoza-Jonas2016-05-241-0/+6
| | | | | | | | | | | | | | This allows URLs of the form file:///path/to/local/file.conf to be used in nc-add-url, in order to access configuration files relative to the root directory. This is primarily a debugging tool aimed at developers rather than an expected use case. The DEVICE_TYPE_ANY enum is used in this case to represent that a resulting boot option is not associated with any device in the traditional sense, and in the UI is represented as a "Custom Local Option". Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Interpret left/right keys as up/downSamuel Mendoza-Jonas2016-05-241-0/+2
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Start UI before connected to serverSamuel Mendoza-Jonas2016-05-063-11/+59
| | | | | | | | | | | | | | | | If petitboot-nc starts before the discover server it will try to connect for a short while waiting for the server to appear. However in some scenarios the server can take longer than expected to come up, for example if the kernel is compiled with modules and the system has many disks, and the process will timeout and exit before the server is ready. The UI does not appear during this time so it can appear as if Petitboot failed to start at all. Change the default behaviour to start the UI first, and then wait for the server to appear. The UI will not timeout in this mode. The "--timeout" option is added to start with the old behaviour. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui: Fix typo: 'deamon' -> 'daemon'Samuel Mendoza-Jonas2016-05-064-10/+10
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* Fix sparse warningsAndrew Donnellan2016-04-203-4/+4
| | | | | | | | Fix some sparse warnings by using NULL instead of 0 and static-ifying a variable not used outside its file. Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Increase timeout when waiting for pb-discoverSamuel Mendoza-Jonas2016-04-201-1/+1
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Disable autoboot if boot list is emptySamuel Mendoza-Jonas2016-04-051-2/+1
| | | | | | | | If an empty boot order is saved disable autoboot. However don't set autoboot_enabled to false by clearing the list, as this will hide the list when it is likely the user wants to make changes. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Define extra key codes encountered in QEMUSamuel Mendoza-Jonas2016-04-051-0/+4
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Re-add autoboot selection to config screenSam Mendoza-Jonas2016-03-231-19/+63
| | | | | | | | | | | | | | The new boot order interface removed the autoboot enable/disable buttons. However this means the only way to disable autoboot is to remove all options from the boot order list, or know that you can manually set the `auto-boot?` flag in nvram. This re-introduces an autoboot enable/disable widget so that autoboot can be disabled without losing an existing boot order. The translated strings for "Autoboot" are salvaged from earlier use, and two new untranslated strings are introduced. Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Check wcstombs() for error in nc-langSam Mendoza-Jonas2016-03-151-2/+9
| | | | | | | | If we are unable to correctly parse wide-character strings for display in the Language screen (eg. due to an incorrect locale) display an error string instead of continuing to try to display the string. Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
* Remove "h=help" hint in language pageJohnny2016-03-021-1/+1
| | | | Signed-off-by: Johnny <johnny.cl.chang@foxconn.com>
* Use 'Primary' instead of 'Current' for flash sidesSam Mendoza-Jonas2016-02-261-4/+4
| | | | | | | | | | | | When queried libflash will return the 'first' flash side (ie. the one with the lowest TOC address), however we label this the 'Current' side which is incorrect if the machine has booted from the alternate side. A future fix will inlcude additional platform logic to determine which flash side is current; in the interim label the first flash side as 'Primary' instead of 'Current'. Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Add missing newline in nc-sysinfoSam Mendoza-Jonas2016-02-101-0/+1
| | | | Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
* Retrieve BMC version info via IPMISam Mendoza-Jonas2016-02-101-0/+16
| | | | | | | | On BMC machines the "Get Device ID" and "Get BMC Golden Side Version" IPMI commands are available. If possible retrieve some interesting version numbers and display them in the System Information screen. Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
* Display VERSION partition info on BMC machinesSamuel Mendoza-Jonas2016-02-091-0/+16
| | | | | | | | | | On supported platforms read the VERSION partition on startup and display the available versions strings in the System Information screen. This adds a skeleton hostboot.c to support possible additional BMC platform support. Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
* ui/common: Only close valid file descriptorSamuel Mendoza-Jonas2016-02-091-2/+2
| | | | | | Fixes Coverity defect #30466 Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
* ui: add URL for static configurations to load a specified fileNishanth Aravamudan2015-12-181-4/+28
| | | | | | | | | | | | In certain configurations, e.g. automation, we want to use static networking but load a particular file, automatically and parse it as a pxelinux config file. Currently, we support something like this for DHCP based booting, but not static. Add a URL field to the UI for static configurations and reuse the logic from device_handler_process_url() to load the specified file. Signed-off-by: Nishanth Aravamudan <nacc@linux.vnet.ibm.com> Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Remove redundant assignmentSamuel Mendoza-Jonas2015-12-181-3/+1
| | | | | | Fixes Coverity defect #30484 Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/common: Free message on returnSamuel Mendoza-Jonas2015-12-181-6/+7
| | | | | | Fixes Coverity defect #30468 Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Check for NULL in pmenu_item_get_index()Samuel Mendoza-Jonas2015-12-171-3/+4
| | | | | | Fixes Coverity defect #30476 Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* Add BMC interface MAC to system info outputJack Miller2015-12-151-1/+7
| | | | | | Useful for identifying the initial BMC traffic on the network. Signed-off-by: Jack Miller <jack@codezen.org>
* Fix certain calls to gettextSamuel Mendoza-Jonas2015-09-151-1/+1
| | | | | | | Properly call gettext for strings in discover/device-handler.c that are user-visible, and fix the help string in ui/ncurses/nc-subset.c Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Improve scrolling behaviourSamuel Mendoza-Jonas2015-09-101-6/+10
| | | | | | | | | | The nc-config screen now includes several select options with a FIELD height greater than one, but config_screen_widget_focus() will only scroll down enough to see the first line of text. Update config_screen_widget_focus() to try and make as much of the focussed widget visible as possible. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Allow text wrapping in select widgetsSamuel Mendoza-Jonas2015-09-102-17/+68
| | | | | | | | | | Several string translations used in select widgets are longer than the maximum possible width of the widget. Rather than associating several FIELDs with a select option, use a fold_text callback to pad out substrings of the original string such that the ncurses O_WRAP option properly wraps strings within the field. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Improve update handling in nested screensSamuel Mendoza-Jonas2015-09-077-17/+71
| | | | | | | | | | | | | | | | Several screens in petitboot-nc require an update if a config or sysinfo update is received. However if those screens exist but are not the current screen they will incorrectly try to draw to the screen. Where the currently active screen is a textscreen (eg. a help screen) the update is delayed until after the screen is exited. In the particular case of nc-config where the current screen can be an nc-subset screen, the nc-subset screen is exited immediately so the update can be performed, since the nc-subset screen depends on the information in the previous screen. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Change arrangement of boot order buttonsSamuel Mendoza-Jonas2015-09-071-6/+11
| | | | | | | | | | | The buttons 'Add Device', 'Clear', and 'Clear & Boot Any' are short enough to be positioned horizontally, but several localisations have strings as long as all three buttons combined. Instead arrange the buttons vertically and allow longer strings to resize the width of the button to fit the whole string. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Resize & adjust OK/Help/Cancel buttonsSamuel Mendoza-Jonas2015-09-074-12/+15
| | | | | | | | The localisation of 'OK' is cut short in a few languages by a character or two - adjust the buttons in each affected screen slightly to accommodate. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* Consolidate display string for optical devicesSamuel Mendoza-Jonas2015-08-311-2/+0
| | | | | | | Instead of using 'Optical' in some places and 'CD/DVD' in others, simply use 'CD/DVD' for all cases. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* Recognise storage devices on USB busSamuel Mendoza-Jonas2015-08-313-3/+7
| | | | | | | | Users may want to prioritise USB-attached storage devices differently to other devices. Detect if a device is USB-attached and add a new device type to identify it. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Fix positioning of i18n strings in button labelsSamuel Mendoza-Jonas2015-08-311-12/+26
| | | | | | | | | | | | Since the visual length of localised strings is not necessarily equal to the number of chars in the array, button labels could 'finish' early. For example: '[確定] ' and '[ 說明 ] ' vs the correct '[ 確定 ]' and '[ 說明 ]' Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* lib/i18n: Move strncols to i18n.cSamuel Mendoza-Jonas2015-08-311-31/+0
| | | | | | Make the strncols() helper available generally to i18n-concerned code. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Update nc-config help text for Disk R/WSamuel Mendoza-Jonas2015-08-251-1/+5
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* Make read-only guarantee user-settableSamuel Mendoza-Jonas2015-08-061-1/+27
| | | | | | | | Create a new Petitboot option 'petitboot,write?' that specifies whether the system is allowed to mount devices read-write. The option can be toggled by the user in the nc-config screen. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Layout tweaks for boot order interfaceJeremy Kerr2015-06-262-16/+16
| | | | | | | | | | | | | | | | | | | | This change implements a few minor tweaks for the bootorder layout interface: - make the verical spacing of widgets more consistent (we have a couple of 3-line gaps) - use a consistent 2-space gap between buttons on the same line - clarify the title text for the subset widget instance, and move the select widget closer to the title - use consistent title-case for widget labels - left-align the select & button widgets on the subset screen, for consistency with other screens Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud