path: root/discover/platform.c
Commit message (Collapse)AuthorAgeFilesLines
* Support HTTP(S) proxies when downloading resourcesSamuel Mendoza-Jonas2016-11-241-0/+7
| | | | | | | | Allow the user to specify a HTTP and HTTPS proxy server. The discover server will set the http_proxy and https_proxy environment variables, enabling the proxy servers for any further HTTP(S) requests. Signed-off-by: Samuel Mendoza-Jonas <>
* Consolidate petitboot,tty and petitboot,consoleSamuel Mendoza-Jonas2016-09-081-0/+2
| | | | | | | | | | | | | | | | | | | | Commit ce54f86 "Add petitboot,tty and track available consoles" added the petitboot,tty parameter, but the petitboot,console parameter is also recognised by Petitboot. These are ultimately handled by the 30-add-offb and 80-set-stdout hooks respectively, but exist for mostly the same purpose. We consolidate these down to just the original petitboot,console parameter. If the contents of petitboot,console have been configured by Petitboot (ie. it is of the form /dev/dev# [ Description ]) we behave as normal, otherwise we assume that petitboot,console contains a full OF path to the intended console device and do not allow it to be modified. This follows petitboot,console's original intent to be a debug aid, and takes precedence over any other use. The 80-set-stdout hook is removed as 30-add-offb now accounts for both use cases. Signed-off-by: Samuel Mendoza-Jonas <>
* Use 'consoles' instead of 'tty' to refer to interfacesSamuel Mendoza-Jonas2016-09-081-4/+4
| | | | | | | 'Console' is more readily understandable and technically more correct than 'tty' for referring to the interfaces that Petitboot starts a UI on. Signed-off-by: Samuel Mendoza-Jonas <>
* discover: Add petitboot,tty and track available consolesSamuel Mendoza-Jonas2016-06-291-0/+10
| | | | | | | | | | Add the NVRAM parameter petitboot,tty which sets the default console to use when booting a kernel. In load_config() construct a list of available consoles depending on the current platform. A future patch depending on firmware changes will allow this list to be constructed dynamically. Signed-off-by: Samuel Mendoza-Jonas <>
* ui: add URL for static configurations to load a specified fileNishanth Aravamudan2015-12-181-0/+1
| | | | | | | | | | | | In certain configurations, e.g. automation, we want to use static networking but load a particular file, automatically and parse it as a pxelinux config file. Currently, we support something like this for DHCP based booting, but not static. Add a URL field to the UI for static configurations and reuse the logic from device_handler_process_url() to load the specified file. Signed-off-by: Nishanth Aravamudan <> Signed-off-by: Samuel Mendoza-Jonas <>
* discover: Set default languageJeremy Kerr2015-09-241-1/+11
| | | | | | | Rather than setting NULL, do a setlocale(LC_ALL, NULL) to query the system locale value as our default. Signed-off-by: Jeremy Kerr <>
* discover: Add disable param for dm-snapshotsSamuel Mendoza-Jonas2015-08-181-0/+4
| | | | | | | Add a debug-style nvram parameter to disallow the use of device-mapper snapshots. Signed-off-by: Samuel Mendoza-Jonas <>
* Make read-only guarantee user-settableSamuel Mendoza-Jonas2015-08-061-0/+1
| | | | | | | | 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 <>
* petitboot: Implement ordered boot optionsSamuel Mendoza-Jonas2015-05-051-18/+14
| | | | | | | | | | | 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 <>
* lib: Define autoboot_options, device_type helpersSamuel Mendoza-Jonas2015-05-051-17/+0
| | | | | | | | | Add the new autoboot_option struct, and helper functions for working with device_type enums. device_type_name() returns exact strings as used by platform code to read/write nvram params, so device_type_display_name() is added for use in user-visible strings. Signed-off-by: Samuel Mendoza-Jonas <>
* discover/platform: rename finalise_config hookJeremy Kerr2015-02-161-3/+3
| | | | | | | We want to expand the finalise_config hook to cover generic pre-boot functionality, so rename to pre_boot. Signed-off-by: Jeremy Kerr <>
* discover: Integrate ipmi bootdev settings into the priority systemJeremy Kerr2014-12-151-4/+13
| | | | | | | | | | | | | | | | | | 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 <>
* discover/platform: Add finalise_config_hookJeremy Kerr2014-09-301-0/+6
| | | | Signed-off-by: Samuel Mendoza-Jonas <>
* discover/platform: Add boot device to config dumpJeremy Kerr2014-09-181-0/+3
| | | | Signed-off-by: Jeremy Kerr <>
* discover: Add debug flag to configJeremy Kerr2014-08-051-0/+27
| | | | | | | | | | This change adds a debug flag to the config, and groups it under not-user-modifiable parts of struct config. This means we no longer need the pb-sysinfo helper, as the last remaining function (--debug-enabled) can be implemented with pb-config. Signed-off-by: Jeremy Kerr <>
* discover: Use platform code to read sysinfo type and identifierJeremy Kerr2014-08-051-0/+7
| | | | | | | | | | | | | | | | This change uses the platform-specific code to read the system type and identifier, rather than the pb-sysinfo utility. We introduce a new callback for struct platform: int (*get_sysinfo)(struct platform *, struct system_info *); - which populates struct system_info with appropriate information. This means that the system-specific code is kept in one place; rather than having powerpc-specific device-tree-reading code in the pb-sysinfo shell script. Signed-off-by: Jeremy Kerr <>
* discover: add initialiser for config->safe_modeJeremy Kerr2014-08-011-0/+1
| | | | Signed-off-by: Jeremy Kerr <>
* config: Add lang member to configJeremy Kerr2014-07-281-0/+3
| | | | Signed-off-by: Jeremy Kerr <>
* ui/ncurses: Add safe mode indicatorJeremy Kerr2014-07-221-0/+1
| | | | Signed-off-by: Jeremy Kerr <>
* discover: Add safe modeJeremy Kerr2014-07-221-0/+3
| | | | | | | | | | | 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 <>
* discover: check config.boot_device before setting a defaultJeremy Kerr2014-07-211-0/+1
| | | | | | If a default device is set, we only allow booting from that device. Signed-off-by: Jeremy Kerr <>
* discover: Include boot priorities in configuration dumpJeremy Kerr2014-03-141-0/+26
| | | | | | | To help debug boot priority issues, it'd be useful to include the priority data in the configuration dump. Signed-off-by: Jeremy Kerr <>
* discover: Make boot_priorities more flexibleJeremy Kerr2014-01-301-1/+2
| | | | | | | | | | | | 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 <>
* discover/network: Use platform definition for DHCP architecture IDJeremy Kerr2014-01-301-0/+5
| | | | | | | Allow a platform to specify a DHCP architecture ID, as this is platform-specific. Signed-off-by: Jeremy Kerr <>
* pb-config: Move config storage modules to "platform" modules in discover codeJeremy Kerr2014-01-301-0/+157
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 <>
OpenPOWER on IntegriCloud