Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8F061C433F5 for ; Fri, 25 Feb 2022 22:10:38 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3F2A383775; Fri, 25 Feb 2022 23:10:36 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=dh-electronics.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=dh-electronics.com header.i=@dh-electronics.com header.b="MekPVp/v"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5216583BB3; Fri, 25 Feb 2022 23:10:35 +0100 (CET) Received: from mx2.securetransport.de (mx2.securetransport.de [IPv6:2a03:4000:13:6c7::1]) by phobos.denx.de (Postfix) with ESMTP id 9479883775 for ; Fri, 25 Feb 2022 23:10:31 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=dh-electronics.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=cniedermaier@dh-electronics.com Received: from mail.dh-electronics.com (business-24-134-97-169.pool2.vodafone-ip.de [24.134.97.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.securetransport.de (Postfix) with ESMTPSA id 02B995EA00; Fri, 25 Feb 2022 23:10:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dh-electronics.com; s=dhelectronicscom; t=1645827021; bh=mdRE5Uoy0P8iH4gdR+piFyUclvevi4Huivw/giYKMMU=; h=From:To:CC:Subject:Date:From; b=MekPVp/vAzimbRhg0+Xokpra1oWBSCf1HpBwUgIQkiOQ4NTpso9APktTfg7GAdKpb 1aJpU7+ycA68CgcQBPdpt2FikknqYZY4ZTbQZCn6o7Yvq0xdVDRMxKAzJqJkWwowjm 5RVVVj1d6DJshATUvG5m48BE9/svd+S2q6MW/XRvzj2drYmxmjMKVCJ+EWCngjkDew xJLnql8RD+scN2oGxy7B69lUuP1/KSukyo7TGtniSS8YL5lrga9+n/SaBccAodJZOD WZoofc+hql4kahqY2UuEwh6jHGT5VIoWYOnKGYBqcDUn5vmV1F0kqJiOUyr8IlRvfH rxHqFFfKG/sCg== Received: from DHPWEX01.DH-ELECTRONICS.ORG (10.64.2.30) by DHPWEX01.DH-ELECTRONICS.ORG (10.64.2.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15; Fri, 25 Feb 2022 23:10:17 +0100 Received: from localhost.localdomain (172.16.51.2) by DHPWEX01.DH-ELECTRONICS.ORG (10.64.2.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15 via Frontend Transport; Fri, 25 Feb 2022 23:10:16 +0100 From: Christoph Niedermaier To: CC: Christoph Niedermaier , Stefano Babic , Simon Glass , =?UTF-8?q?Marek=20Beh=C3=BAn?= Subject: [PATCH V2] Makefile: Sort u-boot-initial-env output Date: Fri, 25 Feb 2022 23:08:41 +0100 Message-ID: <20220225220841.6912-1-cniedermaier@dh-electronics.com> X-Mailer: git-send-email 2.11.0 X-klartext: yes MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean This will sort the default environment file generated by "make u-boot-initial-env", but won't sort the default environment in the compiled u-boot binary. The file u-boot-initial-env is considered to use for the userpace environment access tools [1] in case of that the environments is written the first time into its location. This is done on the one hand for a better overview and comparison of the generated environment file. On the other hand it is to synchronize the output with the script get_default_env.sh, which generated a sorted default environment file. The sorting preserves the order of equal variable names by sorting only the variable name, and disable the last-resort comparison. After sorting, unnoticed blank lines at the end move to the top. Avoid that by removing it before sorting. [1] https://github.com/sbabic/libubootenv Signed-off-by: Christoph Niedermaier Cc: Stefano Babic Cc: Simon Glass Cc: Marek BehĂșn To: u-boot@lists.denx.de --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 66d9e78cc7..a6a94dc681 100644 --- a/Makefile +++ b/Makefile @@ -2441,7 +2441,8 @@ endif quiet_cmd_genenv = GENENV $@ cmd_genenv = $(OBJCOPY) --dump-section .rodata.default_environment=$@ env/common.o; \ - sed --in-place -e 's/\x00/\x0A/g' $@ + sed --in-place -e 's/\x00/\x0A/g' $@; sed --in-place -e '/^\s*$$/d' $@; \ + sort --field-separator== -k1,1 --stable $@ -o $@ u-boot-initial-env: u-boot.bin $(call if_changed,genenv) -- 2.11.0