summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* discover/platform: Add boot device to config dumpJeremy Kerr2014-09-181-0/+3
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* po: Add initial translationsJeremy Kerr2014-09-1813-1/+5444
| | | | | | | Add the initial translation set for de, en, es, fr, it, ja, ko, pt_BR, ru, zh_CN and zh_TW languages. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Correctly size pad for config screenSamuel Mendoza-Jonas2014-09-101-5/+10
| | | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Help string fixesJeremy Kerr2014-09-043-10/+10
| | | | | | | | The Configuration screen help doesn't reflect the option name, so update that to match. Also, fix the wording of the "Rescan devices" help. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Exit safe mode on configuration changeSamuel Mendoza-Jonas2014-09-043-3/+31
| | | | | | | | | | Selecting 'OK' in the configuration or language select screen will send a configuration change to the server and exit safe mode. Exit safe mode explicity and warn the user that they are about to exit it. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Reject ADD_URL actions without configured networkSamuel Mendoza-Jonas2014-09-042-1/+10
| | | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Implement PXE SYSAPPEND syntaxJeremy Kerr2014-08-253-1/+83
| | | | | | | This change implements SYSAPPEND/IPAPPEND 2, to add a BOOTIF argument to the kernel command line. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Update 'add-url' help messageSamuel Mendoza-Jonas2014-08-252-13/+13
| | | | | | | We should make it clear that we're looking for a PXE-style config file. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add new main menu options to help screenJeremy Kerr2014-08-212-1/+25
| | | | | | | The language, rescan and retrieve options are new, so add them to the help text. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Make device labels translateableJeremy Kerr2014-08-212-6/+18
| | | | | | | | | | We're not using gettext for the device label strings; this change adds the necessary macros to do so. Also, we change "Interface" to "Network", to make the label a little more obvious. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/platform-powerpc: Fix incorrect device tree directoryJeremy Kerr2014-08-071-3/+8
| | | | | | | It's /proc/device-tree, not /proc/device_tree. Use a variable to hold this prefix. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* version.sh: Don't use dashes in version numbersJeremy Kerr2014-08-051-2/+2
| | | | | | ... as they're not valid for RPM. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Add debug flag to configJeremy Kerr2014-08-058-14/+45
| | | | | | | | | | This change adds a debug flag to the config, and groups it under not-user-modifiable parts of struct config. This means we no longer need the pb-sysinfo helper, as the last remaining function (--debug-enabled) can be implemented with pb-config. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Use platform code to read sysinfo type and identifierJeremy Kerr2014-08-055-41/+31
| | | | | | | | | | | | | | | | This change uses the platform-specific code to read the system type and identifier, rather than the pb-sysinfo utility. We introduce a new callback for struct platform: int (*get_sysinfo)(struct platform *, struct system_info *); - which populates struct system_info with appropriate information. This means that the system-specific code is kept in one place; rather than having powerpc-specific device-tree-reading code in the pb-sysinfo shell script. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib: Move generic file-handling code to lib/Jeremy Kerr2014-08-057-9/+5
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* utils: Add pb-config utilityJeremy Kerr2014-08-052-2/+124
| | | | | | A simple tool to query platform configuration. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Move platform config to a .roJeremy Kerr2014-08-051-3/+10
| | | | | | | We want to allow an external utility to use the platform config code, so build it into a .ro, which is then linked to the discover code. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: distinguish parser.h from grub2/parser.hJeremy Kerr2014-08-054-18/+19
| | | | | | | | | | | | | 'make distcheck' will do a 'make all' srcdir == objdir, then later a 'make check' sith srcdir != objdir. Since gcc's cpp always assumes that a source file's directory is first in the include paths, we may see discover/parser.h included when we wanted the generated discover/grub2/parser.h. This change renames the grub2 lexer and parser files, to work-around this behaviour, and fix 'make distcheck'. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* automake: silence make outputJeremy Kerr2014-08-054-11/+9
| | | | | | | | | Currently, we get a lot of noise out of the build process; automake supports V={0,1}, which we can use to suppress the output a little. This needs a few cleanups for custom commands. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* autotools: Don't link udev into everythingJeremy Kerr2014-08-052-5/+4
| | | | | | | | By default, AC_CHECK_LIB will append to $LIBS, which is used for all link stages. Intstead, we should popuate $UDEV_LIBS, and just use that for the single pb-discover link stage. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud