From patchwork Sun Dec 10 17:10:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schmitz X-Patchwork-Id: 846680 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hDwjARh1"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yvt015nQQz9s72 for ; Mon, 11 Dec 2017 04:10:52 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 396E62F165; Sun, 10 Dec 2017 17:10:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mn0fVUIpt0zC; Sun, 10 Dec 2017 17:10:48 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id AAC3B2A358; Sun, 10 Dec 2017 17:10:47 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 03CCA1C24A1 for ; Sun, 10 Dec 2017 17:10:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id F1454878A4 for ; Sun, 10 Dec 2017 17:10:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zEoCgty20Edf for ; Sun, 10 Dec 2017 17:10:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by whitealder.osuosl.org (Postfix) with ESMTPS id 3ABA68779C for ; Sun, 10 Dec 2017 17:10:46 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id i11so10260639wmf.4 for ; Sun, 10 Dec 2017 09:10:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=wGvkEy0ydi/k6WKTQAFDLt00GKXepvxXafL5cA4dPXA=; b=hDwjARh1PGJqBgGqg5ab802WFExK2CyqKv9HKB/JpytoOBYN7zuZ7iIBx7raNZ4amj RF2LnxMVZUz5Z9tESKoTKijRgTFYSw4Fm2DH0CDy1Fn2HWr4+WbWR66atWSYrUhBnUY8 yilGdI/x8FdVlkTdJELIVIREVT9o947UedAmrXB/wBWU1erlcpVEJ6uEyc4H4WCwk7A9 5O1biTxpXJ9s046EsxSGcLJ8Pf2/8C7KRJSI4I+8AfJR3300I7UJP6uNHW8LZdXL0fW3 9RGKutHx7AS1DaKZbGID/IkoTqHF1AC9tKJjSFkK9Af7OSkGJSSRpliYdEx1GvTPeAx7 SwUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=wGvkEy0ydi/k6WKTQAFDLt00GKXepvxXafL5cA4dPXA=; b=OAD1oFXtby6Bztmw9jw6Ec1mrAB6Hb2/3HWQFdlHiiLZYfWA8umWc+I904Hx71BVBD 98b293XwF15hazffTMF5TtPcWpJZODo5gH96xFDBNwmdHoTuKp6d+pPfmdMw44nIIXKF WceTJNcw2G8cFPmeUO8t9ka0ElvpqqhJ92XZ3NL4/ehKYa9Fm81Qu0XyVRBr2KnDVZy6 DCPUSP3j3VdPYoDD7VKOed0ostdmtrl6YDcM/OC8GQOpe5UgkdpXGgOC5WUH5J9ZzPj1 IOxZpKwyrnTIP1cxr1YgrsQ/9uDK6u/T859QXQ/0EDKTaNFcYokCIaj796R2NPMgAcvX WONA== X-Gm-Message-State: AKGB3mIjimFwUKMBGVGuT/Ez8Jbp0GdlFUP5TYy1tgRP4pADZbV8uW47 YFuM7sDww/Mn/JQ/C2Wnmz2iedvo X-Google-Smtp-Source: AGs4zMZtHJ7zz/9/sJAePGJcSHeb0pKFbCj5u+5/FotIiqcRQ6P1S9AVxqVDB3oUs4plxJIcal7DVA== X-Received: by 10.28.96.195 with SMTP id u186mr8273065wmb.121.1512925844469; Sun, 10 Dec 2017 09:10:44 -0800 (PST) Received: from metis.ti.rwth-aachen.de (metis.ti.rwth-aachen.de. [134.130.35.68]) by smtp.gmail.com with ESMTPSA id y84sm6714201wmg.39.2017.12.10.09.10.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 10 Dec 2017 09:10:43 -0800 (PST) From: Johannes Schmitz To: buildroot@buildroot.org Date: Sun, 10 Dec 2017 18:10:41 +0100 Message-Id: <1512925841-788-1-git-send-email-johannes.schmitz1@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [Buildroot] [PATCH 1/1] boot/uboot: add config option for uboot environment padding byte X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Johannes Schmitz , yann.morin.1998@free.fr MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The size of the uboot environment (which is provided in bytes -> help text updated) as well as the padding bytes have to be exactly correct in order to generate an image with the correct CRC checksum that can be read by the target during boot. Hence we add the option to specify the padding byte which is used by mkenvimage and updated the help texts to inform the user about the importance of these parameters. Also cleaned up and reindented all mkenvimage parameters. Signed-off-by: Johannes Schmitz --- boot/uboot/Config.in | 11 +++++++++-- boot/uboot/uboot.mk | 10 ++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in index 8215912..b52fb81 100644 --- a/boot/uboot/Config.in +++ b/boot/uboot/Config.in @@ -400,8 +400,15 @@ config BR2_TARGET_UBOOT_ENVIMAGE_SOURCE config BR2_TARGET_UBOOT_ENVIMAGE_SIZE string "Size of environment" help - Size of envronment, can be prefixed with 0x for hexadecimal - values. + Size of environment in bytes, can be prefixed with 0x for hexadecimal + values. Needs to match exactly for correct CRC checksum calculation. + +config BR2_TARGET_UBOOT_ENVIMAGE_PADDING_BYTE + hex "Padding byte" + default 0x00 + help + The byte used for padding at the end of the environment image. + Needs to be correct for correct CRC checksum calculation. config BR2_TARGET_UBOOT_ENVIMAGE_REDUNDANT bool "Environment has two copies" diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk index a1fac7d..8796e8d 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -251,10 +251,12 @@ define UBOOT_INSTALL_IMAGES_CMDS ) $(if $(BR2_TARGET_UBOOT_ENVIMAGE), cat $(call qstrip,$(BR2_TARGET_UBOOT_ENVIMAGE_SOURCE)) | \ - $(HOST_DIR)/bin/mkenvimage -s $(BR2_TARGET_UBOOT_ENVIMAGE_SIZE) \ - $(if $(BR2_TARGET_UBOOT_ENVIMAGE_REDUNDANT),-r) \ - $(if $(filter BIG,$(BR2_ENDIAN)),-b) \ - -o $(BINARIES_DIR)/uboot-env.bin -) + $(HOST_DIR)/bin/mkenvimage \ + $(if $(BR2_TARGET_UBOOT_ENVIMAGE_REDUNDANT),-r) \ + $(if $(filter BIG,$(BR2_ENDIAN)),-b) \ + -p $(BR2_TARGET_UBOOT_ENVIMAGE_PADDING_BYTE) \ + -s $(BR2_TARGET_UBOOT_ENVIMAGE_SIZE) \ + -o $(BINARIES_DIR)/uboot-env.bin -) $(if $(BR2_TARGET_UBOOT_BOOT_SCRIPT), $(HOST_DIR)/bin/mkimage -C none -A $(MKIMAGE_ARCH) -T script \ -d $(call qstrip,$(BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE)) \