summaryrefslogtreecommitdiffstats
path: root/lib/pb-config/pb-config.c
Commit message (Collapse)AuthorAgeFilesLines
* Make read-only guarantee user-settableSamuel Mendoza-Jonas2015-08-061-0/+2
| | | | | | | | Create a new Petitboot option 'petitboot,write?' that specifies whether the system is allowed to mount devices read-write. The option can be toggled by the user in the nc-config screen. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* petitboot: Implement ordered boot optionsSamuel Mendoza-Jonas2015-05-051-13/+13
| | | | | | | | | | | Move petitboot to a more familiar 'boot-order' based autoboot system. The discover server now reads multiple values from the petitboot,bootdev parameter and adds them in order to config->autoboot_opts. Boot priority is determined by the options' position in the list. On the client, nc-config now recognises the new boot order, and allows the user to add, remove, and reorder the devices in the list. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* 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-301-138/+0
| | | | | | | | | | | | | | | | | | 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-301-0/+63
| | | | | | | | | | | | | | 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>
* 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-131-1/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/pb-config: Implement config_setJeremy Kerr2013-11-131-4/+31
| | | | | | | 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>
* discover: Implement device prioritiesJeremy Kerr2013-09-191-0/+8
| | | | 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: Add autoboot timeout to configuration varsJeremy Kerr2013-09-181-2/+6
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* network: handle DNS configJeremy Kerr2013-08-081-1/+3
| | | | | | If we have a dns config option, update resolv.conf Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* config: Split interface configuration from network configurationJeremy Kerr2013-08-081-13/+13
| | | | | | | | 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-231-2/+10
| | | | | | | Add new routine config_set_autoboot(), and use it to set the --no-autoboot option. Signed-off-by: Geoff Levand <geoff@infradead.org>
* lib: Add pb-config moduleJeremy Kerr2013-06-241-0/+81
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