summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ui/ncurses: Display current ipmi bootdev settingsSamuel Mendoza-Jonas2015-05-051-1/+44
| | | | | | | Display the current IPMI bootdev override if it exists, and allow the user to clear it from the configuration screen. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* lib: Move ipmi_bootdev enum to types.hSamuel Mendoza-Jonas2015-05-054-9/+34
| | | | | | | Move the ipmi_bootdev definition to types.h to support returning descriptive strings to the system configuration UI. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Update config screen help textSamuel Mendoza-Jonas2015-05-051-12/+15
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* petitboot: Implement ordered boot optionsSamuel Mendoza-Jonas2015-05-058-222/+419
| | | | | | | | | | | Move petitboot to a more familiar 'boot-order' based autoboot system. The discover server now reads multiple values from the petitboot,bootdev parameter and adds them in order to config->autoboot_opts. Boot priority is determined by the options' position in the list. On the client, nc-config now recognises the new boot order, and allows the user to add, remove, and reorder the devices in the list. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Use sorted field navigationSamuel Mendoza-Jonas2015-05-051-4/+4
| | | | | | | | | Changing the visual order of widgets will cause their associated fields to be out of order relative to the widgetset field array. Rather than manually resorting the array, use sorted navigation to move according to a field's visual positon Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Add nc-subset selection screenSamuel Mendoza-Jonas2015-05-056-1/+356
| | | | | | | | | | The nc-subset screen is intended to be used as a sub-screen from the current screen (eg. nc-config) which passes a pointer to a nc_widget_subset struct. The nc-subset screen allows the user to select an option from a list of 'inactive' options, before returning control back to the current screen. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Add nc_widget_subsetSamuel Mendoza-Jonas2015-05-052-1/+383
| | | | | | | | The new nc_widget_subset is similar to nc_widget_select, but hides added options until they are made active. This allows the widget to have multiple options selected and ordered without cluttering the screen. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* discover: Add support for multiple bootdev argumentsSamuel Mendoza-Jonas2015-05-051-0/+41
| | | | | | | | To support multiple autoboot options while retaining backwards compatability, interpret the petitboot,bootdev parameter as optionally having several space-separated values. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* lib: Define autoboot_options, device_type helpersSamuel Mendoza-Jonas2015-05-054-17/+67
| | | | | | | | | Add the new autoboot_option struct, and helper functions for working with device_type enums. device_type_name() returns exact strings as used by platform code to read/write nvram params, so device_type_display_name() is added for use in user-visible strings. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* discover: Set OS Boot sensor with 0xa9Joel Stanley2015-04-301-1/+1
| | | | | | | | | | | | | If we don't set all the things, we only get an assertion event, without the state being asserted. Despite the IPMI spec suggesting we only needed to set 0x10, aka the assertion bits, testing reveals we want to set all of the things to cause the BMC to assert the state. Tested-by: Nick Bofferding <bofferdn@us.ibm.com> Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Define Home, End, and Page Up/Down keysSamuel Mendoza-Jonas2015-04-221-0/+10
|
* discover/platform-powerpc: Set IPMI OS boot sensorJoel Stanley2015-04-215-2/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is to indicate to a BMC that we have initiated OS boot. This patch manually parses the device tree for the sensor information. In the future this could be replaced by libfdt or similar. Discover the id of your OS Boot sensor: $ sudo ipmitool sensor get "OS Boot" Locating sensor record... Sensor ID : OS Boot (0x5a) Entity ID : 35.0 (Operating System) Sensor Type (Discrete): OS Boot (0x1f) Sensor Reading : 0h Event Message Control : Per-threshold Assertion Events : OS Boot [boot completed - device not specified] Assertions Enabled : OS Boot [A: boot completed] [C: boot completed] [PXE boot completed] [Diagnostic boot completed] [CD-ROM boot completed] [ROM boot completed] [boot completed - device not specified] [Installation started] [Installation completed] [Installation aborted] [Installation failed] OEM : 0 In this case it is 0x1f. Note that the sesnor is currently asserted iwth boot completed - device not specified. Test by clearing all assertions in the OS Boot sensor: $ sudo ipmitool raw 0x04 0x30 0x5a 0x30 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 $ sudo ipmitool sensor get "OS Boot" Locating sensor record... Sensor ID : OS Boot (0x5a) Entity ID : 35.0 (Operating System) Sensor Type (Discrete): OS Boot (0x1f) Sensor Reading : 0h Event Message Control : Per-threshold Assertions Enabled : OS Boot [A: boot completed] [C: boot completed] [PXE boot completed] [Diagnostic boot completed] [CD-ROM boot completed] [ROM boot completed] [boot completed - device not specified] [Installation started] [Installation completed] [Installation aborted] [Installation failed] OEM : 0 Then reboot your system. The assertion event should once more say "boot completed - device not specified". Signed-off-by: Joel Stanley <joel@jms.id.au>
* utils/pb-console: establish PATH before running pb-configJeremy Kerr2015-04-141-0/+7
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Initialise strtok_r saveptr to NULLSamuel Mendoza-Jonas2015-04-143-3/+3
| | | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Merge remote-tracking branch 'sammj/master'Jeremy Kerr2015-04-147-10/+90
|\
| * discover: Mount with norecovery, avoid rw mount of XFS filesystemsSamuel Mendoza-Jonas2015-03-261-5/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Journaled filesytems may still write to their disk even if the disk is mounted read only. Petitboot should avoid modifying any disks automatically, and in mixed-endian systems this can also cause journal operations to fail. Use the 'norecovery' option on filesystems that support it to skip the journal replay. Additionally, mounting an XFS filesystem as read-write in such a case will cause the call to mount to hang indefinitely. Avoid this generally by explicitly unmounting and (re)mounting when mounting read-write. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
| * discover: Recognise renamed network interfacesSamuel Mendoza-Jonas2015-03-261-0/+9
| | | | | | | | | | | | | | | | | | | | Udev may change the name of network interfaces if persistent interface naming is used. It is important to recognise this since udev may re-use the old name for a different interface. If we receive an RTM_NEWLINK message for an existing interface, check if the name has been updated. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
| * ui/ncurses: Reduce unnecessary calls to redrawwinSamuel Mendoza-Jonas2015-02-165-5/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All current *_post() methods in ui/ncurses call redrawwin() and wrefresh() together. wrefresh() updates any lines on the screen that have been marked as changed or invalid. However redrawwin() marks the entire screen as invalid unconditionally. We can reduce the amount of data written to the screen by avoiding calls to redrawwin(). Screen transitions are the primary use case of redrawwin(), where the whole screen must be invalidated to avoid stale data remaining on screen. All other 'in-screen' updates such as changes to widgets or changing focus do not require a call to redrawwin(). The most noticeable performance improvement is in nc-menu, which makes an unnecssary call to redrawwin() after every addition to the boot option menu. eg. The number of bytes written to STDOUT in the main menu: # Boot options | Before | After -------------------------------- 8 | 5488 | 1149 133 | 422454 | 4652 Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
| * ui/ncurses: Prevent creation of empty boot entrySamuel Mendoza-Jonas2015-02-161-0/+9
| | | | | | | | | | | | | | | | | | A boot option requires an image path at minimum. If an option is created without an image, trying to edit the resulting user item causes a segfault. Prevent the user from creating a boot option without at least an image path. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* | discover/platform-powerpc: Fix logic for persistent IPMI boot settingsJeremy Kerr2015-04-021-1/+1
| | | | | | | | | | | | We should only clear the IPMI bootdev if the setting *isn't* persistent. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* | utils/pb-plugin: Add pb-plugin scriptJeremy Kerr2015-03-272-1/+514
|/ | | | | | | Add a little script for downloading and/or extracting a plugin into a petitboot environment Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/platform: rename finalise_config hookJeremy Kerr2015-02-164-8/+8
| | | | | | | We want to expand the finalise_config hook to cover generic pre-boot functionality, so rename to pre_boot. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/platform-powerpc: Implement direct IPMI interfaceJeremy Kerr2014-12-153-5/+297
| | | | | | | This change adds a direct IPMI interface to the /dev/ipmi0 device node, which is present on OpenPower machines. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Integrate ipmi bootdev settings into the priority systemJeremy Kerr2014-12-157-69/+173
| | | | | | | | | | | | | | | | | | Currently, we expose the boot device priorities through an array in struct config, which will either be the default (network -> disk), or a single device type specified by the IPMI code. Rather than hide the implementation details in this array, we'd like to expose the details of the machine configuration instead. This allows user visibility of the real boot configuration (for example, if an IPMI boot preference is set). This change removes the priority array, and replaces it with the ipmi_bootdev data (and a persistent flag). We update the default-conflict-resolution code to reflect the priorities between IPMI and UUID preferences. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/powerpc: Separate ipmi bootdev handling into separate functionsJeremy Kerr2014-12-153-30/+43
| | | | | | | | We'd like to add a new backend to the bootdev storage, so move the common bootdev-handling code into separate functions, moving ipmi_bootdev_is_valid to ipmi.c. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Add ipmi moduleJeremy Kerr2014-12-154-10/+29
| | | | | | | | Move our IPMI-specific definitions to a separate header, and a mostly-empty ipmi.c file. We'll populate this with IPMI functionality in later changes. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Allow unset and invalid defaultsJeremy Kerr2014-12-115-1/+88
| | | | | | | | | | | | | | If the default environment variable is unset or invalid (i.e., references a non-existent boot option), then GRUB2 will fallback to the first boot option present. This is preventing petitboot from autobooting where no default is explicitly set, or is stale. This change adds this fallback behaviour to petitboot. Because we don't know if the first option will be a default at parse time (as no other options matched the default env var), we need to keep options in a list, and register them with the discover server once the parse is complete. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/pxe: Format IPAPPEND mac addresses correctlySamuel Mendoza-Jonas2014-12-0310-6/+96
| | | | | | | | | | | | | | | | | | | | | The SYSAPPEND/IPAPPEND option 2 in PXE configs requires the MAC address of the booting interface to be appended to the boot options. Previously we formatted this as "BOOTIF=01:02:03:04:05:06", but syslinux/pxelinux implementation use this format: "BOOTIF=01-01-02-03-04-05-06", where the leading '01' represents the hardware type. The relevant part of the pxelinux doc is at: http://www.syslinux.org/wiki/index.php/SYSLINUX#SYSAPPEND_bitmask Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/parser: Add SLES btrfs snapshot stanzaJeremy Kerr2014-12-012-0/+28
| | | | | | | This has caused problems with the old delimiter code, add a test to ensure we don't regress. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: improve handling of word & delimiter tokensJeremy Kerr2014-12-017-41/+156
| | | | | | | | | | | | | | | | | | | | | | | Currently, the delimiter token handling is a little fragile: we try to ignore non-inter-word delimiters in the lexer with a selective set of regexes on the possible delimiter characters. This means we don't need to handle potential delimiters in every grammar rule, but there are other situations (not regex-able) where we may see delimters, and this will cause a parse error. Instead of relying on the regex behaviour, we have an 'inter_word' flag, which is set when we see the first word token, and cleared when we see an end-of-line token. We only emit TOKEN_DELIM when this flag is set. This means that we only get the delim tokens when they're required - when we're looking for word separators (becuase WORD DELIM WORD is distinct from WORD WORD - eg "linux /vmlinux" and "x$var"). We add a few new tests for the "menuentry" and "if" syntax, with different delimiter configurations. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/parser: Add dependency on libpbcore.laJeremy Kerr2014-12-011-1/+1
| | | | | | | | | | | | | | Currently, build only a test object will fail: [jk@pablo obj]$ make ./test/parser/test-grub2-single CCLD test/parser/test-grub2-single libtool: link: cannot find the library `lib/libpbcore.la' or unhandled argument `lib/libpbcore.la' We're adding this to the link argument, but not as a dependency. This change adds the dependency. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/fold: fix warning with -DDEBUGJeremy Kerr2014-12-011-1/+1
| | | | | | | | | | | | | When compiling the fold code with DEBUG defined, we get: ../lib/fold/fold.c: In function 'fold_text': ../lib/fold/fold.c:37:3: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits] assert(bytes >= 0); ^ We should be comparing with != (size_t)-1, not >= 0 Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: fix incorrect prototype in yyerrorJeremy Kerr2014-12-012-5/+6
| | | | | | | Because we're using two parse-params, we need to add the scanner argument to yyerror. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Properly size buttons in boot option editorSamuel Mendoza-Jonas2014-10-131-3/+3
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* po: Translation UpdatesSamuel Mendoza-Jonas2014-10-1311-54/+54
| | | | | | Including "Network Interfaces", "up" and "down", and other minor updates Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Expand width of padSamuel Mendoza-Jonas2014-10-081-1/+1
| | | | | | | | Widgets running over the horizontal width of the pad will cause the screen to blank. Expand the (non-viewable) size of the pad to prevent blanking until shorter translations are available for nc-config. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Warn if widget runs over horizontal pad widthSamuel Mendoza-Jonas2014-10-081-0/+4
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Properly size cancel and help buttonsSamuel Mendoza-Jonas2014-10-083-7/+7
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Dynamically align text fields in nc-configSamuel Mendoza-Jonas2014-10-081-1/+35
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* po: Minor Russian translation updatesSamuel Mendoza-Jonas2014-10-0811-19/+19
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* discover/platform: Add finalise_config_hookJeremy Kerr2014-09-304-11/+25
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* po: French translation updatesSamuel Mendoza-Jonas2014-09-301-14/+13
| | | | | | Shorten strings in labels and help text for nc-config. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Adjust position of add-url field to fit translated labelSamuel Mendoza-Jonas2014-09-301-1/+1
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Expand cancel & help button widthSamuel Mendoza-Jonas2014-09-234-12/+12
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* po: translation updatesSamuel Mendoza-Jonas2014-09-2311-53/+189
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* tests/lib/test-fold: Add mbs test with separatorsJeremy Kerr2014-09-231-1/+12
| | | | | | | Ensure we're doing the correct thing with mbs + separators in the fold code. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/fold: Add support for multibyte stringsJeremy Kerr2014-09-232-15/+109
| | | | | | | | | | Currently, the fold_text function doesn't understand multibyte strings, so may break a line in the middle of a multibyte sequence. This change adds multibyte-awareness to the fold code, and uses proper width calculations for the contents of the folded string. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Fix unstranslated strings in sysinfo screenJeremy Kerr2014-09-191-2/+4
| | | | | | We have a couple of strings that are missing the gettext call. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/platform-powerpc: Read language configuration from NVRAMJeremy Kerr2014-09-181-0/+7
| | | | | | Implement load & save of the petitboot language configuration. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Fix clearing a boot device UUIDJeremy Kerr2014-09-181-7/+6
| | | | | | | | | | | | Currently, we have a bug where we can't clear a boot device UUID, as we only update config->boot_device if we're in AUTOBOOT_ONE state. This means that the config UI can't be used to change out of "autoboot from a single device" mode. This sets the autoboot device unconditionally, allowing it to be cleared. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud