From patchwork Thu Jul 19 12:46:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 946279 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41WYg81M9wz9s3x for ; Thu, 19 Jul 2018 22:46:44 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41WYg75tJdzDq6t for ; Thu, 19 Jul 2018 22:46:43 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=redhat.com (client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=thuth@redhat.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41WYfw0BRlzDqCD for ; Thu, 19 Jul 2018 22:46:31 +1000 (AEST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8E2B872622; Thu, 19 Jul 2018 12:46:29 +0000 (UTC) Received: from thh440s.str.redhat.com (dhcp-200-180.str.redhat.com [10.33.200.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 12136111AF0C; Thu, 19 Jul 2018 12:46:28 +0000 (UTC) From: Thomas Huth To: slof@lists.ozlabs.org Date: Thu, 19 Jul 2018 14:46:24 +0200 Message-Id: <1532004387-3123-2-git-send-email-thuth@redhat.com> In-Reply-To: <1532004387-3123-1-git-send-email-thuth@redhat.com> References: <1532004387-3123-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 19 Jul 2018 12:46:29 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 19 Jul 2018 12:46:29 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' Subject: [SLOF] [PATCH v2 1/4] romfs/tools: Remove superfluous union around the rom header struct X-BeenThere: slof@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "Patches for https://github.com/aik/SLOF" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: slof-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "SLOF" Accessing the struct with memset and memcpy can also be done without the union wrapper. While we're at it, also remove the FLASHFS_HEADER_DATA_SIZE macre and use sizeof(stHeader) instead. Signed-off-by: Thomas Huth --- include/calculatecrc.h | 1 - romfs/tools/create_crc.c | 29 +++++++++++++---------------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/include/calculatecrc.h b/include/calculatecrc.h index a19a229..667ea81 100644 --- a/include/calculatecrc.h +++ b/include/calculatecrc.h @@ -17,7 +17,6 @@ #define FLASHFS_HEADER_SIZE_ADDR 0x08 // uint64_t position of total flash header size value #define FLASHFS_ROMADDR 0x00 // uint64_t position of pointer to next file -#define FLASHFS_HEADER_DATA_SIZE 0x68 // 104 bytes of total header data size #define CRC_METHODE Ethernet_32 // define the CRC genarator (CRC 16 bit to 64 is supported) //--- header format --------------------------------- diff --git a/romfs/tools/create_crc.c b/romfs/tools/create_crc.c index 5a76b9c..e354339 100644 --- a/romfs/tools/create_crc.c +++ b/romfs/tools/create_crc.c @@ -10,6 +10,7 @@ * IBM Corporation - initial implementation *****************************************************************************/ +#include #include #include #include @@ -71,21 +72,18 @@ createHeaderImage(int notime) char dastr[16] = { 0, }; unsigned long long da = 0; - union { - unsigned char pcArray[FLASHFS_HEADER_DATA_SIZE]; - struct stH stHeader; - } uHeader; + struct stH stHeader; /* initialize Header */ - memset(uHeader.pcArray, 0x00, FLASHFS_HEADER_DATA_SIZE); + memset(&stHeader, 0x00, sizeof(stHeader)); /* read driver info */ if (NULL != (pcVersion = getenv("DRIVER_NAME"))) { - strncpy(uHeader.stHeader.version, pcVersion, 16); + strncpy(stHeader.version, pcVersion, 16); } else if (NULL != (pcVersion = getenv("USER"))) { - strncpy(uHeader.stHeader.version, pcVersion, 16); + strncpy(stHeader.version, pcVersion, 16); } else if (pcVersion == NULL) { - strncpy(uHeader.stHeader.version, "No known user!", 16); + strncpy(stHeader.version, "No known user!", 16); } if (!notime) { @@ -104,18 +102,18 @@ createHeaderImage(int notime) } da = cpu_to_be64(strtoll(dastr, NULL, 16)); } - memcpy(uHeader.stHeader.date, &da, 8); + memcpy(stHeader.date, &da, 8); /* write Magic value into data stream */ - strncpy(uHeader.stHeader.magic, FLASHFS_MAGIC, 8); + strncpy(stHeader.magic, FLASHFS_MAGIC, 8); /* write platform name into data stream */ - strcpy(uHeader.stHeader.platform_name, FLASHFS_PLATFORM_MAGIC); + strcpy(stHeader.platform_name, FLASHFS_PLATFORM_MAGIC); /* write platform revision into data stream */ - strcpy(uHeader.stHeader.platform_revision, FLASHFS_PLATFORM_REVISION); + strcpy(stHeader.platform_revision, FLASHFS_PLATFORM_REVISION); /* fill end of file info (8 bytes of FF) into data stream */ - uHeader.stHeader.ui64FileEnd = -1; + stHeader.ui64FileEnd = -1; /* read address of next file and address of header date, both are 64 bit values */ ui64RomAddr = 0; @@ -129,7 +127,7 @@ createHeaderImage(int notime) /* calculate final flash-header-size and flash-file-size */ /* calculate end addr of header */ - ui64globalHeaderSize = (uint32_t) ui64DataAddr + (uint32_t) FLASHFS_HEADER_DATA_SIZE; + ui64globalHeaderSize = (uint32_t) ui64DataAddr + sizeof(stHeader); /* cut 64 bit to place CRC for File-End */ ui64globalHeaderSize -= 8; /* add 64 bit to place CRC behind File-End */ @@ -143,8 +141,7 @@ createHeaderImage(int notime) /* fill free space in Header with zeros */ memset(&pucFileStream[ui64DataAddr], 0, (ui64RomAddr - ui64DataAddr)); /* place data to header */ - memcpy(&pucFileStream[ui64DataAddr], uHeader.pcArray, - FLASHFS_HEADER_DATA_SIZE); + memcpy(&pucFileStream[ui64DataAddr], &stHeader, sizeof(stHeader)); /* insert header length into data stream */ *(uint64_t *) (pucFileStream + FLASHFS_HEADER_SIZE_ADDR) = From patchwork Thu Jul 19 12:46:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 946280 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41WYgH56j0z9s3x for ; Thu, 19 Jul 2018 22:46:51 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41WYgH2q0JzDqDR for ; Thu, 19 Jul 2018 22:46:51 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=redhat.com (client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=thuth@redhat.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41WYfw5WTLzDq6t for ; Thu, 19 Jul 2018 22:46:32 +1000 (AEST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4D62D40201CF; Thu, 19 Jul 2018 12:46:30 +0000 (UTC) Received: from thh440s.str.redhat.com (dhcp-200-180.str.redhat.com [10.33.200.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id C5A68111AF0C; Thu, 19 Jul 2018 12:46:29 +0000 (UTC) From: Thomas Huth To: slof@lists.ozlabs.org Date: Thu, 19 Jul 2018 14:46:25 +0200 Message-Id: <1532004387-3123-3-git-send-email-thuth@redhat.com> In-Reply-To: <1532004387-3123-1-git-send-email-thuth@redhat.com> References: <1532004387-3123-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 19 Jul 2018 12:46:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 19 Jul 2018 12:46:30 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' Subject: [SLOF] [PATCH v2 2/4] romfs/tools: Silence GCC 8.1 compiler warning with FLASHFS_MAGIC X-BeenThere: slof@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "Patches for https://github.com/aik/SLOF" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: slof-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "SLOF" GCC 8.1 introduce some new warnings which affect create_crc.c. One of them is: create_crc.c: In function ‘createHeaderImage’: create_crc.c:110:2: warning: ‘strncpy’ output truncated before terminating nul copying 8 bytes from a string of the same length [-Wstringop-truncation] strncpy(uHeader.stHeader.magic, FLASHFS_MAGIC, 8); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Initialize the header struct statically here instead to silence the warning. Suggested-by: Segher Boessenkool Signed-off-by: Thomas Huth --- romfs/tools/create_crc.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/romfs/tools/create_crc.c b/romfs/tools/create_crc.c index e354339..475b184 100644 --- a/romfs/tools/create_crc.c +++ b/romfs/tools/create_crc.c @@ -72,10 +72,12 @@ createHeaderImage(int notime) char dastr[16] = { 0, }; unsigned long long da = 0; - struct stH stHeader; - - /* initialize Header */ - memset(&stHeader, 0x00, sizeof(stHeader)); + struct stH stHeader = { + .magic = FLASHFS_MAGIC, + .platform_name = FLASHFS_PLATFORM_MAGIC, + .platform_revision = FLASHFS_PLATFORM_REVISION, + .ui64FileEnd = -1, + }; /* read driver info */ if (NULL != (pcVersion = getenv("DRIVER_NAME"))) { @@ -104,17 +106,6 @@ createHeaderImage(int notime) } memcpy(stHeader.date, &da, 8); - /* write Magic value into data stream */ - strncpy(stHeader.magic, FLASHFS_MAGIC, 8); - /* write platform name into data stream */ - strcpy(stHeader.platform_name, FLASHFS_PLATFORM_MAGIC); - /* write platform revision into data stream */ - strcpy(stHeader.platform_revision, FLASHFS_PLATFORM_REVISION); - - - /* fill end of file info (8 bytes of FF) into data stream */ - stHeader.ui64FileEnd = -1; - /* read address of next file and address of header date, both are 64 bit values */ ui64RomAddr = 0; ui64DataAddr = 0; From patchwork Thu Jul 19 12:46:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 946281 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41WYgN0wGWz9s3x for ; Thu, 19 Jul 2018 22:46:56 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41WYgM6PrSzDqGH for ; Thu, 19 Jul 2018 22:46:55 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=redhat.com (client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=thuth@redhat.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41WYfx2CN3zDq6t for ; Thu, 19 Jul 2018 22:46:33 +1000 (AEST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0D93AB5C2; Thu, 19 Jul 2018 12:46:31 +0000 (UTC) Received: from thh440s.str.redhat.com (dhcp-200-180.str.redhat.com [10.33.200.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 851C5111AF0C; Thu, 19 Jul 2018 12:46:30 +0000 (UTC) From: Thomas Huth To: slof@lists.ozlabs.org Date: Thu, 19 Jul 2018 14:46:26 +0200 Message-Id: <1532004387-3123-4-git-send-email-thuth@redhat.com> In-Reply-To: <1532004387-3123-1-git-send-email-thuth@redhat.com> References: <1532004387-3123-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 19 Jul 2018 12:46:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 19 Jul 2018 12:46:31 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' Subject: [SLOF] [PATCH v2 3/4] romfs/tools: Silence more compiler warnings with GCC 8.1 X-BeenThere: slof@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "Patches for https://github.com/aik/SLOF" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: slof-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "SLOF" GCC 8 complains about the following usages of strncpy, too: create_crc.c:86:3: warning: ‘strncpy’ specified bound 16 equals destination size [-Wstringop-truncation] strncpy(uHeader.stHeader.version, pcVersion, 16); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ create_crc.c:84:3: warning: ‘strncpy’ specified bound 16 equals destination size [-Wstringop-truncation] strncpy(uHeader.stHeader.version, pcVersion, 16); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Let's work around the issue by using memcpy instead. Signed-off-by: Thomas Huth --- romfs/tools/create_crc.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/romfs/tools/create_crc.c b/romfs/tools/create_crc.c index 475b184..b44c911 100644 --- a/romfs/tools/create_crc.c +++ b/romfs/tools/create_crc.c @@ -23,6 +23,8 @@ #include "createcrc.h" #include "crclib.h" +#define min(a, b) ((a) < (b) ? (a) : (b)) + /* file length in bytes */ static uint64_t ui64globalFileSize = 0; /* space for the file stream >= 4MB + 4bytes */ @@ -80,13 +82,13 @@ createHeaderImage(int notime) }; /* read driver info */ - if (NULL != (pcVersion = getenv("DRIVER_NAME"))) { - strncpy(stHeader.version, pcVersion, 16); - } else if (NULL != (pcVersion = getenv("USER"))) { - strncpy(stHeader.version, pcVersion, 16); - } else if (pcVersion == NULL) { - strncpy(stHeader.version, "No known user!", 16); - } + pcVersion = getenv("DRIVER_NAME"); + if (!pcVersion) + pcVersion = getenv("USER"); + if (!pcVersion) + pcVersion = "unknown"; + memcpy(stHeader.version, pcVersion, + min(strlen(pcVersion), sizeof(stHeader.version))); if (!notime) { /* read time and write it into data stream */ From patchwork Thu Jul 19 12:46:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 946282 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41WYgS0mRxz9s3x for ; Thu, 19 Jul 2018 22:47:00 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41WYgR6DHrzDqCQ for ; Thu, 19 Jul 2018 22:46:59 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=redhat.com (client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=thuth@redhat.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41WYfy0CFMzDq6t for ; Thu, 19 Jul 2018 22:46:33 +1000 (AEST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C03FD40363A8; Thu, 19 Jul 2018 12:46:31 +0000 (UTC) Received: from thh440s.str.redhat.com (dhcp-200-180.str.redhat.com [10.33.200.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4455D111AF0C; Thu, 19 Jul 2018 12:46:31 +0000 (UTC) From: Thomas Huth To: slof@lists.ozlabs.org Date: Thu, 19 Jul 2018 14:46:27 +0200 Message-Id: <1532004387-3123-5-git-send-email-thuth@redhat.com> In-Reply-To: <1532004387-3123-1-git-send-email-thuth@redhat.com> References: <1532004387-3123-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 19 Jul 2018 12:46:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 19 Jul 2018 12:46:31 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' Subject: [SLOF] [PATCH v2 4/4] Makefile: Set a proper DRIVER_NAME when building from a git tree X-BeenThere: slof@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "Patches for https://github.com/aik/SLOF" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: slof-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "SLOF" The DRIVER_NAME environment variable is not set up correctly for the build_romfs tool in case we build from a git tree, so the field in the rom header did not contain much useful data. Let's use the revision string from git as DRIVER_NAME in this case. Signed-off-by: Thomas Huth --- Makefile.gen | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.gen b/Makefile.gen index 2fdf23f..f18c57a 100644 --- a/Makefile.gen +++ b/Makefile.gen @@ -23,6 +23,7 @@ export DRIVER_NAME=$(shell cat ../VERSION | sed -e "s/-/./g" | awk -F . '{ print else ifneq (,$(wildcard ../.git)) RELEASE=git-$(shell git rev-parse --short=16 HEAD) +export DRIVER_NAME=git-$(shell git rev-parse --short=12 HEAD) else ifneq (,$(shell cat ../VERSION)) RELEASE="$(USER)@$(HOSTNAME) release $(shell cat ../VERSION)"