| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
The discover client isn't currently associating boot options with their
devices. This change adds appropriate device list management.
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, changes to settings doesn't take effect while the discover
server is running. This means we need to reboot for any changes (eg, to
network settings) to take effect.
This change introduces a reinit path. Triggered by a configuration
update, this will cause the device handler to drop all of its devices
(and boot options), and restart the discovery process from the device
sources.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, the pb-discover main() function initialises the device
handler and the device sources.
We want to eventually be able to re-init the device sources, which will
be initiated by the handler. In this case, the handler will need
references to the sources.
This change moves the creation of the device sources to be internal to
the handler. This way, the device handler gets a reference to
everything, without having to pass pointers around in main().
We also remove the _destroy functions, as we handle everything through
talloc destructors, as all sources are parented to the handler. We also
change user_event_init and udev_init to take the handler as the first
('context') argument, to make them consistent with network_init.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
We don't need to error out of udev_handle_block_add if this is a
duplicate UUID.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, we have a bug where non-zero return codes from
udev_handle_dev_* cause the udev worker from deregistering from the
waiter poll loop. This is becasue udev_process is propagating these
errors, causing the deregistration.
This change stops propagation of non-fatal errors, so we don't
deregister.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
| |
Since we may be enumerating devices after enabling the udev monitor, we
may miss udev events that occur during this process.
This change increases the default udev buffer size.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
We often want to find out why a device has been skipped, so include the
SKIP messages at pb_log, which doesn't require a -DDEBUG build.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
| |
We used to use the mount binary to do filesystem autodetection. Since we
now know the fstype, we may as well call the mount syscall directly.
We add a log messages too, as we'll no longer get the 'running process:'
output from the process code, which is helpful is debugging discovery
issues.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, we don't hand any -t option to mount, as we expect the mount
binary to do autodetection of the filesystem type for us.
Turns out this isn't great with busybox mount, (which we're likely to be
using in petitboot builds), which implements "autodetection" by trying
the mount() syscall with every fs type in /proc/filesystems, until one
succeeds.
We expect a lot of the mount calls to fail, as we currently try to mount
everything (and abort discovery on devices that don't mount), including
non-filesystem partitions. On a test machine with 560 block devices, and
37 entries in /proc/partitions, this results in around 20,000 calls to
mount().
A better way would be to pass a -t option to mount. It turns out that
udev uses libblkid to probe the filesystem type, which is available in
the ID_FS_TYPE property. This change only attempts to mount filesystems
with this property, and passes an explicit fstype to the mount binary.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
The next-bootdev sysparam should only apply for the next boot, so
invalidate it after reading.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
We are appending the sysparam filename onto sysparams_dir, so we need a
trailing slash.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
To help debug boot priority issues, it'd be useful to include the
priority data in the configuration dump.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, we enumerate udev devices before setting up our monitor. This
means that we may lose devices that udev discovers after we start the
enumeration, but before the monitor is registered.
This change enables the monitor before enumeration, so we don't lose
devices. We add a filter to the enumeration code to only parse
completely initialised devices.
This means we may need to handle change events as the main source of
device notifications. We keep the existing CDROM event handler, but
check for new devices and handle those as an add.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
Currently, if the read-only mount fails during device discovery, we
retry without the '-o ro' option. This was originally due to the
read-only mount failing when a device was already mounted elsewhere.
Since we check for exsiting mounts now, we can drop this retry.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
We're incorrectly returning the name, we need the value.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
We'd like to trigger network device discovery from udev code, but most
of the device_add code path assumes block devices.
This change adds a subsystem check, and moves the block-specific code to
udev_handle_block_add.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
When adding new items to the petitboot menu, we need to ensure that the
scroll position of the menu includes the currently-selected item.
This change adds a call to set_top_row, calculated from the selected
item index, and the number of rows in the menu.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
Add tests to cover pxlinux-style configuration autodiscovery.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
PXELinux treats all paths as relative, requiring a "::/path" syntax for
truly absolute URLs.
This change implements the same behaviour in petitboot, and updates the
testcases to suit.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, if the bootfile doesn't contain a directory, the path we use
for config file resolution will use the bootfile as the first component
of path.
For example, if bootfile is:
pxelinux.0
the config files requested will be:
pxelinux.0/<mac>
pxelinux.0/<ips>
pxelinux.0/default
For cases where bootfile is a single file, we need to use a blank
prefix.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
The pxelinux project will perform autodiscovery by looking for files
under the pxelinux.cfg/ prefix (in addition to any pxepathprefix from
DHCP option 210)
This change unifies petitboot's behaviour with pxelinux.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We currently have a bug where we write NUL characters into
/etc/resolv.conf, when using static DNS server configurations:
With a network setting of: dns,9.0.6.11,9.0.7.1
We generate a resolv.conf containing:
nameserver 9.0.6.11^@nameserver 9.0.7.1^@
This is due to an off-by-one bug when terminating the nameserver
entries.
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 were missing a couple of the later hooks from the Makefile.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
This change is a small cleanup of the key bindings; we ensure that the
general key bindings are available (and documented) on all screens.
In order to keep things consistent, this change adds an initial UI
guidelines text file, which documents the general key bindings.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Add a textscreen-based help screen system, triggered from the cui
module's cui_show_help()
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
When we have a large chunk of text, we'll want to add it all in one go.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
We want to implement help screens, which are very similar to the sysinfo
screen - show a set of lines, and allow scrolling.
This change splits the text-screen rendering code into a new nc-textinfo
module.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
We call _post when the config screen is to be displayed, so do all
drawing here. This means we get the same drawing code on both init and
update.
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>
|
|
|
|
|
|
|
| |
Rather than the brief names for the boot editor field label, expand (and
capitalise) for a more-friendly form.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
| |
PowerPC OPAL firmware's sysparam interface allows us to read the boot
device set over IPMI. This change implements support for IPMI bootdev
selection over the sysparams interface, using the new boot_priority
infrastructure.
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>
|
|
|
|
|
|
|
| |
Allow a platform to specify a DHCP architecture ID, as this is
platform-specific.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
Currently, we're always assuming a powerpc platform, as the powerpc
probe() function always returns true.
This change adds a check for some bits we need to work on a powerpc
platform.
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>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
| |
GRUB2 syntax allows for for-loops; this change adds supoprt in the
parser grammar and script execution code to implement them. In the
execution code, we simply update the for-loop variable and re-execute
the body statements.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to implement for-loops, we may need to evaluate the same chunk
of script more than once, and perform that evaluation in a different
context (particularly, with different environment variables).
Currently, the process_expansion code destroys the result of the
parse-tree (ie, the token list) when performing expansions. This means
that we can only perform the expansions once.
This change preserves the token list while creating the argv array. This
means that we can expand the list multiple times.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|