Exemplo n.º 1
0
static int power_mgmt_init(fwts_framework *fw)
{
	int ret;

	if (fwts_firmware_detect() != FWTS_FIRMWARE_OPAL) {
		fwts_skipped(fw,
			"The firmware type detected was non OPAL "
			"so skipping the OPAL Power Management DT checks.");
		return FWTS_SKIP;
	}

	if (!fw->fdt) {
		fwts_failed(fw, LOG_LEVEL_HIGH, "NoDeviceTree",
			"Device tree not found");
		return FWTS_ERROR;
	}

	ret = get_proc_gen(fw);
	if (ret != FWTS_OK) {
		fwts_failed(fw, LOG_LEVEL_HIGH, "ProcGenFail",
			"Failed to get the Processor generation");
		return FWTS_ERROR;
	}

	return FWTS_OK;
}
Exemplo n.º 2
0
static int reserv_mem_init(fwts_framework *fw)
{
	if (fwts_firmware_detect() != FWTS_FIRMWARE_OPAL) {
		fwts_skipped(fw,
			"The firmware type detected was non OPAL "
			"so skipping the OPAL Reserve Memory DT checks.");
		return FWTS_SKIP;
	}

	/* On an OPAL based system Device tree should be present */
	if (!fw->fdt) {
		fwts_failed(fw, LOG_LEVEL_HIGH, "NoDeviceTree",
			"Device tree not found");
		return FWTS_ERROR;
	}

	return FWTS_OK;
}
Exemplo n.º 3
0
static int uefivarinfo_init(fwts_framework *fw)
{
	if (fwts_firmware_detect() != FWTS_FIRMWARE_UEFI) {
		fwts_log_info(fw, "Cannot detect any UEFI firmware. Aborted.");
		return FWTS_ABORTED;
	}

	if (fwts_lib_efi_runtime_load_module(fw) != FWTS_OK) {
		fwts_log_info(fw, "Cannot load efi_runtime module. Aborted.");
		return FWTS_ABORTED;
	}

	fd = fwts_lib_efi_runtime_open();
	if (fd == -1) {
		fwts_log_info(fw, "Cannot open EFI test driver. Aborted.");
		return FWTS_ABORTED;
	}

	return FWTS_OK;
}
Exemplo n.º 4
0
static int uefirtauthvar_init(fwts_framework *fw)
{
	if (fwts_firmware_detect() != FWTS_FIRMWARE_UEFI) {
		fwts_log_info(fw, "Cannot detect any UEFI firmware. Aborted.");
		return FWTS_ABORTED;
	}

	if (fwts_lib_efi_runtime_load_module(fw) != FWTS_OK) {
		fwts_log_info(fw, "Cannot load efi_runtime module. Aborted.");
		return FWTS_ABORTED;
	}

	fd = open("/dev/efi_runtime", O_WRONLY | O_RDWR);
	if (fd == -1) {
		fwts_log_info(fw, "Cannot open efi_runtime driver. Aborted.");
		return FWTS_ABORTED;
	}

	uefirtvariable_env_cleanup();

	return FWTS_OK;
}