| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
| |
libdevmapper is a hard dependency since snapshots were introduced, so
add an unconditional configure-time check for it.
Also add a check for libflash library and headers if --enable-mtd is
set.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The assert() statement in fold_text() only evaluates in a debug build.
If mbrtowc() encounters an error return the portion of the string that
has been parsed and stop.
This avoids an issue with glibc 2.22 where previous calls to
setlocale() failed and set an unsuitable locale. Since the error was not
caught this resulted in an infinite loop when trying to access the
Language screen.
Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
|
|
|
|
| |
Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
When queried libflash will return the 'first' flash side (ie. the one
with the lowest TOC address), however we label this the 'Current' side
which is incorrect if the machine has booted from the alternate side.
A future fix will inlcude additional platform logic to determine which
flash side is current; in the interim label the first flash side as
'Primary' instead of 'Current'.
Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
|
|
|
|
|
|
|
|
| |
On BMC machines the "Get Device ID" and "Get BMC Golden Side Version"
IPMI commands are available. If possible retrieve some interesting
version numbers and display them in the System Information screen.
Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
|
|
|
|
|
|
|
|
|
|
| |
On supported platforms read the VERSION partition on startup and display
the available versions strings in the System Information screen.
This adds a skeleton hostboot.c to support possible additional BMC
platform support.
Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add basic libflash support to read the VERSION partition on BMC
machines. This adds a dependency on the libflash shared library from
Skiboot.
The MTD partition is accessed through the libflash helper functions.
Once read into a buffer, the VERSION partition is a simple list of
newline-terminated version strings. Some BMC platforms may have two
'sides' to flash - these are interpreted as the "current" and "other"
sides depending on which one the current Petitboot is running from.
Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
|
|
|
|
| |
Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
|
|
|
|
|
|
| |
Fixes Coverity defect #30486
Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Fixes Coverity defects #30485 and #30486
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
|
|
|
|
|
|
| |
Useful for identifying the initial BMC traffic on the network.
Signed-off-by: Jack Miller <jack@codezen.org>
|
|
|
|
|
|
|
| |
Instead of using 'Optical' in some places and 'CD/DVD' in others, simply
use 'CD/DVD' for all cases.
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
|
|
|
|
|
|
|
|
| |
Users may want to prioritise USB-attached storage devices differently to
other devices. Detect if a device is USB-attached and add a new device
type to identify it.
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
|
|
|
|
|
|
| |
Make the strncols() helper available generally to i18n-concerned code.
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
|
|
|
|
|
|
|
|
| |
Commit 9781a370 ("Handle mblen return code when n is zero.") in glibc
changes the return value for when the number of bytes ('n') is zero.
Add an extra condition to detect if we've reached the end of the buffer.
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
|
|
|
|
|
|
|
| |
Add a debug-style nvram parameter to disallow the use of device-mapper
snapshots.
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
|
|
|
|
|
|
|
|
| |
Create a new Petitboot option 'petitboot,write?' that specifies whether
the system is allowed to mount devices read-write. The option can be
toggled by the user in the nc-config screen.
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
If a default device is set, we only allow booting from that device.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We need a couple of automake options to prevent errors when regenerating
Makefile.ins during source preparation.
Some makefiles assume GNU make, so add 'foreign' where necessary. Also,
we are building objects in subdirectories, so we need 'subdir-objects'.
Modified to suit recent petitboot by Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Jeff Bailey <jeffbailey@google.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit aa530148 introduced a priority member to struct boot_priority,
but didn't update the protocol deserialise function to properly decode
config messages. This meant we were leaving half of the struct
uninitialised, and getting invalid values in the initialised part.
This change updates the config deserialise function to do proper
handling for boot priority data.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, we need to compile with -DDEBUG to implement debug-level
logging in the UIs and discover server.
Since we may not be able to easily replace a system's petitboot
binaries, this change introduces a -v|--verbose option to the discver
server and ncurses UI, which enables debug at runtime. We also move some
of the udev debug code out of an #ifdef DEBUG block.
Since petitboot is generally started on boot, we also add a little
infrastructure to pass -v to petitboot on certain system contitions:
either petitboot.debug on the kernel command line, or a petitboot,debug?
NVRAM property containing the value 'true'.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Now that we can re-initialise the device handler, allow this to be
triggered from UIs over the petitboot protocol.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If our read() of the process stdout pipe fails with EINTR (eg, if we
receive a SIGCHLD because the process exited), then
process_read_stdout_once will return a non-zero exit code, and we'll
abort any further stdout collection.
Instead, we should check for EINTR, and allow the reads to continue.
This change normalises the return value from process_read_stdout_once to
return positive on success, negative on failure, and zero on competion.
We use a positive return value for the non-error EINTR case.
Also, add a pb_log if the read fails for non-EINTR reasons.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
We want to fold help text into the ncurses UI, so add a little module to
split text into lines.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
Currently, If we want disable all but a specific device type from
default boot, we need to add a negative priority for all other devices.
This change adds a DEVICE_TYPE_ANY definition, to allow a simpler way to
express "only boot a specific type" by default behaviour.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rather than rely on the ordering of the boot_priorities array to define
which device types have a higher "default boot" priority, this change
introduces a slightly more flexible way of priority lookups, by adding a
separate priority field to struct boot_priority.
This means we can have an unordered array, change priorities without
re-writing the array, and implementing a disable mechanism.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There's no need to include the config storage code in lib/ as only the
discover server should be using it.
This change moves the config-storage code to discover/, with the
platform-specific parts moved to a 'struct platform'. Each platform has
a probe function, which is called during init. The first probe function
to return a platform is used.
At present we only have the one platform, but it's now non-intrusive to
add others.
We keep an array of platform pointers in a separate ("platforms")
section, to allow the test module to drop-in its own test "platform".
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
At the moment, UIs have the config_set_defaults function to estabilish
an initial configuration when performing an update.
Rather than using the defaults, this change provides a config_copy()
function, so that the updated configuration can be initialised from the
current config.
With this in place, the UI/server-common pb-config module can be reduced
to just the one function.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, we don't update nvram if an NVRAM parameter is set to the
default. This means we can never revert a configuration to its default
value.
This change fixes the default setting behaviour; instead of checking for
a default, we want to check if it's a default and the option is absent.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
We have a few incorrect checks for the exit status of a process; this
change adds a helper with the correct WIFEXITED && WEXITSTATUS==0 logic.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
For some process execution functions, we'd like to capture stderr as
well as stdout. Currently, we unconditionally redirect subprocess stderr
to the petitboot log file.
This change adds an add_stderr flag to struct process, which indicates
to the process library that we want stderr as well as stdout. If this is
specified, the subprocess' stderr is captured to stdout_buf.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, we have a bug when setting the default network configuration
(ie, no devices have any specific config), as we won't call
update_network_config to clear out the value of the petitboot,network
parameter.
This change always invokes update_network_config, regardless of the
number of interfaces configured. This ensures we clear out the
petitboot,network param, which is then synced to nvram if the param has
changed.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Rather than #defining _GNU_SOURCE in our .c files, we can define this
from config.h instead.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|