All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [PATCH] Makefile: fix generation of defaultenv.h from empty initial file
Date: Tue, 27 Apr 2021 12:46:28 -0400	[thread overview]
Message-ID: <20210427164628.GW17669@bill-the-cat> (raw)
In-Reply-To: <20210422074418.1573153-1-rasmus.villemoes@prevas.dk>

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 <oleksandr.suvorov@toradex.com>
> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

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: <https://lists.denx.de/pipermail/u-boot/attachments/20210427/6a9cafe4/attachment.sig>

      parent reply	other threads:[~2021-04-27 16:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-20 14:43 [PATCH v2] Makefile: fix generating environment file Oleksandr Suvorov
2021-04-20 19:33 ` Rasmus Villemoes
2021-04-20 21:10   ` Oleksandr Suvorov
2021-04-20 21:33     ` Rasmus Villemoes
2021-04-21 15:21       ` Oleksandr Suvorov
2021-04-21 20:55         ` Rasmus Villemoes
2021-04-22  6:34           ` Oleksandr Suvorov
2021-04-22  7:44             ` [PATCH] Makefile: fix generation of defaultenv.h from empty initial file Rasmus Villemoes
2021-04-22  9:26               ` Oleksandr Suvorov
2021-04-27 16:46               ` Tom Rini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210427164628.GW17669@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.