From patchwork Tue Mar 1 08:38:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christoph Niedermaier X-Patchwork-Id: 1599223 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=dh-electronics.com header.i=@dh-electronics.com header.a=rsa-sha256 header.s=dhelectronicscom header.b=c1j2psn8; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K7F6J6Vyxz9sGN for ; Tue, 1 Mar 2022 22:15:36 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 24E9C83CDE; Tue, 1 Mar 2022 09:42:30 +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="c1j2psn8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EB4AE83D0B; Tue, 1 Mar 2022 09:42:27 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mx2.securetransport.de (mx2.securetransport.de [188.68.39.254]) by phobos.denx.de (Postfix) with ESMTP id 8F3D483CC6 for ; Tue, 1 Mar 2022 09:42:24 +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 E0AF05E9A9; Tue, 1 Mar 2022 09:42:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dh-electronics.com; s=dhelectronicscom; t=1646124134; bh=3OJrl7RFbJX4NYACS8Z563L/Giq4THEZm4ScvgR8Ebc=; h=From:To:CC:Subject:Date:From; b=c1j2psn8ODibQovO9+9tJj2uP8SfPGshq9hHJhRDfVrSap4gdZAZbc72SbBLdn/QU gF5bIbjRW0XczO/HDKrPl5ZnxxSMedsuil0RUbG0renVUVEbpQoebKcR7k8Q70LWZa lAWegzor02sdyKt5zzFTHeyh5BApd2kjhaf/UP1EoXl3RoOHnnMHkruGycOLIGfuk0 XLKOImr0n/uIJ15oPgXRpSmF3MjjbVa64dt5P4YD6IOxtLlrtU24EBcoxPc5WZm9Co zc8Fe7nCH/avEWMVZLOZ8PGhx/LB8A9Jc1yE0YalRPG5mcQx5g4pdNcsLPUnEtvJmk h1YqGPldafRpw== 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; Tue, 1 Mar 2022 09:42:11 +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; Tue, 1 Mar 2022 09:42:11 +0100 From: Christoph Niedermaier To: CC: Christoph Niedermaier , Stefano Babic , Simon Glass , =?utf-8?q?M?= =?utf-8?q?arek_Beh=C3=BAn?= Subject: [PATCH V3] Makefile: Sort u-boot-initial-env output Date: Tue, 1 Mar 2022 09:38:51 +0100 Message-ID: <20220301083851.2677-1-cniedermaier@dh-electronics.com> X-Mailer: git-send-email 2.11.0 X-klartext: yes MIME-Version: 1.0 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 Reviewed-by: Stefano Babic Tested-by: Stefano Babic Cc: Stefano Babic Cc: Simon Glass Cc: Marek BehĂșn To: u-boot@lists.denx.de Reviewed-by: Simon Glass --- V2: - More detailed description of the patch in the commit message V3: - Add forgotten tags --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e6fc80aa6f..603747c3cc 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)