summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* discover/pxe: check for a valid boot option before addingJeremy Kerr2013-09-063-1/+22
| | | | | | | | | | 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>
* ui/ncurses: Allow both DEL and ^H to map to backspaceJeremy Kerr2013-09-061-0/+8
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/parser: add 'partition' directive overriding test for yaboot conf fileNeelesh Gupta2013-08-302-0/+34
| | | | | | | | 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>
* discover/yaboot-parser: Handle 'partition=' directive overrideNeelesh Gupta2013-08-301-4/+16
| | | | | | | | | | | | | | | In a yaboot conf file, we may see a device= directive that actually specifies a partition (eg, sda1) rather than the underlying block device (sda). If we then encounter a partition= directive, we don't handle the resolution of the partition correctly, as we simply append the partition number to the device= string. This change implements a smarter handling of the partition= directive, where we strip away any partition information from the device= parameter first. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test: add 'partition=directive' test for yaboot conf fileNeelesh Gupta2013-08-292-0/+34
| | | | | Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/lib: Implement process_init change in testcasesJeremy Kerr2013-08-296-6/+6
| | | | | | We need to provide the dry_run argument. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/process: handle EINTR from waitpidJeremy Kerr2013-08-201-2/+7
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/process: Add dry_run argument to process_initJeremy Kerr2013-08-206-6/+11
| | | | | | | Implement dry-run behaviour on the discover server by passing a bool to process_init. UIs don't need to support dry runs. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/process: replace pb_run_cmdJeremy Kerr2013-08-199-237/+115
| | | | | | | This change replaces the pb_run_cmd() function with proper usage of the process API. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/process: replace pb_run_cmd_pipeJeremy Kerr2013-08-197-138/+66
| | | | | | Replace pb_run_cmd_pipe with process_create / process_run_sync. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/lib: add process testsJeremy Kerr2013-08-197-4/+407
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/waiter: handle -EINTRJeremy Kerr2013-08-193-4/+7
| | | | | | | Now that we're handing non-fatal signals (i.e., SIGCHLD in the process lib), we need to gracefully handle -EINTR from poll(). Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/process: Add process helpersJeremy Kerr2013-08-193-0/+515
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We've grown-out of pb_run_cmd a little, as we have a number of different process types: boot(): - kexec: short-running process, run synchronously - boot hooks: short-running, run sync, need exit code & stdout network init: - interface configuration: short running, run sync - udhcp processes are long running, we may want completion, but doesn't block other actions downloads: - potentially long-running, block parse progress config nvram: - read: short running, can block, need stdout - write: short running, can block We'd like to introduce proper asynchronous processes, to allow config & boot-option downloads without blocking the discover server. This change introduces a new type for processes, 'struct process'. These structures are created with process_create, and run with process_run_sync or process_run_async. The latter reports completion through a callback member of struct process. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test: Add --enable-test-valgrindJeremy Kerr2013-08-192-0/+13
| | | | | | | 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>
* test/lib: Use talloc in list testJeremy Kerr2013-08-191-1/+8
| | | | | | .. so we can free at exit Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/lib: build with -DEBUGJeremy Kerr2013-08-191-3/+2
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/boot: talloc struct boot_taskJeremy Kerr2013-08-191-38/+34
| | | | | | | | | Rather than using the stack for struct boot_task, talloc one instead. This gives us a short-lived context (active for the boot() process only), and we don't need to use the externally-provided context directly. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: remove unused user_event_triggerJeremy Kerr2013-08-193-14/+0
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/waiter: remove waitset_destroyJeremy Kerr2013-08-193-7/+0
| | | | | | We can rely on the ctx free to destroy the waitset. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/waiter: talloc waiters from waitset contextJeremy Kerr2013-08-161-1/+1
| | | | | | | We can lose a reference to the first waiter allocated, as set->waiters may be NULL. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/waiter: fix talloc_realloc contextJeremy Kerr2013-08-161-1/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/waiter: merge time & io waiter init loopsJeremy Kerr2013-08-161-24/+22
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/waiter: move type-specific members to a unionJeremy Kerr2013-08-161-9/+13
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/file: Add sensible perms when using replace_fileJeremy Kerr2013-08-161-0/+3
| | | | | | Rather than no access at all, use a default of 0644. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/network: free buffers from resolv.conf updateJeremy Kerr2013-08-161-7/+8
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/network: fix incorrect nameserver directive in resolv.confJeremy Kerr2013-08-161-1/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* network: handle DNS configJeremy Kerr2013-08-083-2/+61
| | | | | | If we have a dns config option, update resolv.conf Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/file: Add replace_file()Jeremy Kerr2013-08-082-0/+44
| | | | | | Add a function to atomically replace a file. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: separate file-reading code into file.cJeremy Kerr2013-08-084-53/+103
| | | | | | | We'll need to read files in the network config code, so add a 'file' object, containing the read_file function. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: remove libparser objectJeremy Kerr2013-08-081-21/+14
| | | | | | | | There's no real need for a separate libparser object. Our tests pull-in the parsers directly, and the discover server is the only thing that actually links to libparser.ro. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* config: DNS configuration isn't interface-specificJeremy Kerr2013-08-083-8/+31
| | | | | | | | | Rather than attaching DNS configuration to an interface, separate it out into general network config. The powerpc-nvram storage exepects dns as a "dns,server,..." string. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* config: Split interface configuration from network configurationJeremy Kerr2013-08-085-64/+66
| | | | | | | | This change moves the interface configuration into its own 'struct interface_config'. We also remove the _config suffix from the network and interface members. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/yaboot: implement default optionsJeremy Kerr2013-08-075-0/+54
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/yaboot: fix device parsingJeremy Kerr2013-08-074-76/+154
| | | | | | | | | | | | | | | 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>
* discover/yaboot: Allow all image options to be overridden by global optionsJeremy Kerr2013-08-073-29/+109
| | | | | | | | | | 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>
* discover: fix segfault on failed boot image loadJeremy Kerr2013-08-011-2/+3
| | | | | | | | | | 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>
* parser/yaboot: Fix check for image presenceJeremy Kerr2013-07-313-1/+34
| | | | | | | | | | 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>
* discover: Hookup --no-autoboot to configGeoff Levand2013-07-233-2/+14
| | | | | | | Add new routine config_set_autoboot(), and use it to set the --no-autoboot option. Signed-off-by: Geoff Levand <geoff@infradead.org>
* discover: Add --no-autoboot optionGeoff Levand2013-07-232-3/+37
| | | | | | | Add the command line option --no-autoboot to pb-discover and update the pb-discover manpage. Signed-off-by: Geoff Levand <geoff@infradead.org>
* discover: Log autoboot timeoutGeoff Levand2013-07-231-3/+5
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* discover: Rename default_enabledGeoff Levand2013-07-231-4/+4
| | | | | | | Rename default_enabled to autoboot_enabled for consistency with pb-config. Signed-off-by: Geoff Levand <geoff@infradead.org>
* discover: Add grub.cfg path for openSUSEGeoff Levand2013-07-231-0/+1
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* configure: Update to use AX_WITH_CURSESGeoff Levand2013-07-2311-32/+64
| | | | | | | | | | | For a more portable build system convert to using the autoconf-archive AX_WITH_CURSES macros. Allows building on openSUSE, which has a different header file layout than other distros, and fixes menu entries with UTF-8 characters; this causes fedora installs (codename "Schrödinger´s cat") to break the UI. Signed-off-by: Geoff Levand <geoff@infradead.org>
* automake: Add $(EXEEXT) to .ro objectsGeoff Levand2013-07-232-2/+2
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* ui/ncurses: Add setlocale callJeremy Kerr2013-07-231-0/+3
| | | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
* discover: Don't free URL in load_urlJeremy Kerr2013-07-231-1/+0
| | | | | | | | | | | | | 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>
* pb-udhcp: Fix MAC-address-based configuration file locationJeremy Kerr2013-07-231-2/+2
| | | | | | | | We're currently requesting a colon-separated MAC address. Instead, we need it to be hypen-separated, and prefixed with the ethernet type ("01-"). Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* pb-udhcp: PXE fixesJeremy Kerr2013-07-231-5/+5
| | | | | | Fix a couple of bugs in the udhcp script. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/waiter: Defer free of removed waitersJeremy Kerr2013-07-231-3/+27
| | | | | | | | | We may end up calling remove()-d time waiters if the timeout expires as we're processing an IO waiter. Instead of freeing the waiter in waiter_remove, mark the waiter as inactive, and defer the free until the end of waiter_poll(). Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/pxe: remove debug statementJeremy Kerr2013-07-231-1/+0
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud