Joel Stanley [Thu, 30 Apr 2015 06:02:03 +0000 (16:02 +1000)]
discover: Set OS Boot sensor with 0xa9
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: Jeremy Kerr <jk@ozlabs.org>
Joel Stanley [Tue, 21 Apr 2015 06:17:57 +0000 (16:17 +1000)]
discover/platform-powerpc: Set IPMI OS boot sensor
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>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Tue, 14 Apr 2015 06:23:36 +0000 (16:23 +1000)]
utils/pb-console: establish PATH before running pb-config
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Samuel Mendoza-Jonas [Fri, 10 Apr 2015 05:57:34 +0000 (15:57 +1000)]
discover: Initialise strtok_r saveptr to NULL
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Tue, 14 Apr 2015 05:36:38 +0000 (15:36 +1000)]
Merge remote-tracking branch 'sammj/master'
Jeremy Kerr [Thu, 2 Apr 2015 09:59:30 +0000 (17:59 +0800)]
discover/platform-powerpc: Fix logic for persistent IPMI boot settings
We should only clear the IPMI bootdev if the setting *isn't* persistent.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Mon, 23 Mar 2015 05:58:57 +0000 (13:58 +0800)]
utils/pb-plugin: Add pb-plugin script
Add a little script for downloading and/or extracting a plugin into a
petitboot environment
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Samuel Mendoza-Jonas [Mon, 23 Mar 2015 05:54:45 +0000 (16:54 +1100)]
discover: Mount with norecovery, avoid rw mount of XFS filesystems
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>
Samuel Mendoza-Jonas [Wed, 4 Mar 2015 02:40:05 +0000 (13:40 +1100)]
discover: Recognise renamed network interfaces
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>
Samuel Mendoza-Jonas [Wed, 4 Feb 2015 01:02:23 +0000 (12:02 +1100)]
ui/ncurses: Reduce unnecessary calls to redrawwin
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>
Samuel Mendoza-Jonas [Mon, 2 Feb 2015 05:50:13 +0000 (16:50 +1100)]
ui/ncurses: Prevent creation of empty boot entry
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>
Jeremy Kerr [Tue, 27 Jan 2015 06:38:55 +0000 (14:38 +0800)]
discover/platform: rename finalise_config hook
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>
Jeremy Kerr [Mon, 15 Dec 2014 01:47:39 +0000 (09:47 +0800)]
discover/platform-powerpc: Implement direct IPMI interface
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>
Jeremy Kerr [Thu, 11 Dec 2014 08:38:21 +0000 (16:38 +0800)]
discover: Integrate ipmi bootdev settings into the priority system
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>
Jeremy Kerr [Tue, 2 Dec 2014 07:04:38 +0000 (15:04 +0800)]
discover/powerpc: Separate ipmi bootdev handling into separate functions
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>
Jeremy Kerr [Mon, 8 Dec 2014 06:39:14 +0000 (14:39 +0800)]
discover: Add ipmi module
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>
Jeremy Kerr [Thu, 11 Dec 2014 01:42:58 +0000 (09:42 +0800)]
discover/grub2: Allow unset and invalid defaults
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>
Samuel Mendoza-Jonas [Wed, 3 Dec 2014 04:08:23 +0000 (15:08 +1100)]
discover/pxe: Format IPAPPEND mac addresses correctly
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>
Jeremy Kerr [Mon, 1 Dec 2014 03:59:20 +0000 (11:59 +0800)]
test/parser: Add SLES btrfs snapshot stanza
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>
Jeremy Kerr [Mon, 1 Dec 2014 03:47:16 +0000 (11:47 +0800)]
discover/grub2: improve handling of word & delimiter tokens
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>
Jeremy Kerr [Fri, 28 Nov 2014 03:44:03 +0000 (11:44 +0800)]
test/parser: Add dependency on libpbcore.la
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>
Jeremy Kerr [Fri, 28 Nov 2014 03:42:06 +0000 (11:42 +0800)]
lib/fold: fix warning with -DDEBUG
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>
Jeremy Kerr [Fri, 28 Nov 2014 03:40:05 +0000 (11:40 +0800)]
discover/grub2: fix incorrect prototype in yyerror
Because we're using two parse-params, we need to add the scanner
argument to yyerror.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Samuel Mendoza-Jonas [Sun, 12 Oct 2014 22:45:04 +0000 (09:45 +1100)]
ui/ncurses: Properly size buttons in boot option editor
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Samuel Mendoza-Jonas [Mon, 13 Oct 2014 00:04:58 +0000 (11:04 +1100)]
po: Translation Updates
Including "Network Interfaces", "up" and "down", and other minor updates
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Samuel Mendoza-Jonas [Wed, 8 Oct 2014 03:03:49 +0000 (14:03 +1100)]
ui/ncurses: Expand width of pad
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>
Samuel Mendoza-Jonas [Fri, 3 Oct 2014 04:37:20 +0000 (14:37 +1000)]
ui/ncurses: Warn if widget runs over horizontal pad width
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Samuel Mendoza-Jonas [Wed, 8 Oct 2014 02:49:30 +0000 (13:49 +1100)]
ui/ncurses: Properly size cancel and help buttons
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Samuel Mendoza-Jonas [Wed, 8 Oct 2014 02:40:47 +0000 (13:40 +1100)]
ui/ncurses: Dynamically align text fields in nc-config
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Samuel Mendoza-Jonas [Wed, 8 Oct 2014 00:56:06 +0000 (11:56 +1100)]
po: Minor Russian translation updates
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Jeremy Kerr [Mon, 29 Sep 2014 23:23:22 +0000 (09:23 +1000)]
discover/platform: Add finalise_config_hook
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Samuel Mendoza-Jonas [Tue, 30 Sep 2014 00:20:40 +0000 (10:20 +1000)]
po: French translation updates
Shorten strings in labels and help text for nc-config.
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Samuel Mendoza-Jonas [Mon, 22 Sep 2014 06:05:07 +0000 (16:05 +1000)]
ui/ncurses: Adjust position of add-url field to fit translated label
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Samuel Mendoza-Jonas [Tue, 23 Sep 2014 07:32:35 +0000 (17:32 +1000)]
ui/ncurses: Expand cancel & help button width
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Samuel Mendoza-Jonas [Tue, 23 Sep 2014 07:25:33 +0000 (17:25 +1000)]
po: translation updates
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Jeremy Kerr [Tue, 23 Sep 2014 07:07:14 +0000 (15:07 +0800)]
tests/lib/test-fold: Add mbs test with separators
Ensure we're doing the correct thing with mbs + separators in the fold
code.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Tue, 23 Sep 2014 06:46:06 +0000 (14:46 +0800)]
lib/fold: Add support for multibyte strings
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>
Jeremy Kerr [Fri, 19 Sep 2014 01:07:36 +0000 (09:07 +0800)]
ui/ncurses: Fix unstranslated strings in sysinfo screen
We have a couple of strings that are missing the gettext call.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Thu, 18 Sep 2014 14:13:27 +0000 (22:13 +0800)]
discover/platform-powerpc: Read language configuration from NVRAM
Implement load & save of the petitboot language configuration.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Thu, 18 Sep 2014 11:21:00 +0000 (19:21 +0800)]
ui/ncurses: Fix clearing a boot device UUID
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>
Jeremy Kerr [Thu, 18 Sep 2014 11:18:32 +0000 (19:18 +0800)]
discover/platform: Add boot device to config dump
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Fri, 29 Aug 2014 08:33:51 +0000 (16:33 +0800)]
po: Add initial translations
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>
Samuel Mendoza-Jonas [Wed, 10 Sep 2014 00:50:44 +0000 (10:50 +1000)]
ui/ncurses: Correctly size pad for config screen
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Mon, 1 Sep 2014 05:40:01 +0000 (13:40 +0800)]
ui/ncurses: Help string fixes
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>
Samuel Mendoza-Jonas [Fri, 29 Aug 2014 04:03:17 +0000 (14:03 +1000)]
ui/ncurses: Exit safe mode on configuration change
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>
Samuel Mendoza-Jonas [Fri, 29 Aug 2014 04:03:16 +0000 (14:03 +1000)]
discover: Reject ADD_URL actions without configured network
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Mon, 25 Aug 2014 07:49:29 +0000 (15:49 +0800)]
discover: Implement PXE SYSAPPEND syntax
This change implements SYSAPPEND/IPAPPEND 2, to add a BOOTIF argument to
the kernel command line.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Samuel Mendoza-Jonas [Fri, 22 Aug 2014 01:24:43 +0000 (11:24 +1000)]
ui/ncurses: Update 'add-url' help message
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>
Jeremy Kerr [Thu, 21 Aug 2014 04:17:24 +0000 (12:17 +0800)]
ui/ncurses: Add new main menu options to help screen
The language, rescan and retrieve options are new, so add them to the
help text.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Thu, 21 Aug 2014 02:19:09 +0000 (10:19 +0800)]
ui/ncurses: Make device labels translateable
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>
Jeremy Kerr [Thu, 7 Aug 2014 11:16:21 +0000 (21:16 +1000)]
discover/platform-powerpc: Fix incorrect device tree directory
It's /proc/device-tree, not /proc/device_tree. Use a variable to hold
this prefix.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Tue, 5 Aug 2014 06:01:34 +0000 (14:01 +0800)]
version.sh: Don't use dashes in version numbers
... as they're not valid for RPM.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Wed, 23 Jul 2014 06:20:12 +0000 (14:20 +0800)]
discover: Add debug flag to config
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>
Jeremy Kerr [Wed, 23 Jul 2014 06:03:42 +0000 (14:03 +0800)]
discover: Use platform code to read sysinfo type and identifier
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>
Jeremy Kerr [Wed, 23 Jul 2014 05:47:32 +0000 (13:47 +0800)]
lib: Move generic file-handling code to lib/
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Wed, 23 Jul 2014 05:33:15 +0000 (13:33 +0800)]
utils: Add pb-config utility
A simple tool to query platform configuration.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Wed, 23 Jul 2014 05:32:08 +0000 (13:32 +0800)]
discover: Move platform config to a .ro
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>
Jeremy Kerr [Mon, 4 Aug 2014 01:46:00 +0000 (09:46 +0800)]
discover/grub2: distinguish parser.h from grub2/parser.h
'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>
Jeremy Kerr [Fri, 1 Aug 2014 04:32:31 +0000 (12:32 +0800)]
automake: silence make output
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>
Jeremy Kerr [Fri, 1 Aug 2014 03:55:45 +0000 (11:55 +0800)]
autotools: Don't link udev into everything
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>
Jeremy Kerr [Mon, 28 Jul 2014 08:20:04 +0000 (16:20 +0800)]
autotools: Use non-recursive make
With the current testing infrastructure, we don't have a strictly
hierarchical set of dependencies. This causes problems with a recursive
make, and means we have to hack around some of the dependencies.
This change generates a single, top-level makefile from all of the
Makefile.am fragments. We still need the po/ directory as a separate
SUBDIR, but all others can be converted to non-recursive.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Fri, 1 Aug 2014 01:30:52 +0000 (09:30 +0800)]
configure: don't put cpp flags in CFLAGS
-D* should go in CPPFLAGS, not CFLAGS.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Fri, 1 Aug 2014 03:08:40 +0000 (11:08 +0800)]
discover: add initialiser for config->safe_mode
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Fri, 1 Aug 2014 01:28:51 +0000 (09:28 +0800)]
test/parser: Add missing stubs for network_(un)register_interface
The device handler code needs these calls on interface add/remove, so we
need to provide stubs for the test framework.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Fri, 1 Aug 2014 01:27:29 +0000 (09:27 +0800)]
discover: Add missing include
We use setlocale() in device-handler.c, so we need locale.h
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Samuel Mendoza-Jonas [Thu, 24 Jul 2014 05:05:39 +0000 (15:05 +1000)]
ui/ncurses: Add support for 'add-url' action
Creates a menu option to specify a remote conf file url to send to
the server for parsing.
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Samuel Mendoza-Jonas [Thu, 24 Jul 2014 05:05:38 +0000 (15:05 +1000)]
discover: Add support for 'add-url' actions
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Samuel Mendoza-Jonas [Thu, 24 Jul 2014 05:05:37 +0000 (15:05 +1000)]
lib/pb-protocol: Define new 'add-url' action
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Samuel Mendoza-Jonas [Thu, 24 Jul 2014 05:05:36 +0000 (15:05 +1000)]
discover: Enable 'url' pb-events
Adds a new option to pb-event;
./pb-event url@dev url=scheme://path/to/petitboot.conf
Specifies a remote conf file to parse for boot options
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Mon, 28 Jul 2014 04:18:21 +0000 (12:18 +0800)]
discover: Use translated strings for boot status messages
Since we're operating in the correct locale now, we can send translated
strings in the boot status messages.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Mon, 28 Jul 2014 04:09:14 +0000 (12:09 +0800)]
discover: Add setlocale calls in discover server
We want the discover server to respect the configured language, so we'll
need to add appropriate setlocale() calls. We use the config->lang
setting to use any previously-saved language.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Mon, 28 Jul 2014 02:42:25 +0000 (10:42 +0800)]
ui/ncurses: Add language selector & support for language changes
This change adds a language selector UI, and allows language changes
from incoming configuration messages.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Fri, 25 Jul 2014 01:49:37 +0000 (09:49 +0800)]
config: Add lang member to config
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Thu, 24 Jul 2014 08:00:59 +0000 (16:00 +0800)]
ui/common: Add discover_client_enumerate to re-add device data
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Thu, 24 Jul 2014 07:13:24 +0000 (15:13 +0800)]
ui/ncurses: Move menu initialisation to cui code
We'll want to re-initialise the petitboot main menu (when the language
is changed), which we can't do if the items are populated entirely from
the main() function.
This change moves the menu initilisation to the cui code, we we can
re-init when necessary.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Tue, 24 Jun 2014 06:00:12 +0000 (14:00 +0800)]
i18n: Add english translation
No translation necessary.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Tue, 24 Jun 2014 05:32:45 +0000 (13:32 +0800)]
ui/ncurses: Mark help text as translateable
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Tue, 24 Jun 2014 05:18:03 +0000 (13:18 +0800)]
ui/ncurses: Use a separate type for help text
Because it's initialised statically, help text won't be directly
gettext()-ed. Instead, we need to perform the gettext translation at
runtime, and pass untranslated strings into the help_screen code.
Instead of trusting callers to pass the untranslated strings though, we
encapsulate the help text data into struct help_text, so we know we have
an unstranslated string.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Wed, 18 Dec 2013 01:49:23 +0000 (09:49 +0800)]
i18n: Mark translatable strings for ncurses UI
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Mon, 16 Dec 2013 07:27:14 +0000 (15:27 +0800)]
Add gettext infrastructure
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Mon, 28 Jul 2014 02:09:49 +0000 (10:09 +0800)]
discover: Only update our config if the config_set succeeded.
If config_set fails, we don't want to send the failed config out to
clients.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Samuel Mendoza-Jonas [Wed, 16 Jul 2014 06:23:59 +0000 (16:23 +1000)]
ui/ncurses: Add device hierarchy
Boot options are now listed under their matching boot device in the
ncurses UI to help differentitate similar boot option names
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Mon, 21 Jul 2014 10:28:04 +0000 (18:28 +0800)]
ui/ncurses: Add safe mode indicator
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Mon, 21 Jul 2014 10:30:33 +0000 (18:30 +0800)]
discover/platform-powerpc: Configure safe mode from IPMI bootdev setting
An IPMI bootflags of 0x3 indicates a safe-mode boot. Use this to trigger
petitboot's safe mode.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Mon, 21 Jul 2014 10:18:35 +0000 (18:18 +0800)]
discover: Add safe mode
Safe mode configures the discover server to not start any device
parsing; this can be used to diagnose any problems with early device
handing.
In safe mode, we don't initialise any of the device sources - udev,
network and user events are disabled.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Fri, 18 Jul 2014 05:23:42 +0000 (13:23 +0800)]
version.sh: Ensure we're using petitboot's git directory
We don't want the version to be extracted from a higher-level git
directory.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Fri, 18 Jul 2014 04:28:43 +0000 (12:28 +0800)]
ui/ncurses: allow tab/backtab to skip through a widget's fields
Since we may have a long list of devices on the configuration screen,
we'd like a way to jump between widgets. This change repeats the
PREV_FIELD/NEXT_FIELD driver request on these events.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Fri, 18 Jul 2014 02:49:32 +0000 (10:49 +0800)]
ui/ncurses: Make Network: heading consistent with other labels
The 'Network' label was originally intended as a header, but we should
keep it consistent with other field labels.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Wed, 30 Apr 2014 04:14:41 +0000 (12:14 +0800)]
ui/ncurses: Expose boot_device configuration through UI
Add a configuration setting for the default boot device.
We change the autoboot option to a select, as we have three possible
behaviours for autoboot:
( ) Don't autoboot
( ) Autoboot from any disk/network device
( ) Only autoboot from a specific disk/network device
The latter option will show a list of possible devices to seelct for
autoboot behaviour.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Wed, 30 Apr 2014 03:25:42 +0000 (11:25 +0800)]
discover/powerpc: Parse & save default boot device parameter
This change implement load & save support for the default boot device
configuration parameter.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Wed, 30 Apr 2014 02:58:43 +0000 (10:58 +0800)]
discover: check config.boot_device before setting a default
If a default device is set, we only allow booting from that device.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Wed, 30 Apr 2014 02:17:20 +0000 (10:17 +0800)]
config: Add boot_device member to config
We'd like to specify a way to only boot from a specific block device;
this adds a field to the configuration to hold the value.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Mon, 21 Jul 2014 07:51:58 +0000 (15:51 +0800)]
discover: allow separate lifetimes for network interfaces and discover devices
We want the network code's network interfaces to (potentially) persist
remove events. For example, discover devices may be removed by a user
event (this happens during a udhcpc deconfig). In this case, we want the
boot options to be removed, but the struct interface needs to stay
present.
This change adds network_(un)_register_device functions, to allow the
device handler to detach from and attach to interfaces.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Thu, 17 Jul 2014 01:13:58 +0000 (09:13 +0800)]
discover: Set UUID for network interface devices
We want to lookup network (as well as block) devices by UUID, so set one
based on the MAC address.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Thu, 17 Jul 2014 03:08:09 +0000 (11:08 +0800)]
ui/ncurses: Remove net_conf parameter from sconfig_screen_layout_widgets
We always pass screen->net_conf_type as this parameter, so we may as
weel grab it from screen directly.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Mon, 5 May 2014 03:45:16 +0000 (11:45 +0800)]
ui/ncurses: specify a fixed length for status messages
Incoming status messages can be an arbitrary length; if so, the status
line may be corrupt.
This change uses the 'n' variant of mvwaddnstr(), so we only write one
line of characters.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Mon, 5 May 2014 03:43:13 +0000 (11:43 +0800)]
discover: place countdown earlier in boot status messages
The boot status messages may be trimmed on the right-hand side; In this
case, we'll lose the boot countdown.
This change moves the boot countdown time to before the arbitrary-length
label string.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Wed, 4 Jun 2014 04:35:25 +0000 (12:35 +0800)]
discover/pxe-parser: Remove unnecessary semicolon
We have an unnecessary semicolon on an empty for-loop, which causes a
clang warning.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Fri, 13 Jun 2014 03:42:03 +0000 (13:42 +1000)]
m4: Add ncurses autoconf macros
Currently, we depend on host autoconf-archive for the AX_WITH_CURSES
macros. Insead, include this in the source tree under m4/
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Fri, 14 Mar 2014 03:06:10 +0000 (11:06 +0800)]
version.sh: Use git tags in versions
If the current HEAD is tagged, we'd like to use that tag as the version.
We remove a 'v' prefix, so that v1.0 -> 1.0
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>