diff options
Diffstat (limited to 'external/meta-openembedded/meta-oe/recipes-test/fwts')
8 files changed, 392 insertions, 0 deletions
diff --git a/external/meta-openembedded/meta-oe/recipes-test/fwts/fwts/0001-Add-correct-printf-qualifier-for-off_t.patch b/external/meta-openembedded/meta-oe/recipes-test/fwts/fwts/0001-Add-correct-printf-qualifier-for-off_t.patch new file mode 100644 index 00000000..c2d679aa --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-test/fwts/fwts/0001-Add-correct-printf-qualifier-for-off_t.patch @@ -0,0 +1,38 @@ +From 613e5cfe7751068062cc92f83870e436669fc0a8 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 8 Jun 2017 16:49:50 -0700 +Subject: [PATCH] Add correct printf qualifier for off_t + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +--- + src/bios/ebda_region/ebda_region.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/bios/ebda_region/ebda_region.c b/src/bios/ebda_region/ebda_region.c +index 16c39357..ad6d635c 100644 +--- a/src/bios/ebda_region/ebda_region.c ++++ b/src/bios/ebda_region/ebda_region.c +@@ -83,9 +83,9 @@ static int ebda_test1(fwts_framework *fw) + if ((entry != NULL) && + (entry->type == FWTS_MEMORY_MAP_RESERVED || + entry->type == FWTS_MEMORY_MAP_ACPI)) { +- fwts_passed(fw, "EBDA region mapped at 0x%lx and reserved as a %" PRId64 ++ fwts_passed(fw, "EBDA region mapped at 0x%jdx and reserved as a %" PRId64 + "K region in the %s table at 0x%" PRIx64 "..0x%" PRIx64 ".", +- ebda_addr, ++ (intmax_t)ebda_addr, + (entry->end_address - entry->start_address) / 1024, + memory_map_name, + entry->start_address, +@@ -93,8 +93,8 @@ static int ebda_test1(fwts_framework *fw) + } else + fwts_failed(fw, LOG_LEVEL_MEDIUM, + "EBDAMappedNotReserved", +- "EBDA region mapped at 0x%lx but not reserved in the %s table.", +- ebda_addr, memory_map_name); ++ "EBDA region mapped at 0x%jdx but not reserved in the %s table.", ++ (intmax_t)ebda_addr, memory_map_name); + + return FWTS_OK; + } diff --git a/external/meta-openembedded/meta-oe/recipes-test/fwts/fwts/0001-Include-poll.h-instead-of-deprecated-sys-poll.h.patch b/external/meta-openembedded/meta-oe/recipes-test/fwts/fwts/0001-Include-poll.h-instead-of-deprecated-sys-poll.h.patch new file mode 100644 index 00000000..4baefe4a --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-test/fwts/fwts/0001-Include-poll.h-instead-of-deprecated-sys-poll.h.patch @@ -0,0 +1,46 @@ +From ed988c27efde5355c3ba9d0de8a14a4a40f798cc Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 6 Jun 2017 07:25:09 -0700 +Subject: [PATCH] Include poll.h instead of deprecated sys/poll.h + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +--- + src/lib/src/fwts_ipmi.c | 3 ++- + src/lib/src/fwts_pipeio.c | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/lib/src/fwts_ipmi.c b/src/lib/src/fwts_ipmi.c +index a4c8a511..e298969e 100644 +--- a/src/lib/src/fwts_ipmi.c ++++ b/src/lib/src/fwts_ipmi.c +@@ -18,10 +18,11 @@ + * + */ + ++#include <poll.h> ++ + #include <sys/types.h> + #include <sys/stat.h> + #include <fcntl.h> +-#include <sys/poll.h> + #include <sys/ioctl.h> + #include <linux/ipmi.h> + +diff --git a/src/lib/src/fwts_pipeio.c b/src/lib/src/fwts_pipeio.c +index 3b3cfaff..289564d1 100644 +--- a/src/lib/src/fwts_pipeio.c ++++ b/src/lib/src/fwts_pipeio.c +@@ -30,9 +30,9 @@ + #include <stdlib.h> + #include <string.h> + #include <paths.h> ++#include <poll.h> + + #include <sys/param.h> +-#include <sys/poll.h> + #include <sys/types.h> + #include <sys/wait.h> + #include <errno.h> diff --git a/external/meta-openembedded/meta-oe/recipes-test/fwts/fwts/0001-Remove-Werror-from-build.patch b/external/meta-openembedded/meta-oe/recipes-test/fwts/fwts/0001-Remove-Werror-from-build.patch new file mode 100644 index 00000000..611ccc8f --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-test/fwts/fwts/0001-Remove-Werror-from-build.patch @@ -0,0 +1,52 @@ +From 475979cf5c1af978f4e8409666365ec75b3320ea Mon Sep 17 00:00:00 2001 +From: Benjamin Berg <bberg@redhat.com> +Date: Mon, 21 Aug 2017 10:34:40 +0200 +Subject: [PATCH] Remove -Werror from build + +Upstream-Status: Pending + +--- + src/Makefile.am | 2 +- + src/lib/src/Makefile.am | 2 +- + src/utilities/Makefile.am | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/Makefile.am b/src/Makefile.am +index 4daa9e8f..873f23eb 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -14,7 +14,7 @@ AM_CPPFLAGS = \ + `pkg-config --silence-errors --cflags json` \ + `pkg-config --silence-errors --cflags json-c` \ + -pthread `pkg-config --cflags glib-2.0 gio-2.0` \ +- -Wall -Werror -Wextra ++ -Wall -Wextra + + bin_PROGRAMS = fwts + +diff --git a/src/lib/src/Makefile.am b/src/lib/src/Makefile.am +index fa232451..082403a2 100644 +--- a/src/lib/src/Makefile.am ++++ b/src/lib/src/Makefile.am +@@ -24,7 +24,7 @@ AM_CPPFLAGS = \ + `pkg-config --silence-errors --cflags json-c` \ + `pkg-config --cflags glib-2.0 gio-2.0` \ + -DDATAROOTDIR=\"$(datarootdir)\" \ +- -Wall -Werror -Wextra ++ -Wall -Wextra + + pkglib_LTLIBRARIES = libfwts.la + +diff --git a/src/utilities/Makefile.am b/src/utilities/Makefile.am +index aa37de55..4d5297cc 100644 +--- a/src/utilities/Makefile.am ++++ b/src/utilities/Makefile.am +@@ -16,7 +16,7 @@ + # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + # + +-AM_CPPFLAGS = -Wall -Werror -Wextra -DDATAROOTDIR=\"$(datarootdir)\" \ ++AM_CPPFLAGS = -Wall -Wextra -DDATAROOTDIR=\"$(datarootdir)\" \ + `pkg-config --silence-errors --cflags json` \ + `pkg-config --silence-errors --cflags json-c` + diff --git a/external/meta-openembedded/meta-oe/recipes-test/fwts/fwts/0001-ignore-constant-logical-operand-warning-with-clang.patch b/external/meta-openembedded/meta-oe/recipes-test/fwts/fwts/0001-ignore-constant-logical-operand-warning-with-clang.patch new file mode 100644 index 00000000..ae3665b4 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-test/fwts/fwts/0001-ignore-constant-logical-operand-warning-with-clang.patch @@ -0,0 +1,84 @@ +From 5bd05ad8569880985ddf6d4c06ed927d388c297f Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 19 Oct 2016 01:57:16 +0000 +Subject: [PATCH] ignore constant-logical-operand warning with clang + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +--- + src/dmi/dmicheck/dmicheck.c | 3 +++ + src/lib/src/fwts_acpi_tables.c | 5 +++++ + src/uefi/uefirtauthvar/uefirtauthvar.c | 5 +++++ + 3 files changed, 13 insertions(+) + +diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c +index 3cca9db9..60fb758f 100644 +--- a/src/dmi/dmicheck/dmicheck.c ++++ b/src/dmi/dmicheck/dmicheck.c +@@ -211,6 +211,8 @@ static const char *uuid_patterns[] = { + "0A0A0A0A-0A0A-0A0A-0A0A-0A0A0A0A0A0A", + NULL, + }; ++#pragma clang diagnostic push ++#pragma clang diagnostic ignored "-Wunneeded-internal-declaration" + + static const fwts_chassis_type_map fwts_dmi_chassis_type[] = { + { "Invalid", FWTS_SMBIOS_CHASSIS_INVALID }, +@@ -251,6 +253,7 @@ static const fwts_chassis_type_map fwts_dmi_chassis_type[] = { + { "Mini PC", FWTS_SMBIOS_CHASSIS_MINI_PC }, + { "Stick PC", FWTS_SMBIOS_CHASSIS_STICK_PC }, + }; ++#pragma clang diagnostic pop + + /* Remapping table from buggy version numbers to correct values */ + static const fwts_dmi_version dmi_versions[] = { +diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c +index c7ba59be..bdd224aa 100644 +--- a/src/lib/src/fwts_acpi_tables.c ++++ b/src/lib/src/fwts_acpi_tables.c +@@ -393,10 +393,14 @@ static int fwts_acpi_handle_fadt( + /* Determine FACS addr and load it. + * Will ignore the missing FACS in the hardware-reduced mode. + */ ++#pragma clang diagnostic push ++#pragma clang diagnostic ignored "-Waddress-of-packed-member" ++ + result = fwts_acpi_handle_fadt_tables(fw, fadt, + "FACS", "FIRMWARE_CTRL", "X_FIRMWARE_CTRL", + &fadt->firmware_control, &fadt->x_firmware_ctrl, + provenance); ++ + if (result != FWTS_OK) { + if ((result == FWTS_NULL_POINTER) && + fwts_acpi_is_reduced_hardware(fadt)) { +@@ -415,6 +419,7 @@ static int fwts_acpi_handle_fadt( + return FWTS_ERROR; + } + return FWTS_OK; ++#pragma clang diagnostic pop + } + + /* +diff --git a/src/uefi/uefirtauthvar/uefirtauthvar.c b/src/uefi/uefirtauthvar/uefirtauthvar.c +index c2031741..7a33d19d 100644 +--- a/src/uefi/uefirtauthvar/uefirtauthvar.c ++++ b/src/uefi/uefirtauthvar/uefirtauthvar.c +@@ -142,6 +142,9 @@ static int uefirtauthvar_deinit(fwts_framework *fw) + return FWTS_OK; + } + ++#pragma clang diagnostic push ++#pragma clang diagnostic ignored "-Wconstant-logical-operand" ++ + static int check_fw_support(fwts_framework *fw, uint64_t status) + { + if ((status == EFI_INVALID_PARAMETER) && +@@ -172,6 +175,8 @@ static int check_fw_support(fwts_framework *fw, uint64_t status) + return FWTS_OK; + } + ++#pragma clang diagnostic pop ++ + /* + * Set the created authenticated variable, AuthVarCreate, + * and checking the data size and data. diff --git a/external/meta-openembedded/meta-oe/recipes-test/fwts/fwts/0002-Define-__SWORD_TYPE-if-not-defined-by-libc.patch b/external/meta-openembedded/meta-oe/recipes-test/fwts/fwts/0002-Define-__SWORD_TYPE-if-not-defined-by-libc.patch new file mode 100644 index 00000000..b45e46a3 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-test/fwts/fwts/0002-Define-__SWORD_TYPE-if-not-defined-by-libc.patch @@ -0,0 +1,31 @@ +From 1112e51d240a206bdcf253878ef1f4963b92da8a Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 6 Jun 2017 07:37:20 -0700 +Subject: [PATCH] Define __SWORD_TYPE if not defined by libc + +__SWORD_TYPE is internal to glibc, therefore +check and define it if needed e.g. on musl + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +--- + src/lib/src/fwts_uefi.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/lib/src/fwts_uefi.c b/src/lib/src/fwts_uefi.c +index 544145fa..460b0b77 100644 +--- a/src/lib/src/fwts_uefi.c ++++ b/src/lib/src/fwts_uefi.c +@@ -59,6 +59,10 @@ typedef struct { + #define UEFI_IFACE_SYSFS (2) /* sysfs */ + #define UEFI_IFACE_EFIVARS (3) /* efivar fs */ + ++#ifndef __SWORD_TYPE ++typedef __typeof__( ((struct statfs *)0)->f_type ) __SWORD_TYPE; ++#endif ++ + /* File system magic numbers */ + #define PSTOREFS_MAGIC ((__SWORD_TYPE)0x6165676C) + #define EFIVARFS_MAGIC ((__SWORD_TYPE)0xde5e81e4) diff --git a/external/meta-openembedded/meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch b/external/meta-openembedded/meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch new file mode 100644 index 00000000..1d8c620e --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch @@ -0,0 +1,28 @@ +From 244e9551ab9bbc1dfa91d19cd472ef254a94ae41 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 6 Jun 2017 07:39:28 -0700 +Subject: [PATCH] Undefine PAGE_SIZE + +musl defines PAGE_SIZE and build complains +of multiple definitions + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +--- + src/lib/src/fwts_acpi_tables.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c +index bdd224aa..58e982a6 100644 +--- a/src/lib/src/fwts_acpi_tables.c ++++ b/src/lib/src/fwts_acpi_tables.c +@@ -42,6 +42,7 @@ + #define BIOS_START (0x000e0000) /* Start of BIOS memory */ + #define BIOS_END (0x000fffff) /* End of BIOS memory */ + #define BIOS_LENGTH (BIOS_END - BIOS_START) /* Length of BIOS memory */ ++#undef PAGE_SIZE + #define PAGE_SIZE (4096) + + static fwts_acpi_table_info tables[ACPI_MAX_TABLES]; diff --git a/external/meta-openembedded/meta-oe/recipes-test/fwts/fwts/0003-use-intptr_t-to-fix-pointer-to-int-cast-issues.patch b/external/meta-openembedded/meta-oe/recipes-test/fwts/fwts/0003-use-intptr_t-to-fix-pointer-to-int-cast-issues.patch new file mode 100644 index 00000000..bebbfa4a --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-test/fwts/fwts/0003-use-intptr_t-to-fix-pointer-to-int-cast-issues.patch @@ -0,0 +1,74 @@ +From 1848b8f8b9be500046ca5d632789a068d6151815 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 8 Jun 2017 16:50:59 -0700 +Subject: [PATCH] use intptr_t to fix pointer-to-int-cast issues + +uintptr_t is guaranteed to be wide enough that +converting a void* to uintptr_t and back again +will yield the original pointer value + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +--- + src/lib/src/fwts_acpi_tables.c | 4 ++-- + src/lib/src/fwts_mmap.c | 2 +- + src/lib/src/fwts_smbios.c | 4 ++-- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c +index 58e982a6..6522032f 100644 +--- a/src/lib/src/fwts_acpi_tables.c ++++ b/src/lib/src/fwts_acpi_tables.c +@@ -156,7 +156,7 @@ static fwts_acpi_table_rsdp *fwts_acpi_get_rsdp(fwts_framework *fw, void *addr, + return NULL; + } + +- if ((mem = fwts_mmap((off_t)addr, sizeof(fwts_acpi_table_rsdp))) == FWTS_MAP_FAILED) ++ if ((mem = fwts_mmap((uintptr_t)addr, sizeof(fwts_acpi_table_rsdp))) == FWTS_MAP_FAILED) + return NULL; + + if (fwts_safe_memcpy(rsdp, mem, sizeof(fwts_acpi_table_rsdp)) != FWTS_OK) { +@@ -455,7 +455,7 @@ static int fwts_acpi_load_tables_from_firmware(fwts_framework *fw) + if ((rsdp = fwts_acpi_get_rsdp(fw, rsdp_addr, &rsdp_len)) == NULL) + return FWTS_ERROR; + +- fwts_acpi_add_table("RSDP", rsdp, (uint64_t)(off_t)rsdp_addr, rsdp_len, FWTS_ACPI_TABLE_FROM_FIRMWARE); ++ fwts_acpi_add_table("RSDP", rsdp, (uint64_t)(uintptr_t)rsdp_addr, rsdp_len, FWTS_ACPI_TABLE_FROM_FIRMWARE); + + /* Load any tables from XSDT if it's valid */ + if (rsdp->xsdt_address) { +diff --git a/src/lib/src/fwts_mmap.c b/src/lib/src/fwts_mmap.c +index e28abf87..2180b2cc 100644 +--- a/src/lib/src/fwts_mmap.c ++++ b/src/lib/src/fwts_mmap.c +@@ -81,7 +81,7 @@ int fwts_munmap(void *mem, const size_t size) + off_t offset; + + page_size = fwts_page_size(); +- offset = ((off_t)(mem)) & (page_size - 1); ++ offset = ((uintptr_t)(mem)) & (page_size - 1); + + if (munmap((void *)((uint8_t *)mem - offset), size + offset) < 0) + return FWTS_ERROR; +diff --git a/src/lib/src/fwts_smbios.c b/src/lib/src/fwts_smbios.c +index e5b3c774..c8134926 100644 +--- a/src/lib/src/fwts_smbios.c ++++ b/src/lib/src/fwts_smbios.c +@@ -55,7 +55,7 @@ static void *fwts_smbios_find_entry_uefi(fwts_framework *fw, fwts_smbios_entry * + fwts_smbios_entry *mapped_entry; + const size_t size = sizeof(fwts_smbios_entry); + +- if ((mapped_entry = fwts_mmap((off_t)addr, size)) != FWTS_MAP_FAILED) { ++ if ((mapped_entry = fwts_mmap((uintptr_t)addr, size)) != FWTS_MAP_FAILED) { + if (fwts_safe_memcpy(entry, mapped_entry, size) == FWTS_OK) { + (void)fwts_munmap(mapped_entry, size); + *type = FWTS_SMBIOS; +@@ -91,7 +91,7 @@ static void *fwts_smbios30_find_entry_uefi(fwts_framework *fw, fwts_smbios30_ent + fwts_smbios30_entry *mapped_entry; + const size_t size = sizeof(fwts_smbios30_entry); + +- if ((mapped_entry = fwts_mmap((off_t)addr, size)) != FWTS_MAP_FAILED) { ++ if ((mapped_entry = fwts_mmap((uintptr_t)addr, size)) != FWTS_MAP_FAILED) { + if (fwts_safe_memread(mapped_entry, size) == FWTS_OK) { + *entry = *mapped_entry; + (void)fwts_munmap(mapped_entry, size); diff --git a/external/meta-openembedded/meta-oe/recipes-test/fwts/fwts_git.bb b/external/meta-openembedded/meta-oe/recipes-test/fwts/fwts_git.bb new file mode 100644 index 00000000..d3fb644d --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-test/fwts/fwts_git.bb @@ -0,0 +1,39 @@ +SUMMARY = "Firmware testsuite" +DESCRIPTION = "The tool fwts comprises of over fifty tests that are designed to exercise and test different aspects of a machine's firmware. Many of these tests need super user access to read BIOS data and ACPI tables, so the tool requires running with super user privileges (e.g. with sudo)." +HOMEPAGE = "https://wiki.ubuntu.com/Kernel/Reference/fwts" + +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://src/main.c;beginline=1;endline=16;md5=31da590f3e9f3bd34dcdb9e4db568519" + +PV = "18.05.00+git${SRCPV}" + +SRCREV = "b0ec7aa2ef743d113fd8c5e57c0ca3d5edd86f0e" +SRC_URI = "git://kernel.ubuntu.com/hwe/fwts.git \ + file://0001-ignore-constant-logical-operand-warning-with-clang.patch \ + file://0001-Include-poll.h-instead-of-deprecated-sys-poll.h.patch \ + file://0002-Define-__SWORD_TYPE-if-not-defined-by-libc.patch \ + file://0003-Undefine-PAGE_SIZE.patch \ + file://0001-Add-correct-printf-qualifier-for-off_t.patch \ + file://0003-use-intptr_t-to-fix-pointer-to-int-cast-issues.patch \ + file://0001-Remove-Werror-from-build.patch \ + " + +S = "${WORKDIR}/git" + +COMPATIBLE_HOST = "(i.86|x86_64|aarch64|powerpc64).*-linux" + +DEPENDS = "libpcre json-c glib-2.0 dtc bison-native" +DEPENDS_append_libc-musl = " libexecinfo" + +inherit autotools bash-completion pkgconfig + +CFLAGS += "-I${STAGING_INCDIR}/json-c -Wno-error=unknown-pragmas" +LDFLAGS_append_libc-musl = " -lexecinfo" + +FILES_${PN} += "${libdir}/fwts/lib*${SOLIBS}" +FILES_${PN}-dev += "${libdir}/fwts/lib*${SOLIBSDEV} ${libdir}/fwts/lib*.la" +FILES_${PN}-staticdev += "${libdir}/fwts/lib*a" +FILES_${PN}-dbg += "${libdir}/fwts/.debug" + +TOOLCHAIN = "gcc" + |