| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Rather than always using the default prefix, we should determine it from
the location of the grub2 config file.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
In an upcoming change, we'll populate $prefix (which is used to locate
the environment file) based on the location of the config file, so these
paths will need to be consistent.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Implement -s and -f checks for grub, and test with the standard GRUB2
saved_default config.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The patch that went upstream for udhcpc's option 209 handling uses the
option name 'pxeconffile' rather than 'conffile', and it was added as a
non-default option:
http://git.busybox.net/busybox/commit/?id=d3092c99ae90f
This change uses the new name, and explicilty requests this option.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
On client connect, send a PB_PROTOCOL_ACTION_CONFIG message.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
This change groups the offsetof, container_of and ARRAY_SIZE macros in a
single header file util/util.h.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
| |
Adding new cases to the pxe parser code of having conffile file without
complete URL and determining conffile names using mac and ip addresses
passed from the udhcpc.
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
Update the parser test code/cases as per new prototyping of parse()
function which doesn't require buf and len to be passed from the caller,
instead reading the configuration data either embedded or from file to
a parser's known conffile.
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a new function parser_request_url() to read the data from
configuration files present remotely. We deprecate
iterate_parser_files() and download_config() functions along with the
'filenames' and 'method' members of the 'parser' structure so that
individual parsers would now require to request the configuration files
data from the parser code and doesn't necessarily export the list of
configuration files.
Add the support to handle incoming DHCP event, done by passing all the
relevant environment variables of the udhcpc to the discover code.
Also, update the pxe parser code to populate the list of configuration
file names as per PXELINUX convention of fallback names using mac and ip
addresses of the booting machine.
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
| |
Currently, once the boot() function is called, the boot process will
ignore any cancellations.
This change allows boot() to be cancelled, via boot_cancel().
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
We want to test grub2's save_env command, which requires a new function
to check the contents of a file.
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
We may as well show the logs while 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>
|
|
|
|
|
|
| |
We need to escape any double-quotes.
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>
|
|
|
|
|
|
|
| |
Update check_boot_option_count to check if a parser returned more than
one boot option with is_default set.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, we pass "events" between the udev, user-event and
device-handler layers. These events all get sent through
device_handler_event, then de-multiplexed to an appropriate handler,
depending on their source.
Instead, just export relevant device_handler functions, and have the
(old) event sources call these functions directly.
This also means we can include a lot more of the device hander code in
the parser tests.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
Rather than exposing log internals (through always_flush and
set_stream), do all logging init through pb_log_init(). If pb_log_init()
hasn't been called, pb_log will drop messages.
Also, add a pb_debug() function, specifically for debugging information.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
If we didn't find any valid boot options in the pxe buffer, we'll call
discover_context_add_boot_option with a NULL boot option.
This change adds a check before we try to add the boot option, and a
test to verify this situation.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
Check the overriding of 'partition' directive from yaboot conf file for
'petitboot', then verify the device name on which the resource resides
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
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>
|
|
|
|
|
|
| |
We need to provide the dry_run argument.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Add an --enable-test-valgrind argument to configure, to run all tests
under valgrind, configured to fail on leaked memory
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
.. so we can free at exit
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A couple of fixes for yaboot's device-handling code. Firstly, we need to
use 'device=' rather than 'root=', as the latter is purely for ybin, to
define where the yaboot binary goes.
Secondly, we need to respect global and option-specific device=
parameters. To do this, we keep all boot_image and initrd strings in the
state, and create the actual resources in yaboot_finish.
Add a test for all override cases, and fix the incorrect boot= parsing
in the rh8 test.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
All of the image options should be overridable by global options.
Instead of building the boot_args during yaboot_process_pair, we add
discovered data into the state struct, then create the boot args from
this data during yaboot_finish
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>
|
|
|
|
| |
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
|
|
|
| |
Add a couple of tests to verify the pxe parser, particularly the
different styles of initrd handling.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
Add a check for external URL resources.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
For non-local parsers (ie, PXE), we need to have the conf_url set. This
change adds a function to provide the originating URL.
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>
|