From patchwork Wed Jun 20 12:14:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcello Sylvester Bauer X-Patchwork-Id: 932145 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=marcellobauer.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=marcellobauer.com header.i=@marcellobauer.com header.b="BGwnfqfh"; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 419kSK5G6Tz9s7c; Wed, 20 Jun 2018 22:20:33 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1fVc67-0003yl-Ho; Wed, 20 Jun 2018 12:20:27 +0000 Received: from mo4-p02-ob.smtp.rzone.de ([81.169.146.170]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1fVc11-0003Sm-Fg for fwts-devel@lists.ubuntu.com; Wed, 20 Jun 2018 12:15:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1529496911; s=strato-dkim-0002; d=marcellobauer.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=u7SfYJIBlNWixz4IqmJExa45EaaEKlWh2B+HkHsX4dU=; b=BGwnfqfhoxwD0BjkW4mgh+Hy3wGuhwY0DrvLQA2GsoJ/obCbxjNtfsvZasjSClQMqG J5hcp0WqQshZRw4U28ZOHFjkHgdQiuf/Sl6RLloQtAI5BGkKov/ypHEQDb38+VJq9/Nr 1I2KSrE8O2LMaoZvrkjWB2c6haua/mJ2khmnTHP8c5CtXZ3BJu02inwVjtW/4U+czB1c ayroiaMJ7wd1pnLpeAvlsSQ6gy/ZTg1KK/0lXrl1f7Ah2ie7OBw0HT8at8zgwR3zNuo6 QtR6yveW935aJwUpWUnsdxaapsEz2MJlRhX2MUgymrIauO/P0NOUjeFbxdjog+QX0KMz IWxQ== X-RZG-AUTH: ":P3kGVU2pafwxDWbfd7lCAWBxt4VwoTflSh0zGwV+MScAah+CJf7PfB0eiCQ3DUlp/Rnv8orA" X-RZG-CLASS-ID: mo00 Received: from W530.9e.network by smtp.strato.de (RZmta 43.10 DYNA|AUTH) with ESMTPSA id Y09740u5KCFA150 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Wed, 20 Jun 2018 14:15:10 +0200 (CEST) From: Marcello Sylvester Bauer To: fwts-devel@lists.ubuntu.com Subject: [PATCH 13/20] fwts_clog: add fwts_clog_read Date: Wed, 20 Jun 2018 14:14:39 +0200 Message-Id: <20180620121446.31470-14-info@marcellobauer.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180620121446.31470-1-info@marcellobauer.com> References: <20180620121446.31470-1-info@marcellobauer.com> X-Mailman-Approved-At: Wed, 20 Jun 2018 12:20:25 +0000 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marcello Sylvester Bauer MIME-Version: 1.0 Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" Signed-off-by: Marcello Sylvester Bauer Acked-by: Colin Ian King Acked-by: Alex Hung --- src/lib/include/fwts_clog.h | 1 + src/lib/src/fwts_clog.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/lib/include/fwts_clog.h b/src/lib/include/fwts_clog.h index 87ecc438..f29aaa3f 100644 --- a/src/lib/include/fwts_clog.h +++ b/src/lib/include/fwts_clog.h @@ -24,5 +24,6 @@ #include "fwts.h" void fwts_clog_free(fwts_list *list); +fwts_list *fwts_clog_read(void); #endif diff --git a/src/lib/src/fwts_clog.c b/src/lib/src/fwts_clog.c index 3887e6fc..fe04e090 100644 --- a/src/lib/src/fwts_clog.c +++ b/src/lib/src/fwts_clog.c @@ -20,6 +20,12 @@ #include "fwts.h" +/* + * coreboot logfile exposed by Google firmware module + * Kernel option nessesary (GOOGLE_MEMCONSOLE_COREBOOT=m/y) + */ +#define GOOGLE_MEMCONSOLE_COREBOOT_PATH "/sys/firmware/log" + /* * free coreboot log list */ @@ -27,3 +33,18 @@ void fwts_clog_free(fwts_list *clog) { fwts_log_free(clog); } + +/* + * read coreboot log and return as list of lines + * TODO: 1) parse coreboot logfile as argument + * 2) find coreboot log in /dev/mem + */ +fwts_list *fwts_clog_read(void) +{ + fwts_list *list; + + if ((list = fwts_file_open_and_read(GOOGLE_MEMCONSOLE_COREBOOT_PATH)) == NULL) + return NULL; + + return list; +}