| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
If config_set fails, we don't want to send the failed config out to
clients.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
We don't want the version to be extracted from a higher-level git
directory.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
This change implement load & save support for the default boot device
configuration parameter.
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 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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
We have an unnecessary semicolon on an empty for-loop, which causes a
clang warning.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change includes a few fixes to the version.sh script, in order to
unify the versions generated from git vs. dev- versions. We unify on a
simple YYYYMMDD format, and drop the time specifier (if you're relying
on time info, you probably have the git SHAs to lookup from instead).
We also clean up the date-generation code, by using printf's %T
formatter, on git's %ct time specification, rather than trying to
transform a %ci date.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The standard way to regenerate the autotools bits is with 'autoreconf',
but that doesn't work with our custom bootstrap script. We only need the
bootstrap script to generate the version in configure.ac, which we can
easily do with m4_esyscmd_s instead.
This change allows autoreconfiguration with `autoreconf -f -i`.
Includes changes proposed by Yann E. Morin <yann.morin.1998@free.fr>,
and modifications from the original patch from
Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Jeff Bailey <jeffbailey@google.com>
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>
|
|
|
|
|
|
|
|
|
|
| |
Currently, we start udhcpc with the '-n' argument, which means they'll
exit if no lease is obtained.
We'd prefer to leave the DHCP client running, so that any
slow-to-initialise links are not left deconfigured.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
| |
Although we need nvram to save settings, we may be running on a
nvram-less machine, but still need to detect as powerpc.
This change removes the nvram check.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
If we don't have a platform defined, we generate an invalid uchdpc
command, as we've NULL-ed out the interface name.
This change fixes the no-platform case to terminate *after* the
interface name.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, we have a bug when parsing zero-length files: we subtract one
from the length to exclude the trailing NUL (added by read_file), but a
zero-length file will result in a length of -1.
This change adds an explicit exit if we're attempting to parse an empty
file.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
When DEBUG is undefed, we run out of wget arguments for loading https
URLs. We need an extra element in the argv array to handle all possible
arguments.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, we have a bug when a boot task with more than one load tasks
is cancelled:
1) boot_cancel calls cleanup_cancellations, which performs a
load_url_async_cancel on all load tasks. This sets the load tasks'
states to LOAD_CANCELLED, and signals associated processes.
2) The first load task process completes, we get a load_url_process_exit
callback. This then invokes cleanup_cancellations.
3) cleanup_cancellations then (incorrectly) frees the boot task (and
hence freeing all pending load tasks) as no load tasks are in LOAD_ASYNC
state (we set them all to LOAD_CANCELLED in step 1)
4) The actual completion for the second load task attempts to reference
the now-freed task structure.
This change fixes the issue by handing the LOAD_CANCELLED state properly
- if we find a load task in this state, we consider the boot task still
pending, and delay the free until all loads are complete.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
For local consoles, we always want a TERM=linux.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
We need to check for equality with opt_yes, not just check for non-zero.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
| |
The yaboot.conf format is essentially the same format as silo.conf and
lilo.conf, especially if the author isn't using OF paths. This is a
cheap way of getting support for silo and lilo.
Signed-off-by: Jeff Bailey <jeffbailey@google.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
We're seeing occasionaly failures to autoboot due to supirious key
events (getch() returing -1) on an IPMI console.
This change modifies the process_key logic to only abort the default if
we see a valid key event.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
A NULL return can mean the list is empty; don't return a failure from
this case.
udev_list_entry_foreach does a check for a NULL entry, so we'll do the
correct thing in the following loop.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
| |
If the udev monitor or enumerate functions fail, we'll call the
udev_unref and udev_monitor_unref functions twice: once in the cleanup
path and once in the talloc destructor.
This change moves all cleanup to the talloc destructor, so we only do
the unrefs once.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Petitboot environments will probably want a basic terminfo defintion
(eg, vt220) rather than a full linux or xterm, but vt220 and friends
don't define a backtab key. Backtab can be useful for proper form
navigation, and without a key definition, we just get an escape, which
exits the current screen.
This change provides a static definition for KEY_BTAB, so we should
always have one available.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fields without O_STATIC can "scroll" horizontally, and we may miss a
left-hand section of text from the current display. This can mean that
the user can't leave a validated field with no indication why, if the
off-to-the-left data is not a valid entry.
This change adds a widgetset function to mark a field as fixed-size, so
we don't have this scrolling behaviour. This means that the entire field
contents will always be visible, and any validation errors can be seen.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We get a couple of uninitialised var warning when compiling with certain
CFLAGS (-fprofile-arcs -ftest-coverage at this stage).
In statement_if_execute: We'll never actually use this uninitialised (as
there must be at least one conditional in the parsed statement), but we
should address the warning nonetheless.
As passed to strtok_r: strtok will initialise this, but it isn't obvious
to the compiler.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ncurses' new_item() expects the name parameter to be a "printable
string", by converting it to a wchar *, and checking that each character
is printable with iswprint(). If it fails, we won't see a boot option at
all.
This change introduces a function to convert the label into something we
know is printable, and valid UTF-8. If mbstowcs fails, we replace it
with a generic 'Invalid option' label. If we encounter a valid multibyte
string with unprintable characters, we replace those with U+fffd
REPLACEMENT CHARACTER.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
We're not freeing the discover_client on exit, as it's not attached to
any existing talloc context.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
We need to unpost the menu so that free_item can actually free the item.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
Currently, pemnu_destroy is used to free items. This means that the menu
code needs to iterate over items, and we have no way to free the ITEM *
of items that aren't in a menu.
Instead, free the ITEM in the pmenu_item destructor.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, the menu item creation is has two main functions:
pmenu_item_alloc and pmenu_item_setup. The latter does initialisation
(it sets item->name), and inserts the item into the menu. We have
pmenu_item_init to combine this into one, but that means we need to do
further initialisation (eg, to set on_execute) after the item has been
added to the menu.
Instead, this change use a more direct _create and _insert interface.
Create does the allocation and initialisation, while _insert does the
actual insertion.
This means new_item failures will be detected at creation time, rather
than during pmenu_insert. Also, we're now insert a completely-populated
item into the menu, rather than populating on_edit, on_execute and data
after insertion.
Because we can detect errors from creation (ie, from new_item failing),
we add handling code to cui_boot_option_add and cui_boot_editor_on_exit.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
The menu offsets are arbitrary, use a separate numbering scheme for user
items.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
... as nothing uses it.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently pmenu_item_setup may free its item parameter on error.
This makes it non-obvious whether the item is still allocated on exit to
the caller.
Instead, this change removes the talloc_free, and requires that the
caller do this on error. This makes the potential use-after-free in
cui_boot_editor_on_exit obvious, so we fix that too.
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 have a bug where newly-configured DNS servers are appended
to the existing set of servers, rather than replacing them.
This change clears the existing servers out before adding the
newly-configured ones.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|