discover: Determine connectivity with getaddrinfo() Use getaddrinfo() to determine if a remote URL is reachable instead of only checking if we have an addresses configured. This avoids, for example, trying to load an IPv4 URL when only an IPv6 address is available. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
discover/sysinfo: Set IPv6 addresses Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
discover/sysinfo: Add network availability helper Add a helper function that describes interfaces as available if they have an assigned address. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
discover/sysinfo: Add system_info_reinit() Currently over reinit events the system info is not affected. However network and block device information can change over reinit, so clear this information. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
discover/sysinfo: Fix useless error message Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
discover: Record IP address of network interfaces If an interface has a valid IP address (either via DHCP or static config) store it in the interface_info struct so it can be referenced later. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
discover: Use platform code to read sysinfo type and identifier 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>
sysinfo: Add interface link status to sysinfo data This changes adds a 'link' parameter to the interface information sent in sysinfo messages. The discover network code populates this from the incoming netlink messages. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover: populate sysinfo with block devices Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover/sysinfo: Fix talloc against uninitialised server var Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover/sysinfo: Add helper script to populate sysinfo identifiers Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Add system info messages Add a little infrastructure for communicating information about the system to the petitboot UIs. We just send some identifying info (type and identifier), as well as the interfaces. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>