summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* discover: Release process resources on errorSamuel Mendoza-Jonas2016-02-091-2/+4
| | | | | | Fixes Coverity defect #30472 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>
* discover: Handle BTRFS root subvolumesSam Mendoza-Jonas2016-02-093-1/+27
| | | | | | | | | | | | | | | | | | During install some distributions[0] will create subvolumes when formatting the root filesystem with BTRFS. In particular this can mean that bootloader config files will appear (in the case of GRUB) under /var/petitboot/mnt/dev/$device/@/boot/grub/ rather than the expected /var/petitboot/mnt/dev/$device/boot/grub/ If this is the case, perform all file operations from the parser relative to this subvolume rather than the mount point. At the moment this only supports the trivial case where the subvolume name for root is blank (ie. '@'). [0] In particular, Ubuntu from at least 14.04 Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
* discover/grub2: Fix behavior of save_env -fAlan Dunn2016-02-083-3/+52
| | | | | | | | | | | | | | | Currently, "save_env -f" in the GRUB2 parser only works with three arguments, which means only commands of the form "save_env -f <path>" that save *no* environment variables are allowed. Allow "save_env -f <path> [<var>]*", making "save_env -f" useful. Tested: Unit test test-grub2-save-env-dash-f tests this change, and the remaining unit tests still pass. Signed-off-by: Alan Dunn <amdunn@google.com> Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
* lib/pb-protocol: Fix NULL dereference on non-powerpcSamuel Mendoza-Jonas2015-12-211-1/+4
| | | | | | | | If not running on a powerpc platform the bmc_mac pointer remains NULL. If this is the case set an address of zero when serialising rather than dereferencing the pointer. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* discover: extend URL in UI to support auto-discoveryNishanth Aravamudan2015-12-185-11/+29
| | | | | | | | | | | | | The URL field currently only supports loading a particular file for static network configurations. But it makes sense in certain static network configurations to 'auto-discover' a file like petitboot does with DHCP -- based off the MAC address and IP. Extend device_handler_process_url to take those as parameters, and toggle off the URL ending in a '/' to indicate whether to 'auto-discover' or directly load the specified URL. Signed-off-by: Nishanth Aravamudan <nacc@linux.vnet.ibm.com> Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui: add URL for static configurations to load a specified fileNishanth Aravamudan2015-12-186-9/+56
| | | | | | | | | | | | 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>
* Merge pull request #11 from open-power/coveritySam Mendoza-Jonas2015-12-1812-36/+40
|\ | | | | Coverity fixes
| * 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>
| * discover: Set umask before mkstemp()Samuel Mendoza-Jonas2015-12-181-0/+5
| | | | | | | | | | | | Fixes Coverity defect #30479 Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
| * discover: Null-terminate buffer in user_event_process()Samuel Mendoza-Jonas2015-12-181-2/+4
| | | | | | | | | | | | Fixes Coverity defect #30480 Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
| * discover: Add two missing talloc_free()sSamuel Mendoza-Jonas2015-12-182-0/+2
| | | | | | | | | | | | Fixes Coverity defects #30474 and #30475 Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
| * discover: Skip malformed bootdev fieldsSamuel Mendoza-Jonas2015-12-181-5/+2
| | | | | | | | | | | | Fixes Coverity defect #30471 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>
| * lib/talloc: Add missing va_end() callsSamuel Mendoza-Jonas2015-12-181-0/+2
| | | | | | | | | | | | Fixes Coverity defects #30485 and #30486 Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
| * discover: Fix dead code in udev_handle_cdrom_events()Samuel Mendoza-Jonas2015-12-181-3/+1
| | | | | | | | | | | | | | | | | | The check against ddev->mounted to cause an eject action is logically impossible. Change it so a cdrom_eject() is called properly. Change the return value to 'true' for any action caused by DISK_EJECT_REQUEST - no further action is appropriate in this case 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>
| * discover: Use snprintf() when building sysparam pathSamuel Mendoza-Jonas2015-12-171-6/+4
| | | | | | | | | | | | Fixes Coverity defects #30481 and #30482 Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
| * discover: Properly handle return valuesSamuel Mendoza-Jonas2015-12-174-8/+8
|/ | | | | | | | Fixes three unchecked return values, and one missing initialisation. Fixes Coverity defects #30450, #30451, #30454, and #30483 Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* Merge pull request #10 from themoken/masterSam Mendoza-Jonas2015-12-175-3/+56
|\ | | | | Add BMC interface MAC to system info output
| * Add BMC interface MAC to system info outputJack Miller2015-12-155-3/+56
|/ | | | | | Useful for identifying the initial BMC traffic on the network. Signed-off-by: Jack Miller <jack@codezen.org>
* po: Translation updatesSamuel Mendoza-Jonas2015-11-1111-46/+43
| | | | | | | | | - Abbreviate several translations of "Disk R/W". - Do not expand 'DHCP' in pt_BR. - Remove several extra space characters in French translations. - Shorten some translations of "Boot Order", "DNS Servers". Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* po: Translation UpdatesSamuel Mendoza-Jonas2015-11-023-19/+21
| | | | | | Abbreviation and help text updates. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* discover/ipmi: Increase IPMI timeout to a reasonable valueJeremy Kerr2015-09-301-1/+1
| | | | | | | | | | | | | | | | | We've seen some IPMI timeouts during testing - meaning that an IPMI bootdev setting will be ignored. This can result in a machine booting from an incorrect boot device, or missing a 'safe mode' indication, or incorrectly proceeding past petitboot. The firmware & kernel has its own timeout & retry mechanism, so we already have a little error-recovery there; the timeout in petitboot is to prevent an indefinite block if the kernel interface isn't behaving correctly. So, this change bumps the timeout to a value that suits BMCs we've seen in the field (specifying a 2 second timeout, with one retry). Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/ipmi: Use advisory locking on ipmi deviceJeremy Kerr2015-09-301-4/+22
| | | | | | | | | | | | The ipmi module is shared between pb-config and pb-discover. During system initilisation, we're likely to have a few invocations of pb-config running, as well as pb-discover starting. We may have multiple potential concurrent accesses to the ipmi device node. To avoid problems, this change introduces a fcntl lock on the device node. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/devmapper: Use explicit 64-bit types for sector countsJeremy Kerr2015-09-302-12/+14
| | | | | | | | | We currently have a bug where the return value from get_block_sectors may overflow an unsigned int, so we create a snapshot that is too small. This change uses uint64_t types for the sector counts. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Set default languageJeremy Kerr2015-09-241-1/+11
| | | | | | | Rather than setting NULL, do a setlocale(LC_ALL, NULL) to query the system locale value as our default. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* po: Add missed translations fixesJeremy Kerr2015-09-181-3/+3
| | | | | | We have a few manual fixes missing from the fr.po translation. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: status messages shouldn't have a trailing newlineJeremy Kerr2015-09-1812-23/+23
| | | | | | Fix the status message, and remove the newline from our translations. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* po: Manual translation formatting fixesJeremy Kerr2015-09-1810-58/+58
| | | | | | | We have a few minor issues, mostly formatting, from the latest translation drop. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* po: translation updatesJeremy Kerr2015-09-1810-421/+897
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Add translation comments for status messagesJeremy Kerr2015-09-182-1/+33
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* po: Update translation filesSamuel Mendoza-Jonas2015-09-156-113/+219
| | | | | | | Add additional source files to POTFILES.in and update the *.po files where able. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* Fix certain calls to gettextSamuel Mendoza-Jonas2015-09-152-7/+7
| | | | | | | 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>
* Merge branch 'pb-plugin' into masterSamuel Mendoza-Jonas2015-09-112-123/+453
|\ | | | | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
| * pb-plugin: Don't execute metadata filesJeremy Kerr2015-09-111-7/+25
| | | | | | | | | | | | | | Rather than sourcing a plugin's metadata file, explicitly parse variables. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
| * pb-plugin: Fix invalid command referenceJeremy Kerr2015-09-021-2/+2
| | | | | | | | | | | | | | We had the old code for using 'run'. Also, fix the error we see when issuing an invalid command. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
| * pb-console: Always add plugins directory to PATHJeremy Kerr2015-09-021-1/+2
| | | | | | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
| * pb-plugin: Add lint commandJeremy Kerr2015-09-021-41/+140
| | | | | | | | | | | | | | This change adds a `lint` command, to do some basic checks on the plugin structure and metadata. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
| * pb-plugin: Implement plugin ABI versioningJeremy Kerr2015-09-021-1/+84
| | | | | | | | | | | | | | | | | | | | | | If a future update to plugins is not compatbile with the installed plugin infrastructure, we want to abort the scan / install process. This change adds an ABI version to the script, as well as version (and minimum-supported version) to the plugin metadata. This means we can check before plugin execution. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
| * pb-plugin: Only require a fixed plugin extension, instead of full nameJeremy Kerr2015-09-021-51/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the `pb-plugin scan` code requires a fixed archive name at the root of distributed media. This means that vendors need to have a fixed name, and can only ship one plugin per device. This change shifts the requirement to just a filename extension (.pb-plugin) instead. To handle this, we now look for any plugin with a .pb-plugin extension, and so may find multiple plugins on a device. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
| * pb-plugin: Move plugin wrappers to a separate dirJeremy Kerr2015-08-272-2/+4
| | | | | | | | | | | | Use /var/lib/pb-plugins/bin, to prevent overwriting system binaries. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
| * pb-plugin: Keep chroot persistent, and create wrapper scriptsJeremy Kerr2015-08-211-40/+54
| | | | | | | | | | | | | | | | | | | | | | Rather than having to 'pb-plugin run' multiple times, we want users to be able to execute multiple plugin binaries with more accessible command-line statements. This change reverts to the previous 'install' (rather than 'run') behaviour, and creates wrapper scripts to call into the chroot. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
| * pb-plugin: Update to chroot-style pluginsJeremy Kerr2015-08-071-93/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change uses a chroot for all plugins, so that plugins have complete flexibility with their libraries, dependencies and configuration. We remove the 'install' action, as we simply run the plugin once. Running involves extracting the archive, setting up a root filesystem, and running a chroot. To simplify plugin discovery behaviour, we standardise the plugin file to be at pb-plugin.conf of attached devices, and read the metadatafile straight out of the archive. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* | 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>
* | discover: Allow fs recovery if snapshot availableSamuel Mendoza-Jonas2015-09-101-8/+18
| | | | | | | | | | | | | | | | | | If we have a device-mapper snapshot available we can now guarantee filesystem recovery will not write back to a read-only mounted disk. Allow recovery on those devices with the notable exception of XFS which may fail to mount if the filesystem is the opposite endian of Petitboot. 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>
OpenPOWER on IntegriCloud