summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ui/ncurses: Add basic config editorJeremy Kerr2013-11-148-3/+283
| | | | | | This change adds a simple configuration editor to the ncurses UI. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Receive config messagesJeremy Kerr2013-11-132-0/+8
| | | | | | We just store the config in the cui for now. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Use nc-widgets for boot editorJeremy Kerr2013-11-132-240/+75
| | | | | | | Now that we have a simple widget set available, use this for the boot editor. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add simple ncurses form widget setJeremy Kerr2013-11-133-1/+804
| | | | | | | | | We're doing a lot of the same stuff with forms, and we'll to implement a lot of fields with the upcoming configuration interface. This change introduces a simple ncurses widget set. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add sysinfo screenJeremy Kerr2013-11-138-8/+332
| | | | | | | | Add a simple screen for displaying the struct system_info. We add this to the main menu as a selectable option, and separate it from the boot option list with an unselectable blank entry. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses/scr: Add definition for frame offsetJeremy Kerr2013-11-132-1/+2
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: nc-menu.h needs assert.hJeremy Kerr2013-11-131-0/+2
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/common: Don't talloc_free sysinfo and status explicitlyJeremy Kerr2013-11-132-8/+21
| | | | | | | | | | | | | Currently, we talloc_free() the sysinfo and status messages in the discover client, right after performing the ui's callback. However, the client may wish to keep a reference to this information beyond the callback invocation. This change introduces a per-message talloc context, which these structures are allocated under. This allows the callbacks to talloc_steal() anything they wish to keep a reference to. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add nc_scr_{un,}post()Jeremy Kerr2013-11-134-11/+29
| | | | | | | We may have nc_scrs that aren't interested in post/unpost information, so create helper functions that allow a NULL callback. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Move general nc init code to cui moduleJeremy Kerr2013-11-133-35/+32
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Handle incoming configuration messagesJeremy Kerr2013-11-134-3/+26
| | | | | | | 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>
* config: Implement config messagesJeremy Kerr2013-11-135-0/+62
| | | | | | On client connect, send a PB_PROTOCOL_ACTION_CONFIG message. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/pb-protocol: Add serialise & deserialise for struct configJeremy Kerr2013-11-132-0/+209
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/types: use unsigned int for interface, dns and prio countsJeremy Kerr2013-11-135-9/+10
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib: Move config structure defitinitions to types.hJeremy Kerr2013-11-132-38/+37
| | | | | | | | We don't want to require the lib/pb-config interface in the UIs, just the structure defintions. This change moves them to the common types header. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/pb-config: Implement save method for test storageJeremy Kerr2013-11-131-3/+15
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/pb-config: Implement save method for powerpc nvram strorageJeremy Kerr2013-11-131-0/+179
| | | | | | Write values back to nvram. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/pb-config: Implement config_setJeremy Kerr2013-11-133-4/+36
| | | | | | | This change adds config_set, to allow the configuration to be updated, but calling the storage backend's save() method. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/util: Add build_assert()Jeremy Kerr2013-11-131-0/+3
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/util: Implement min & max macrosJeremy Kerr2013-11-131-0/+14
| | | | | | Standard type-safe min & max implementations. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib: consolidate util macros in util/util.hJeremy Kerr2013-11-139-23/+43
| | | | | | | 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>
* discover: Fix potentially-uninitialised variablesJeremy Kerr2013-11-133-1/+4
| | | | | | | We've been compiling with --enable-debug; this change fixes some problems exposed by the optimiser. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/parser: Add local PXE testJeremy Kerr2013-11-072-1/+20
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/parser: Add new test cases to pxe parserNeelesh Gupta2013-11-064-1/+121
| | | | | | | | | 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>
* test/parser: Update test cases as per new parser requesting conf filesNeelesh Gupta2013-11-0628-57/+125
| | | | | | | | | | 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>
* discover: Change parsers to explicitly request configuration filesNeelesh Gupta2013-11-0615-243/+428
| | | | | | | | | | | | | | | | | | | 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>
* lib/url: Export is_url() functionNeelesh Gupta2013-11-062-2/+4
| | | | | Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Allocate contexts with talloc_zeroJeremy Kerr2013-11-061-3/+1
| | | | | | Ensure all pointers from the context are NULL. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/log: Always flush after writing logsJeremy Kerr2013-11-011-2/+1
| | | | | | | | We're currently seeing empty log files from the discover server. Rather than only flishing if the server was compiled with debugging enabled, always perform the fflush. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* logging: Clean up debug logsJeremy Kerr2013-11-0117-65/+43
| | | | | | | We have quite a few pb_logs which should be pb_debug. This change moves developer-specific info to pb_debug. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/network: Allow for arbitrary-sized netlink messagesJeremy Kerr2013-11-011-5/+41
| | | | | | | | | | | Currently, we drop any netlink data beyond our 4096-byte buffer. This means that we can only parse a limited number of network interfaces. This change uses recvmsg with MSG_PEEK to determine the size of an incoming netlink message before doing the actual recvmsg. This way, we can realloc our buffer to suit. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/pb-config/powerpc-nvram: Use talloc_zero for interface configsJeremy Kerr2013-10-281-1/+1
| | | | | | | We're seeing a problem where ifconf->ignore isn't initialised; use talloc_zero instead. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/file: Fix invalid free in replace_fileJeremy Kerr2013-10-241-1/+1
| | | | | | We talloced tempfile, we should be freeing with talloc_free. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: cleanup allocated dataJeremy Kerr2013-10-211-0/+7
| | | | | | | We have a few allocations hanging around at the end of pb-discover; free them. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/file: Fix invalid free vs talloc_freeJeremy Kerr2013-10-211-1/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/network: Ensure dns config buffer contains a trailling nulJeremy Kerr2013-10-211-1/+2
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/parser: free parsers on exitJeremy Kerr2013-10-211-1/+12
| | | | | | Allocate parsers against a context, and free that context on exit. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/sysinfo: Fix talloc against uninitialised server varJeremy Kerr2013-10-211-1/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Clean lexer.[ch]Jeremy Kerr2013-10-211-1/+2
| | | | | | `make distcheck` fails with a couple of failes remaining after clean. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Don't free clients on write failureJeremy Kerr2013-10-151-5/+8
| | | | | | | | | | | | | | Currently, if we see an error when writing to a client, we free the client immediately. This means that any pending reads will be discarded. Additionally, if a client disconnects before we have finished the writes in discover_server_process_connection, we won't register the waiter to read from the socket. Instead of freeing the client on write failure, this change sets a flag (se we don't continue to write), and we rely on the read EOF to free the client. This means we don't drop incoming messages. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Allow an in-progress boot to be cancelledJeremy Kerr2013-10-154-17/+95
| | | | | | | | | 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>
* discover: Add load_url_cancelJeremy Kerr2013-10-142-4/+38
| | | | | | | We'd like a way to cancel pending loads, as part of aborting the boot process. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Allow URL resourcesJeremy Kerr2013-10-142-3/+10
| | | | | | Allow URL-format specifiers for GRUB2 resources. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Use OK & Cancel buttons for boot editor completionJeremy Kerr2013-10-112-6/+47
| | | | | | | Rather than using enter to complete a boot_editor session, add OK and Cancel buttons. Enter will move between fields. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Use 'x' as exit keyJeremy Kerr2013-10-114-5/+6
| | | | | | | | | | | Because terminals will send escape-sequences starting with escape, ncurses will pause after receiving a signle escape, to detect these sequences. This introduces a 1-second delay when exiting the petitboot UI. Instead, use 'x'. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Allow booting custom boot optionsJeremy Kerr2013-10-102-6/+1
| | | | | | | Currently, we can't boot user-created boot options, as they have no option ID associated. This change removes the check for option ID. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Defer item creation until boot editor is doneJeremy Kerr2013-10-108-93/+88
| | | | | | | | | | | | Currently, when creating new menu entries, we create an empty item, add it to the menu, then run the boot editor. This means that cancelling the edit will leave an empty item in the menu. This change defers the creation until the boot editor is done. To do this, we modify the on_open callback to take a menu rather than an item, and pass NULL boot data to the editor. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Use 'New' instead of 'Open'Jeremy Kerr2013-10-102-3/+2
| | | | | | "Open" is ambiguous in the context of the boot menu; use "new" instead. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Allow device_handler_boot with no optionJeremy Kerr2013-10-101-2/+3
| | | | | | Only call find_boot_option_by_id if we have an ID. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: remove register_parser printfJeremy Kerr2013-10-091-2/+0
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud