From: Tom Rini Date: Tue, 27 Apr 2021 12:46:28 -0400 Subject: [PATCH] Makefile: fix generation of defaultenv.h from empty initial file In-Reply-To: <20210422074418.1573153-1-rasmus.villemoes@prevas.dk> References: <20210422074418.1573153-1-rasmus.villemoes@prevas.dk> Message-ID: <20210427164628.GW17669@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, Apr 22, 2021 at 09:44:18AM +0200, Rasmus Villemoes wrote: > When CONFIG_USE_DEFAULT_ENV_FILE=y and the file > CONFIG_DEFAULT_ENV_FILE is empty (or at least doesn't contain any > non-comment, non-empty lines), we end up feeding nothing into xxd, > which in turn then outputs nothing. Then blindly appending ", 0x00" > means that we end up trying to compile (roughly) > > const char defaultenv[] = { , 0x00 } > > which is of course broken. > > To fix that, change the frobbing of the text file so that we always > end up printing an extra empty line (which gets turned into that extra > nul byte we need) - that corresponds better to the binary format > consisting of a series of key=val nul terminated strings, terminated > by an empty string. > > Reported-by: Oleksandr Suvorov > Signed-off-by: Rasmus Villemoes > Reviewed-by: Oleksandr Suvorov Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: