summaryrefslogtreecommitdiffstats
path: root/discover/platform.h
Commit message (Collapse)AuthorAgeFilesLines
* discover: Check if the kernel image has Ultravisor supportMaxiwell S. Garcia2020-01-251-0/+5
| | | | | | | | | | | | | | | | | | The PPC kernel image has an ELF Note 'namespace' called 'PowerPC' to store capabilities and information which can be used by a bootloader or userland. The capabilities can be accessed using the 'type' PPC_ELFNOTE_CAPABILITIES which returns a bitmap as 'descriptor' field. Bit 0 in this bitmap indicates that the powerpc kernel binary knows how to run in an ultravisor-enabled system. So, using this bit, the petitboot can decide to abort the boot if the kernel is incompatible, avoiding the crash later. This validation only occours on PowerPC ultravisor-system and if the config 'preboot check' in UI screen is enabled. Signed-off-by: Maxiwell S. Garcia <maxiwell@linux.ibm.com>
* discover/platform-powerpc: read bootdev config from IPMI boot mailboxSamuel Mendoza-Jonas2018-12-131-0/+2
| | | | | | | | | | | | The IPMI Get System Boot Options commands includes parameter 7, the "boot initiator mailbox". This can be used to hold arbitrary data to influence the boot order. Use this to provide an alternate bootdev configuration to Petitboot that will override the one saved to NVRAM. This provides more fine grained override options than the existing device-type based overrides. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/discover-server: Restrict clients based on uidSamuel Mendoza-Jonas2018-12-031-0/+4
| | | | | | | | | | | | | | | | | | | | | If crypt support is enabled restrict what actions clients can perform by default. Initial authorisation is set at connection time; clients running as root are unrestricted, anything else runs as restricted until it makes an authentication to pb-discover. Unprivileged clients may only perform the following actions: - Boot the default boot option. - Cancel the autoboot timeout. - Make an authentication request. If a group named "petitgroup" exists then the socket permissions are also modified so that only clients running as root or in that group may connect to the socket. The user-event socket is only usable by root since the two main usecases are by utilities called by pb-discover or by a user in the shell who will need to su to root anyway. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover: Move generic params routines to platformGe Song2018-08-071-0/+5
| | | | | | | | | | Move the generic params routines from platform-powerpc to platform. Also, for clarity, add a params prefix to the names. Signed-off-by: Ge Song <ge.song@hxt-semitech.com> [Split from a larger patch and cleaned up] Signed-off-by: Geoff Levand <geoff@infradead.org> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover: Move generic config routines to platformGe Song2018-08-071-3/+3
| | | | | | | | | | Move the generic config routines from platform-powerpc to platform. Also, for clarity, add a config_ prefix to the names. Signed-off-by: Ge Song <ge.song@hxt-semitech.com> [Split from a larger patch and cleaned up] Signed-off-by: Geoff Levand <geoff@infradead.org> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/platform: rename finalise_config hookJeremy Kerr2015-02-161-2/+2
| | | | | | | We want to expand the finalise_config hook to cover generic pre-boot functionality, so rename to pre_boot. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Integrate ipmi bootdev settings into the priority systemJeremy Kerr2014-12-151-1/+2
| | | | | | | | | | | | | | | | | | 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>
* discover/platform: Add finalise_config_hookJeremy Kerr2014-09-301-0/+2
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* discover: Use platform code to read sysinfo type and identifierJeremy Kerr2014-08-051-0/+2
| | | | | | | | | | | | | | | | 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 <jk@ozlabs.org>
* discover/network: Use platform definition for DHCP architecture IDJeremy Kerr2014-01-301-0/+2
| | | | | | | Allow a platform to specify a DHCP architecture ID, as this is platform-specific. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* pb-config: Move config storage modules to "platform" modules in discover codeJeremy Kerr2014-01-301-0/+34
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>
OpenPOWER on IntegriCloud