| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
If the boot image fails to load, we end up calling talloc_free on an
unitialised are of stack (boot_task.local_initrd).
Move the initialisers a little earlier, so we always NULL pointers
before potentially freeing.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
In the cleanup of yaboot option state, 3fb8fb6fb, we change from
checking opt->boot_image to opt, to indicate that we're parsing an image
section.
We missed one check, which is causing a segfault due to the null opt.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Add new routine config_set_autoboot(), and use it to set
the --no-autoboot option.
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
|
|
|
| |
Add the command line option --no-autoboot to pb-discover
and update the pb-discover manpage.
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
| |
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
|
|
|
| |
Rename default_enabled to autoboot_enabled for consistency
with pb-config.
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
| |
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
| |
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, load_url took a char * argument, from which it parsed a
newly allocated URL, and freed the URL before returning.
Commit 5be946c changed load_url (then load_file) to accept a parsed URL
instead of a char *, but didn't remove the free. Any URLs passed to
load_url are currently being unintionally free()ed.
This change removes the invalid free.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
We may see initrds specified on the kernel argument line, or as their
own configuration directive.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
Abort the pair parse if we don't have both a name and a value.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the Makfile.am relocatable output files from automake _LIBRARIES
to automake _PROGRAMS. Also, change the output file name extension
from .o to .ro to better show these are relocatable files.
Fixes automake warnings like these:
discover/Makefile.am: `libparser.o' is not a standard library name
discover/Makefile.am: did you mean `libparser.a'?
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
|
|
|
| |
By exiting with status == 2, boot hooks can update boot data by
printing name=value to stdout.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
We're not accounting for the action in the event header (only the device
string) when we pass the length of param data to event_parse_params.
This means we walk past the end of the event data while parsing params.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
Add a method of running pre-boot hooks. Executable files in
/etc/petitboot/boot.d/ are run (in order) before we start the boot
process.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
This keeps all the boot-specific details in one place.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
We'll need a sysconf dir to store the boot hooks.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Updates & fixes by Jeremy Kerr <jk@ozlabs.org>.
Signed-off-by: Geoff Levand <geoff@infradead.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 library for (name, value) configuration.
Different storage backends are allowed (although currently hardcoded to
powerpc nvram), and config is read-only at present.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
Useful for specifying defaults:
pb-event add@defaults name='Netboot' \
image=http://192.168.0.1/vmlinuz \
default
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Allow the default boot process to be cancelled, via a message with
action PB_PROTOCOL_ACTION_CANCEL_DEFAULT.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
When we see a boot option with is_default set, store it in the handler
and register a timeout waiter.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
If we're booting from a default option, we don't have a boot command.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
Send the boot options to the client in the order discovered. This
change is in follow up to inverting the order that the server
saves the options internally.
Signed-off-by: Geoff Levand <geoff@infradead.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>
|
|
|
|
|
|
|
| |
When a client disconnects, the read from the client's fd will return
EOF. We should destroy the client in this situation.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Now that we dynamically add parsers, we can use a list to
hold them. Also simplifies the test_run_parser() routine.
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
|
|
| |
Ubuntu uses the linux16 symbol in thier conf files for memory test entries.
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
|
|
| |
Grub2 menuentry entry text can use double or single quotes.
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
|
|
| |
Add a resource type for grub, allowing us to parse search parameters.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
Any other implementation of resources will need to resolve againsst
particular devices, so make resolve_devpath_against_device
publically-accessible, and rename to not be devpath-specific.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Remove some of the more noisy log messages, and add some information
pertinent to device resolution events.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
| |
This change moves some of the device-handler code into an #ifdef-ed
section, so we can easily drop the stuff that's not required for
testing.
Although the change is quite large, most of it is moving entire
functions around.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
Devices that have been added via the user path may not have a device
path. In this case, don't segfault in device_match_path, and break out
of mount_device early.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
| |
We should always be tallocing resources to a boot option context;
anything else (for example, the discover context) may have a different
lifetime.
In order to enforce this, we change the void *ctx argument to the
context_create functions to a struct discover_boot_option.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
conf_get_pair will read one-byte past the end of the conf buffer, so
always NUL-terminate.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
We're only picking up every second boot option.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
devnames are unique, and much shorter.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|