| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change adds a function to the parser API:
int parser_check_dir(struct discover_context *ctx,
struct discover_device *dev, const char *dirname)
- which allows parsers to check for the presence of a directory (path of
'dirname') on the device ('dev'). We use this in the GRUB2 parser to
implement the `test -d` check.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
menuentries may perform arbitrary commands; we only want ones that
define a boot option.
This change doesn't add a boot option if we haven't seen at least a boot
image defined in the menuentry.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Since we support --id arguments on menuentries, add the corresponding
feature variable.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
No need to duplicate the environment-adding code in init_env, as we can
just use script_env_set.
Since script_env_set does its own talloc, we don't need to talloc our
strings here either.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
The de-facto PXELINUX standard specifies lowercase characters for the
MAC addresses, so change our reuqests to suit.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
We have a few incorrect checks for the exit status of a process; this
change adds a helper with the correct WIFEXITED && WEXITSTATUS==0 logic.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
Currently, we may report incorrect success when loading a URL, as we
only check the return value of process_run_sync() (and not the process
exit status itself) in load_process_to_local_file.
This fix adds a check to the synchronous load.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
udhcpc may pass the bootfile parameter as either $bootfile or
$boot_file, depending on whether the option is present in the BOOTP
header, or as a DHCP vendor option. We have code in pb-udhcpc to unify
this to $bootfile, but we only use the unified value in one of the user
events.
This change uses the correct value of bootfile, and fixes the check to
conditionally generate the explicit add event. We also need to update
the user-event code to use the right event parameter name.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change implements support for the DHCP "pathprefix" option. We use
the following logic:
- If pathprefix is present and a full URL, we base the config file
location on pathprefix + conffile
- If pathprefix is present but not a full URL, we use it as the path
component of the URL, and pick up the host from other parameters in
the DHCP response
- If no pathprefix is present, we determine the configuration prefix
from the DHCP bootfile parameter.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
Currently, user_event_parse_conf_url sets dc->conf_url if it detects we
have a full URL (rather than a base URL). This is a little too subtle,
so replace it with an explicit output parameter.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
Fix Petitboot's grub.cfg parser to handle --id=label argument to
menuentry, and use it (in preference to the option name) when looking
for a default option.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
We want to down the interfaces that we brought up, so hook up the
network_shutdown function to the discover exit path. Also, we only want
to down interfaces that we've configured, and exclude lo.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Busybox tftp doesn't support -V, so prints an error to stderr. We'll
only see the Busybox identifier if we capture stderr too.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
| |
The known_names list only duplicates the arg matching we do in the body
of the parser, and so introduces a problem when the array becomes out of
sync.
We drop the priority of the "unknown name" messages to pb_debug, as this
isn't really imporant unless we're debugging.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
Currently, we have a bug where a 'known_name' that appears before an
image section will cause globals_done to be set, and we don't see any
further global variables.
This change sets globals_done only once we see an image section.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Rather than #defining _GNU_SOURCE in our .c files, we can define this
from config.h instead.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
This changes adds a 'link' parameter to the interface information sent
in sysinfo messages. The discover network code populates this from the
incoming netlink messages.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
yaboot configuration files with no option will cause an assertion
failure (or segfault), as we unconditionally call yaboot_finish().
Check for the presence of an option in yaboot_finish() instead of
asserting.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
| |
We're seeing a crash when boot hooks are specifying new resources, as
boot_hook_update_param will write to a NULL struct load_url_result.
Instead of writing the updated values to the struct, copy the local
parts of the result to a separate string, which the boot hooks are free
to update.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
In commit 823958fb, we change to use struct process, but left in the
check for rc == BOOT_HOOK_EXIT_UPDATE. We actually want to check
process->exit_status here, not rc.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
Partitions will share a serial number.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
YYLEX_PARAM is removed in bison 3.0, so we need to pass the scanner
param directly through yyparse (rather than referencing
parser->scanner). Unfortunately, we don't have the lexer header
available at the time we declare yyparse, so we need to pass a void *
here.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, we don't handle CDROM devices well; we'll try to mount on
boot, and not detect any media changes. Also, the default rules shipping
with udev will put the CDROM tray into a locked state, blocking eject
from working.
This change adds a set of cdrom utility functions, which the udev code
can use to properly initialise cdrom devices and handle eject and media
change requests.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
When we remove a device, some options may still be unresolved, and so
won't be deallocated through freeing the device.
This chagne explicitly removes & frees any currently-unresolved options
for this device.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
We're seeing a use-after-free, as the udev path is freed before the
discover device.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
Currently, we re-use a grub2 parser for different filenames, and will
create one even if we find no matching files.
This change only creates a parser if parser_request_file succeeds, and
free() (and exits the parse) immediately after.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
We only need to free the buf if parser_request_file returned success.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
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>
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
|
|
|
| |
We're getting warnings from some compilers about tempnam being unsafe.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
When the client sends us a PB_PROTOCOL_ACTION_CONFIG message, we want to
update the current config.
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>
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
We've been compiling with --enable-debug; this change fixes some
problems exposed by the optimiser.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|