summaryrefslogtreecommitdiffstats
path: root/lib/pb-config
Commit message (Collapse)AuthorAgeFilesLines
* discover: Integrate ipmi bootdev settings into the priority systemJeremy Kerr2014-12-151-0/+3
| | | | | | | | | | | | | | | | | | Currently, we expose the boot device priorities through an array in struct config, which will either be the default (network -> disk), or a single device type specified by the IPMI code. Rather than hide the implementation details in this array, we'd like to expose the details of the machine configuration instead. This allows user visibility of the real boot configuration (for example, if an IPMI boot preference is set). This change removes the priority array, and replaces it with the ipmi_bootdev data (and a persistent flag). We update the default-conflict-resolution code to reflect the priorities between IPMI and UUID preferences. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* config: Add lang member to configJeremy Kerr2014-07-281-0/+5
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Add safe modeJeremy Kerr2014-07-221-0/+1
| | | | | | | | | | | Safe mode configures the discover server to not start any device parsing; this can be used to diagnose any problems with early device handing. In safe mode, we don't initialise any of the device sources - udev, network and user events are disabled. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* config: Add boot_device member to configJeremy Kerr2014-07-211-0/+5
| | | | | | | We'd like to specify a way to only boot from a specific block device; this adds a field to the configuration to hold the value. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Make boot_priorities more flexibleJeremy Kerr2014-01-301-1/+4
| | | | | | | | | | | | 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>
* pb-config: Move config storage modules to "platform" modules in discover codeJeremy Kerr2014-01-306-810/+3
| | | | | | | | | | | | | | | | | | 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>
* lib/pb-config: Add config_copyJeremy Kerr2014-01-302-0/+65
| | | | | | | | | | | | | | At the moment, UIs have the config_set_defaults function to estabilish an initial configuration when performing an update. Rather than using the defaults, this change provides a config_copy() function, so that the updated configuration can be initialised from the current config. With this in place, the UI/server-common pb-config module can be reduced to just the one function. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* pb-config/powerpc: fix default option handlingJeremy Kerr2014-01-231-10/+30
| | | | | | | | | | | Currently, we don't update nvram if an NVRAM parameter is set to the default. This means we can never revert a configuration to its default value. This change fixes the default setting behaviour; instead of checking for a default, we want to check if it's a default and the option is absent. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/process: Add helper for check process clean exitJeremy Kerr2014-01-211-4/+2
| | | | | | | 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>
* config/powerpc: Always call update_network_configJeremy Kerr2013-12-231-2/+1
| | | | | | | | | | | | | | Currently, we have a bug when setting the default network configuration (ie, no devices have any specific config), as we won't call update_network_config to clear out the value of the petitboot,network parameter. This change always invokes update_network_config, regardless of the number of interfaces configured. This ensures we clear out the petitboot,network param, which is then synced to nvram if the param has changed. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/pb-config/powerpc-nvram: Fix format of dns configJeremy Kerr2013-11-261-1/+1
| | | | | | It should be dns,<server> not dns=<server> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Handle incoming configuration messagesJeremy Kerr2013-11-131-2/+2
| | | | | | | 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>
* lib/types: use unsigned int for interface, dns and prio countsJeremy Kerr2013-11-132-2/+2
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib: Move config structure defitinitions to types.hJeremy Kerr2013-11-131-38/+0
| | | | | | | | 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: consolidate util macros in util/util.hJeremy Kerr2013-11-131-1/+1
| | | | | | | 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>
* 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>
* lib: Add array-size headerJeremy Kerr2013-09-241-2/+2
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Implement device prioritiesJeremy Kerr2013-09-192-0/+16
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Remove unnecessary event passingJeremy Kerr2013-09-191-0/+12
| | | | | | | | | | | | | | | 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>
* lib/pb-config: Initialise DNS server infoJeremy Kerr2013-09-191-0/+2
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/pb-config/powerpc-nvram: Add petitboot,timeout nvram propertyJeremy Kerr2013-09-181-0/+14
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/pb-config: Add autoboot timeout to configuration varsJeremy Kerr2013-09-182-2/+7
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/process: replace pb_run_cmd_pipeJeremy Kerr2013-08-191-50/+22
| | | | | | Replace pb_run_cmd_pipe with process_create / process_run_sync. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* network: handle DNS configJeremy Kerr2013-08-082-2/+4
| | | | | | If we have a dns config option, update resolv.conf 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-084-57/+59
| | | | | | | | 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: Hookup --no-autoboot to configGeoff Levand2013-07-232-2/+11
| | | | | | | Add new routine config_set_autoboot(), and use it to set the --no-autoboot option. Signed-off-by: Geoff Levand <geoff@infradead.org>
* config/powerpc-nvram: Fix nvram line parsingJeremy Kerr2013-07-021-2/+11
| | | | | | | We have a couple of issues with the nvram output parser; lines aren't being broken up correctly. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* config/powerpc-nvram: Don't require petitboot, prefix on all paramsJeremy Kerr2013-07-021-6/+23
| | | | | | | | | | | Currently, we only store nvram params with a "petitboot," prefix, so that we don't grow the config list to an unbound size. However, the "auto-boot?" param has no prefix. Instead, remove the requirement for the "petitboot," prefix, and use an array of known parameters instead. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib: Add pb-config moduleJeremy Kerr2013-06-246-0/+535
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>
OpenPOWER on IntegriCloud