| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
We'd like a way to cancel pending loads, as part of aborting the boot
process.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
Allow URL-format specifiers for GRUB2 resources.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
Only call find_boot_option_by_id if we have an ID.
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 little infrastructure for communicating information about the
system to the petitboot UIs. We just send some identifying info (type
and identifier), as well as the interfaces.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
The property strings are managed by the udev code, so we need to strdup.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
We need to do the rmdir after clearing mount_path.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
Change f611bde3 shifted the config_init until after process_init, as we
need to run processes during config init. We also needed to move the
config_set_autoboot invocation too.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
| |
Valgrind reports an invalid usage of an uninitialised var in yyerror,
causing testcase failures.
Initialise lineno before we start parsing.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Use the new parser_request_file API to access the GRUB environment
block.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Use a copy of the name & value pairs that we pass to the environment, as
the data loaded from load_env will be talloc_free-ed.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
Add a pair of functions to the parser API to allow write access to the
underlying device. We'll use this in the GRUB2 parser to implement
environment persistence.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
Add a function to allow parsers to access files on a local device.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
We have parsers passing discover_contexts around, which we want to hook
into the test framework. Add a void * member, which the test code can
use to reference the test.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Check the return value from mount_device and abort the discover on
failure.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
| |
When we start the discover server, we may find that devices are already
mounted. In this case, mount_device will fail, and we'll abort the
parse.
This change uses /proc/self/mounts to check if new devices are already
mounted, and uses the existing mount point.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Rather than printf() & exit(), use the pb logging functions and abort
the parse.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
The URL needs to share the lifetime of resource, so talloc_steal it in
create_url_resource.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
Make the error case for local files the same as for remotes.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
Now that we can download asynchronously, we can download boot resources
in parallel. This also means we don't need a state machine; we're either
not done (loads are still pending) or done.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, load_url and load_url_async return a filename parameter and a
tempfile flag (indicating whether the file needs to be cleaned after
use).
Instead, encapsulate this data in a struct load_url_result, which the
caller (and async callbacks) can read the status, filename and clean
parameters.
For internal use in load_url and helpers, we add a struct load_task to
hold a pointer to the load_url_result and async data.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
Rather than always trying both TFTP client types, do a runtime detection
on first invocation. This can be fixed at build-time with
--with-tftp=TYPE.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
... otherwise we won't clean up local files from earlier boot stages.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Use the status argument to the URL load callback to check for load
failures.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
We don't need a pointer here, just the status value.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current boot process handled by boot() function is implemented such
that it blocks on the boot resources being downloaded which blocks
the discover process until the download completes. This patch
re-implements the boot() function using callback mechanism and
asynchronous notifications so that boot() returns to continue the
discover process while the download is in progress.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
A new load_url_async() function handles retrieving the resources by
forking an external process which currently blocks the parent waiting
for the process to complete. This patch modifies the load_*() functions
to handle it asynchronously by providing the exit callback and returning
without waiting for the child process to exit.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
| |
If we have multipath devices present in the system, we'll end up with
duplicate mounts, parse results and boot options. This change adds a
check to see if we've encountered a device with this serial number
previously.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
We want to allow assignments outside of the 'set' builtin.
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>
|
|
|
|
|
|
|
|
|
|
|
| |
Putting an if-statement on one line should be possible:
if true; then echo "true"; else echo "false"; fi
To do this, we'll need to allow both EOLs and TOKEN_DELIM after then and
else.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
A faily simple implementation now, and could do with some testing...
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>
|
|
|
|
|
|
| |
Files may not have a trailing newline.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
For better trace output.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Remove '#' from the list of word chars. Also, don't need the '$' char in
the comment regex
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Rather than just having one conditional in an if statement, we use a
list of conditionals instead. This allows us to implement elif.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
Rather than holding the condition and conditional-statements in struct
grub2_statment_if, create a new conditional type that contains these. We
can then use this to implement elif statements.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
Re-arrange the script/statements parse rules to allow empty statements.
We also move the EOL token out of the 'statement' definition, and use
it to separate 'statements'.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|