summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* po: Update translationsv1.6.0Samuel Mendoza-Jonas2017-08-2912-914/+3128
| | | | | | | General translation update, adds several new translation source files including parsers and the plugin and statuslog screens. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Don't modify config when clearing IPMI overrideSamuel Mendoza-Jonas2017-08-241-9/+26
| | | | | | | | | | | | | | | | When safe mode is active the config displayed in nc-config is only a subset of the actual config since device init has not yet occurred. However when the "clear override" checkbox is ticked and the config saved, the form will set the config as it is displayed, resulting in device-specific config (eg. boot order and network settings) being cleared. If the user only ticked the "clear override" checkbox this most likely isn't what they intended. Instead change the checkbox to a button which when pressed clears the override and exits safe mode if active, without modifying the rest of the configuration. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/device-handler: Disable safe mode warning on reinitSamuel Mendoza-Jonas2017-08-231-0/+10
| | | | | | | | | | | If a user pressed "Rescan Devices" in safe mode the reinit would complete successfully, but the big warning that safe mode is active would remain. On reinit clear the safe_mode flag properly. This has no functional change aside from clearing the UI warning - the IPMI override remains active until cleared or a successful boot occurs. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* lib/flash: Update type of size fieldSamuel Mendoza-Jonas2017-08-231-2/+2
| | | | | | | | Skiboot commit c043065 "flash: Make size 64 bit safe" updated the prototype of blocklevel_get_info() to use a uint64_t for the size parameter. Update our usage to reflect this. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover: Update env vars at init and suppress LVM warningsSamuel Mendoza-Jonas2017-08-222-15/+20
| | | | | | | | | | | Environment variables are not platform-specific so move set_proxy_variables to device-handler and call it at handler init. At the same time set LVM_SUPPRESS_FD_WARNINGS to ignore the "file descriptor leaked" warnings when calling LVM-utilities, since we must keep some file descriptors open in lib/process. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/ipmi: Open devnode with O_CLOEXECSamuel Mendoza-Jonas2017-08-221-1/+1
| | | | | | | The IPMI device node is kept open for the life of the platform - include the O_CLOEXEC flag so it is not kept open for child processes. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/device-handler: Be ready for user events earlierSamuel Mendoza-Jonas2017-08-151-4/+4
| | | | | | | | Actions performed in network and udev init may result in pb-event callbacks (such as from udhcpc or pb-plugin), so make sure the user event interface is set up beforehand. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Add plugin menu and nc-plugin screenSamuel Mendoza-Jonas2017-08-1512-46/+941
| | | | | | | | | | | | Add a second pmenu accessible via the main menu which displays uninstalled and installed pb-plugins. Uninstalled options can be selected to trigger pb-plugin to install them, after which they are updated and marked as installed in the menu. Installed plugins can be investigated by entering the new plugin screen, where plugin metadata and executables are displayed. Executables can be run from this screen via cui_run_cmd(). Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Update cui_run_cmd() to pass display to commandSamuel Mendoza-Jonas2017-08-152-5/+26
| | | | | | | | | Update cui_run_cmd() to setup a process that uses 'raw_stdout' so that output is displayed on the screen instead of being caught in the log. Also update cui_run_cmd() to take a more generic list of arguments, and add a cui_run_cmd_from_item() wrapper for the existing user. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover: Handle plugin install requestSamuel Mendoza-Jonas2017-08-154-0/+65
| | | | | | | | | Handle "_PLUGIN_INSTALL" requests from clients. Calling the pb-plugin script from pb-discover ensures different clients don't trip over each other. Successfully installed plugins are automatically communicated back to clients once pb-plugin sends a 'plugin' user event. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/device-handler: Scan devices for pluginsSamuel Mendoza-Jonas2017-08-151-0/+18
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* Add pb-plugin and pb-exec to pb_system_appsSamuel Mendoza-Jonas2017-08-154-1/+7
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* utils/pb-plugin: Advertise pb-plugins to discover serverSamuel Mendoza-Jonas2017-08-151-14/+40
| | | | | | | | | | | | Update the pb-plugin utility to create a 'plugin' pb-event when it successfully scans or installs a pb-plugin. To aid invoking pb-plugin from pb-discover there following two commands are updated: - `pb-plugin scan` can now be called for a single directory. - `pb-plugin install` now has an optional "auto" argument that will skip asking for confirmation before installation. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* utils: Add pb-exec wrapperSamuel Mendoza-Jonas2017-08-151-0/+16
| | | | | | | | Add a small wrapper script for the Petitboot UI to call interactable programs with. The wrapper calls the program and waits for user input before returning to the Petitboot UI. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* lib/process: Add raw stdout modeSamuel Mendoza-Jonas2017-08-152-2/+6
| | | | | | | Allow process users to set 'raw_stdout', which if set skips redirecting and saving output from processes. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover: Add 'plugin' user-eventSamuel Mendoza-Jonas2017-08-153-0/+113
| | | | | | | | | | | Add a new user event to advertise pb-plugins and add them to the device_handler. Plugins described by this event can either be uninstalled pb-plugin files or successfully installed pb-plugins depending on the associated parameters. The is primarily intended for use by the pb-plugin utility itself to notify Petitboot as it operates on pb-plugin files. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover: Handle and track plugin_optionsSamuel Mendoza-Jonas2017-08-157-1/+154
| | | | | | | | | | Track plugin_options in the device_handler. Plugins can be added with device_handler_add_plugin_option() and accessed via device_handler_get_plugin(). Extend discover_server to support the new 'add' and 'remove' pb-protocol actions and advertise new plugins to connecting clients. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/pxe-parser: Recognise plugin sourcesSamuel Mendoza-Jonas2017-08-153-5/+32
| | | | | | | | | | | | | Extend the pxe-parser to recognise 'PLUGIN' as well as the usual 'LABEL' when parsing a config file. 'PLUGIN' will be used to specify an option that provides the location of an installable pb-plugin file, named by the 'TARBALL' label. Since plugin options are discovered via the same mechanism as boot options treat them the same as boot options and at the 'type' field to the boot_option struct to differentiate between them. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* lib: Add plugin_option type and protocolSamuel Mendoza-Jonas2017-08-153-0/+127
| | | | | | | | | | Add a new struct 'plugin_option' to represent pb-plugins that are installed on the system. This consists of plugin metadata and an array of installed executables. This also adds two new pb-protocol actions to advertise the addition of a new plugin_option, and to remove known plugin_options. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Create pad for nc-add-url screenSamuel Mendoza-Jonas2017-08-101-2/+52
| | | | | | | | Bring setup for the add-url screen into line with other screens. This fixes an issue with a proper redraw not occurring on help screen init or screen exit, and facilitates other work on simplifying screen init. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Increase height of boot-editor padv1.5.1Samuel Mendoza-Jonas2017-07-261-1/+1
| | | | | | | | Similarly to nc-subset, extend the maximum height of the boot-editor pad to account for the fields of the device select potentially wrapping due to long device names. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/device-handler: Mention booting device in timeout statusSamuel Mendoza-Jonas2017-07-131-1/+2
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* pb-sos: effectively compress the pb-sos file with gzipv1.5.0Guilherme G. Piccoli2017-07-121-3/+7
| | | | | | | | | | | | | | Currently the pb-sos tool creates a TAR file with logs, but without compressing it using gzip, for example. Even the output of command says "Compressing...", but in fact no compression is done. This patch uses gzip to effectively compress the logs. It achieves 83% of compression, observed after a simple experiment. Also, makes use of $tarflags variable instead of pass the flags directly in the command call. Signed-off-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* pb-sos: capture Skiboot logGuilherme G. Piccoli2017-07-121-0/+4
| | | | | | | | | Makes sense to capture Skiboot log in pb-sos, specially since it might help clarify about HW problems, like PCI initialization failures. Signed-off-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover: Wait for net interfaces to be marked readySamuel Mendoza-Jonas2017-07-114-6/+169
| | | | | | | | | | | | | | | | | | | | | | | If pb-discover is started before udev has settled there is a race between Petitboot configuring interfaces and udev renaming them. If an interface is set "up" the name change will fail and interfaces can be inconsistently named, eg: Device: (*) eth0 [0c:c4:7a:f4:1c:50, link up] ( ) enP1p9s0f1 [0c:c4:7a:f4:1c:51, link down] ( ) enP1p9s0f2 [0c:c4:7a:f4:1c:52, link down] ( ) enP1p9s0f3 [0c:c4:7a:f4:1c:53, link down] Add "net" devices to the udev filter and wait for them to be announced by udev before configuring them. udev_enumerate_add_match_is_initialized() ensures that by the time an interface appears via udev its name will be consistent. This also swaps the network and udev init order, but since interfaces now will not be configured until after udev is ready this should not have a user-visible effect. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/udev: Handle LVM logical volumesSamuel Mendoza-Jonas2017-07-111-5/+49
| | | | | | | | | | | If logical volumes are active and recognised by udev, no longer ignore them. We also do some extra handling to use user-friendly device names and mount the /dev/mapper/foo device rather than the /dev/dm-xx device. Additionally if we see "LMV2_member" devices start a rescan in case LVM-formatted disks came up after the LVM initscript. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* lib/system: Add vgscan, vgchange utilitiesSamuel Mendoza-Jonas2017-07-113-0/+6
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/devmapper: Add prefix to devmapper device namesSamuel Mendoza-Jonas2017-07-111-6/+9
| | | | | | | | | Add a 'pb-' prefix to all device mapper devices created by Petitboot. Beyond helping to identify Petitboot-related devices, this avoids naming collisions if we create snapshots of LVM logical volumes which also exist in /dev/mapper. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Extend nc-subset pad heightSamuel Mendoza-Jonas2017-07-111-2/+5
| | | | | | | | The nc-subset screen can exceed its maximum height if some options are long enough to wrap around to two lines. Increaes the maximum size of the pad to account for every line potentially wrapping once. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/device-handler: Allow process_url request to be pendingSamuel Mendoza-Jonas2017-07-112-34/+76
| | | | | | | device_handler_process_url() fails immediately if no network is available. For individual files queue the load task for later instead. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/paths: Add network jobs to queueSamuel Mendoza-Jonas2017-07-115-0/+118
| | | | | | | | | Load tasks that start before the network is available will fail. Rather than just fail these tasks, add them to a queue that is processed once the network is ready. This helps users who try to request files early in setup, as well as very early running load tasks. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/sysinfo: Add network availability helperSamuel Mendoza-Jonas2017-07-112-0/+10
| | | | | | | Add a helper function that describes interfaces as available if they have an assigned address. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/sysinfo: Add system_info_reinit()Samuel Mendoza-Jonas2017-07-113-0/+21
| | | | | | | | Currently over reinit events the system info is not affected. However network and block device information can change over reinit, so clear this information. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* configure.ac: correct name of device-mapper-devel for RHELv1.4.3Daniel Black2017-06-201-1/+1
| | | | | | | The RHEL and Fedora package name for development device mapper library is device-mapper-devel Signed-off-by: Daniel Black <daniel.black@au.ibm.com> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/platform-powerpc: Handle optional Get Device ID sectionSamuel Mendoza-Jonas2017-06-201-8/+18
| | | | | | | | | | The 'auxiliary' section of the 'Get Device ID' response is optional, and some platforms exclude it from the response entirely. However Petitboot only recognises the response as valid if it includes the full 16 bytes. Update get_ipmi_bmc_versions() to also handle responses of only 12 bytes. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/platform-powerpc: Correct aux revision formatSamuel Mendoza-Jonas2017-06-201-7/+8
| | | | | | | | The Auxiliary Firmware Revision Information should be displayed as four hexadecimal bytes if a manufacturer-specific format is not known. Update the "Firmware version" format to reflect this. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/device-handler: Include makedev() from sysmacros.hSamuel Mendoza-Jonas2017-06-201-0/+1
| | | | | | | | | | | | | | | | Include sys/sysmacros.h explicitly in response to the following error message: ../discover/device-handler.c:1001:13: warning: In the GNU C Library, "makedev" is defined by <sys/sysmacros.h>. For historical compatibility, it is currently defined by <sys/types.h> as well, but we plan to remove this soon. To use "makedev", include <sys/sysmacros.h> directly. If you did not intend to use a system-defined macro "makedev", you should undefine it after including <sys/types.h>. id = makedev(1, handler->n_ramdisks); ^~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/platform-powerpc: Don't fail early if nvram failsSamuel Mendoza-Jonas2017-04-271-1/+1
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* util/hooks: Don't update DT when ttyS* console activev1.4.2Samuel Mendoza-Jonas2017-03-171-1/+4
| | | | | | | Update 30-dtb-updates to not accidentally treat ttyS* consoles as tty* and update linux,stdout-path with the VGA console details. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* utils/hooks: Don't fail early if fb0 missingSamuel Mendoza-Jonas2017-03-161-16/+31
| | | | | | | 30-dtb-updates would exit early if the 'fb0' file was missing, however the set_stdout() step does not depend on this. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover: Track both configured and current autoboot settingsSamuel Mendoza-Jonas2017-03-154-15/+16
| | | | | | | | | | | | | | | If autoboot is enabled but later disabled or cancelled by, for example, an IPMI override then the nc-config screen will set the autoboot widget as disabled. If the user then makes and saves a change in nc-config, autoboot will also be saved as disabled. This accidental change is particularly awkward if the user is attempting to remove an IPMI override. Instead only ever change the autoboot setting if the user explicitly changes it. Use a new helper function 'config_autoboot_active()' to determine the current autoboot status where needed. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Fix adding unnecessary leading slashes to pathsSamuel Mendoza-Jonas2017-03-151-1/+2
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/sysinfo: Fix useless error messageSamuel Mendoza-Jonas2017-01-311-1/+3
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* process: Cancel all asynchronous jobs on reinitv1.4.1Samuel Mendoza-Jonas2017-01-313-0/+26
| | | | | | | | | | | If an asynchronous job is running over a reinit, the process can return and run its callback function after the reinit. This becomes a problem if the callback function accesses pointers that were only valid before the reinit (eg. device structs). If a reinit is requested explicitly stop all active asynchronous jobs and clear their callback functions before the reinit. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/device-handler: Cancel pending boot on reinitSamuel Mendoza-Jonas2017-01-311-0/+6
| | | | | | | | | | When a reinit is requested device_handler_cancel_default() is called, however as the name suggests this only cancels the boot task if it is the result of a default boot option. We also want to cancel a boot task if it was executed manually because it may have outstanding asynchronous transfers running, so explicitly cancel it during reinit. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/device-handler: Process queue after device addedSamuel Mendoza-Jonas2017-01-311-2/+1
| | | | | | | | | | | | In device_handler_discover() we process the unresolved boot options queue first. However the discover_device in question has not yet been added to handler->devices so when a parser tries to search for a matching device it will fail. The discover_device will be added to the handler if it has not already in device_handler_discover_context_commit() so move the call to process_boot_option_queue() after it. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/network: Ignore interfaces with pre-existing MAC addressSamuel Mendoza-Jonas2017-01-311-1/+11
| | | | | | | | | | | | Petitboot uses the MAC address of network interfaces as a unique identifier. This can cause a crash in pb-discover on a machine that has multiple interfaces with the same MAC address. While duplicate MAC addresses are rare and imply an issue with the larger system configuration Petitboot should handle this gracefully, so log a warning and ignore any interfaces other than the first to appear that share a MAC address. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/network: Ensure interfaces have device before configuringSamuel Mendoza-Jonas2017-01-121-3/+6
| | | | | | | | | | Reorganise network_handle_nlmsg() slightly to create interface->dev just before calling configure_interface() rather than only for brand new interfaces. This ensures existing interfaces which have had ->dev removed but receive a new configure event do not access a NULL pointer during the configuration process. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/network: Search by UUID only if availableSamuel Mendoza-Jonas2017-01-121-1/+4
| | | | | | | | | When registering a new discover device it is possible the device does not have an associated UUID, for example when created via device_handler_process_url(). Fall back to find_interface_by_name() in this case. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Display IP address in nc-sysinfov1.4.0Samuel Mendoza-Jonas2016-12-201-2/+3
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
OpenPOWER on IntegriCloud