[PATCH 1/2] lib: fwts_acpi_tables: customized tables dumping by default

Ivan Hu ivan.hu at canonical.com
Mon Jun 8 07:30:05 UTC 2020


Currently, fwts acpi table acpidumping first read from /dev/mem/,
it is the same as acpidump -c off, it will missing some customized tables.
Sync up with acpidump tool which read from sysfs first.

Signed-off-by: Ivan Hu <ivan.hu at canonical.com>
---
 src/lib/src/fwts_acpi_tables.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c
index 3b1d7887..2e0c828a 100644
--- a/src/lib/src/fwts_acpi_tables.c
+++ b/src/lib/src/fwts_acpi_tables.c
@@ -1214,11 +1214,13 @@ int fwts_acpi_load_tables(fwts_framework *fw)
 		ret = fwts_acpi_load_tables_from_acpidump(fw);
 		require_fixup = true;
 	} else if (fwts_check_root_euid(fw, true) == FWTS_OK) {
-		ret = fwts_acpi_load_tables_from_firmware(fw);
+		/* Load from sysfs */
+		ret = fwts_acpi_load_tables_from_sysfs(fw);
 
-		/* Load from memory failed (e.g. no /dev/mem), so try sysfs */
 		if (ret != FWTS_OK) {
-			ret = fwts_acpi_load_tables_from_sysfs(fw);
+			/* Load from sysfs failed, so try memory (e.g. /dev/mem)*/
+			ret = fwts_acpi_load_tables_from_firmware(fw);
+		} else {
 			require_fixup = true;
 		}
 	} else {
-- 
2.17.1




More information about the fwts-devel mailing list