summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* utils: Add busybox reboot scriptJeremy Kerr2013-06-242-0/+4
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/boot: Add boot hooksJeremy Kerr2013-06-241-0/+63
| | | | | | | | 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>
* discover/boot: Put all boot params into a struct boot_taskJeremy Kerr2013-06-241-38/+43
| | | | | | This keeps all the boot-specific details in one place. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add pkgsysconfdirJeremy Kerr2013-06-242-0/+4
| | | | | | We'll need a sysconf dir to store the boot hooks. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add initial dtb supportGeoff Levand2013-06-2412-19/+101
| | | | | | | Updates & fixes by Jeremy Kerr <jk@ozlabs.org>. Signed-off-by: Geoff Levand <geoff@infradead.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: bring network interfaces down in network_shutdownJeremy Kerr2013-06-241-3/+24
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Add network handlingJeremy Kerr2013-06-247-0/+451
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib: Add pb-config moduleJeremy Kerr2013-06-248-0/+545
| | | | | | | | | 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>
* discover: Add logging for default boot option behaviourJeremy Kerr2013-06-241-0/+6
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/event: Allow empty param valuesJeremy Kerr2013-06-241-9/+11
| | | | | | | | | | 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>
* ui/ncurses: Add cancel-default reportingJeremy Kerr2013-06-244-78/+6
| | | | | | | | | When we first see key input, we can tell the discover server to cancel the default boot. Untested on ps3. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/common: Add code to send cancel-default messagesJeremy Kerr2013-06-242-0/+17
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui: implement timers with waitsetsJeremy Kerr2013-06-245-91/+21
| | | | | | | A temporary change to the timers; we'll eventually remove these from the ui code. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Add "cancel default boot" messagesJeremy Kerr2013-06-244-9/+50
| | | | | | | 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>
* discover/event: Allow user events to be defaultsJeremy Kerr2013-06-241-0/+3
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Add countdown before default bootJeremy Kerr2013-06-241-3/+31
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: implement default bootingJeremy Kerr2013-06-244-14/+52
| | | | | | | 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>
* discover/boot: Allow null boot commandJeremy Kerr2013-06-241-3/+3
| | | | | | If we're booting from a default option, we don't have a boot command. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/waiter: Add timeout waitersJeremy Kerr2013-06-248-45/+159
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Add default option parsingJeremy Kerr2013-06-241-1/+39
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/test: print default status of boot optionsJeremy Kerr2013-06-241-0/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* types: Add is_default to struct boot_optionJeremy Kerr2013-06-242-1/+12
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* autotools: Fix make maintainer-cleanGeoff Levand2013-05-293-323/+4
| | | | | | Fixes to make maintainer-clean work properly. Signed-off-by: Geoff Levand <geoff@infradead.org>
* test/parser: Remove gawk specificsGeoff Levand2013-05-292-2/+2
| | | | | | | Remove the GNU awk specifics to allow the use of a standard awk program. Fixes build errors on older distros. Signed-off-by: Geoff Levand <geoff@infradead.org>
* discover: Send options to client in orderGeoff Levand2013-05-211-2/+2
| | | | | | | | 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>
* discover/grub2: remove uuid log messageJeremy Kerr2013-05-211-1/+0
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/test: Add boot status messages to test clientJeremy Kerr2013-05-211-0/+12
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: implement global keysJeremy Kerr2013-05-211-0/+16
| | | | | | | Add process_global_keys to handle global key events. Using this, implement ctrl+l to refresh. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: move getch() out of process_key callbacksJeremy Kerr2013-05-215-127/+116
| | | | | | | | All process_key callbacks will want to query the key that was pressed, so do the getch() once in cui_process_key, and pass the result to the callback. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/waiter: Ensure waiters are consistent during waiter_pollJeremy Kerr2013-05-211-19/+43
| | | | | | | | | | | | | | | | We have a bug at the moment: if the waitset's->waiters array is updated duing waiter_poll() (eg, a client connection is closed, and the client's callback performs a waiter_remove()), then we may invoke callbacks for incorrect waiters. This change uses a consistent waiters array duing execution of waiter_poll, so that any pollfds returned from poll() will result in correct callback invocations. This assumes that a waiter will only ever remove *itself* from the waitset; otherwise, we may call a free()ed waiter. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/waiter: allocate waiters separately from set->waitersJeremy Kerr2013-05-211-13/+22
| | | | | | | | | | Since we reallocate set->waiters, we can't hand out pointers to within that array. Instead, this change allocates the 'struct waiter's separately from the set->waiters array. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: fix error handling from failed client writesJeremy Kerr2013-05-211-4/+9
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Fix accept() return value checkJeremy Kerr2013-05-211-1/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: destroy client if message read failedJeremy Kerr2013-05-211-4/+11
| | | | | | | 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>
* utils/pb-console: use getty rather than execJeremy Kerr2013-05-201-31/+58
| | | | | | exec is a bit flaky for starting on consoles, so use getty instead. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* utils/pbconsole: Use here-document for usage textJeremy Kerr2013-05-201-6/+8
| | | | | | Allows for cleaner usage message in the source. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/parser: cleanup parser allocations on exitJeremy Kerr2013-05-201-0/+8
| | | | | | | | | | | | | | | | | | | | | | | We should talloc_free the parser list once we're done, enabling valgrind's leak check. Before: [jk@pablo parser]$ valgrind ./test-null ... ==9330== HEAP SUMMARY: ==9330== in use at exit: 288 bytes in 3 blocks ==9330== total heap usage: 11 allocs, 8 frees, 1,177 bytes allocated After: [jk@pablo parser]$ valgrind ./test-null ... ==9940== HEAP SUMMARY: ==9940== in use at exit: 0 bytes in 0 blocks ==9940== total heap usage: 11 allocs, 11 frees, 1,177 bytes allocated ==9940== ==9940== All heap blocks were freed -- no leaks are possible Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* util/pb-console: Packaging updatesGeoff Levand2013-05-193-3/+56
| | | | | | | In preparation for packaging add a man page, a help option, and some comments to the script. Signed-off-by: Geoff Levand <geoff@infradead.org>
* test/parser: Add check_not_present_resourceGeoff Levand2013-05-184-0/+23
| | | | | | | | | | | Add a new routine check_not_present_resource() to check that a resource is not present. This is typically used to check that an initrd entry has not been found. Also add any needed checks for no initrd to the existing tests. Signed-off-by: Geoff Levand <geoff@infradead.org>
* parser: Use list to hold parsersGeoff Levand2013-05-172-33/+37
| | | | | | | 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>
* test/parser: Add ubuntu grub testsGeoff Levand2013-05-173-0/+318
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* test/parser: Better message outputGeoff Levand2013-05-171-6/+7
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* parser/grub2: Add parse for linux16Geoff Levand2013-05-171-1/+2
| | | | | | Ubuntu uses the linux16 symbol in thier conf files for memory test entries. Signed-off-by: Geoff Levand <geoff@infradead.org>
* parser/grub2: Better menuentry parsingGeoff Levand2013-05-171-6/+1
| | | | | | Grub2 menuentry entry text can use double or single quotes. Signed-off-by: Geoff Levand <geoff@infradead.org>
* configure: Add check for libncursesGeoff Levand2013-05-161-1/+9
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* test/parser: Add grub2 multiple resolution testJeremy Kerr2013-05-162-0/+42
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: handle search commands to specify root filesystemsJeremy Kerr2013-05-162-9/+113
| | | | | | Add a resource type for grub, allowing us to parse search parameters. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/resource: Provide resolve_resource_against_deviceJeremy Kerr2013-05-162-6/+8
| | | | | | | | 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>
* discover: log cleanupJeremy Kerr2013-05-166-28/+26
| | | | | | | 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>
* test/parser: Add yaboot test from a ppc64 RH8 machineJeremy Kerr2013-05-163-2/+48
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud