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 4C9EAEB64DD for ; Tue, 25 Jul 2023 21:08:57 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7CDF586768; Tue, 25 Jul 2023 23:08:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="KuDpvjfr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5BA8C8602A; Tue, 25 Jul 2023 23:08:53 +0200 (CEST) Received: from mail-vk1-xa34.google.com (mail-vk1-xa34.google.com [IPv6:2607:f8b0:4864:20::a34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BCA2C8602A for ; Tue, 25 Jul 2023 23:08:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-vk1-xa34.google.com with SMTP id 71dfb90a1353d-486198c70adso950827e0c.0 for ; Tue, 25 Jul 2023 14:08:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1690319329; x=1690924129; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=hAPB9FqjYVehQtcI43N91S92rZMntDP+OOE9P3jOpek=; b=KuDpvjfrjuGYlrsLYdE2GLUVKbw3i5ANHqJGQieaG9orThNaJsDldmVuLESPmRixIJ d1rTZcECLychEQxicTwwdo853Cu6xMfC9MkOKNlcMk/cAjyxiWqYfNj1tjAHlJUxYYco CfCb90rkt+Eriqcd2chWyd0/rrgKDpKD6Kx2M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690319329; x=1690924129; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hAPB9FqjYVehQtcI43N91S92rZMntDP+OOE9P3jOpek=; b=heUUxZX+vC6yiiFnVc59PCufIWXej/joDfoQKTt79yNSORWRilh97q9zZP7sk5XZ3Q CyPIbL89vXQmFNP0APPRVRw5dxPzOuwbYrPEu7BxFY6hg4Xltzhrw9Jj/n7WWh2hRpN4 Xaabb9ixWhEdTVr4Al8j20pv5EejNs1to/NZ5qLDN1IZunSI4JBnI+DeWwF3v7MX1FAl sVPXF2kv8zB/s9fUi+9vcQkoSz/Y0UGh7Dsx9TeIZwGFXoADJufo8rdFa0QHW9EFCBhF FOznOvsgGsB3VUq+jn9JBuKc4qfRC6UMP5SnCeLsXNjLp9tR8qMDo9xgl1IgXRehr1Tu eyqA== X-Gm-Message-State: ABy/qLYUA6b8ESlago8QQ2C8ANFaS9g9ad4ZnFdf1ovb5cIUOYAzSV88 hQxkLTZs5irGHf60uXcMf2MI1R3WRkEuStFgiqFy+w== X-Google-Smtp-Source: APBJJlEmswNLc66F5OUDiD9GBzsGhMGJhxwqkYkhoLnlOtpG0P8Ihlc/LncELCC6n0kdFpa47w62iA== X-Received: by 2002:a67:e3cb:0:b0:444:e9a0:13f7 with SMTP id k11-20020a67e3cb000000b00444e9a013f7mr174361vsm.5.1690319329277; Tue, 25 Jul 2023 14:08:49 -0700 (PDT) Received: from bill-the-cat.lan (2603-6081-7b00-6400-b236-e3a5-57be-379d.res6.spectrum.com. [2603:6081:7b00:6400:b236:e3a5:57be:379d]) by smtp.gmail.com with ESMTPSA id z26-20020ab0565a000000b0078f3657faa5sm366825uaa.36.2023.07.25.14.08.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jul 2023 14:08:48 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Subject: [u-boot-test-hooks 1/4] bin/flash.sdwire_common_mount: Switch to sourcing the next writer script Date: Tue, 25 Jul 2023 17:08:44 -0400 Message-Id: <20230725210847.1472585-1-trini@konsulko.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Rather than invoking the script that will write to the mounted directory as a binary, source it as a script so that it has access to more than just two parameters. This will allow us to have the same flexibility in our writers that other flash methods have. Signed-off-by: Tom Rini --- bin/flash.sdwire_common_mount | 3 ++- bin/writer.rpi3_mount | 19 +++++++------------ bin/writer.zynq_mount | 15 +++++---------- 3 files changed, 14 insertions(+), 23 deletions(-) diff --git a/bin/flash.sdwire_common_mount b/bin/flash.sdwire_common_mount index 6c763e62f47d..b76add064fb0 100644 --- a/bin/flash.sdwire_common_mount +++ b/bin/flash.sdwire_common_mount @@ -52,7 +52,8 @@ if ! mountpoint -q ${mount_dir}; then exit 1 fi -writer.${flash_writer} ${mount_dir} ${U_BOOT_BUILD_DIR} +# Perform the write, pass along as much environment as possible +. writer.${flash_writer} complete=false for i in {0..9}; do diff --git a/bin/writer.rpi3_mount b/bin/writer.rpi3_mount index 97f24a5ac694..a63e7999e57b 100755 --- a/bin/writer.rpi3_mount +++ b/bin/writer.rpi3_mount @@ -20,23 +20,18 @@ # Writes rpi3_b to the board -# Args: -# $1: Mount point of the sdcard when board is off -# $2: U-Boot build directory - set -ex -mount=$1 -build=$2 +build=${U_BOOT_BUILD_DIR} -echo "Writing to ${mount} from build at ${build}" +echo "Writing to ${mount_dir} from build at ${build}" # First make a copy of the original files if we haven't already -if [[ ! -e ${mount}/config.orig ]]; then - cp ${mount}/config.txt ${mount}/config.orig +if [[ ! -e ${mount_dir}/config.orig ]]; then + cp ${mount_dir}/config.txt ${mount_dir}/config.orig fi -if [[ ! -e ${mount}/rpi3-u-boot.bin.orig ]]; then - cp ${mount}/rpi3-u-boot.bin ${mount}/rpi3-u-boot.bin.orig +if [[ ! -e ${mount_dir}/rpi3-u-boot.bin.orig ]]; then + cp ${mount_dir}/rpi3-u-boot.bin ${mount_dir}/rpi3-u-boot.bin.orig fi # Enable the UART and fix the GPU frequency so it works correctly @@ -46,4 +41,4 @@ if ! grep -q "^gpu_freq=250" /media/rpi3_b_boot/config.txt; then fi # Copy U-Boot over from the build directory -cp ${build}/u-boot.bin ${mount}/rpi3-u-boot.bin +cp ${build}/u-boot.bin ${mount_dir}/rpi3-u-boot.bin diff --git a/bin/writer.zynq_mount b/bin/writer.zynq_mount index 9d0958880422..c8395a40680e 100755 --- a/bin/writer.zynq_mount +++ b/bin/writer.zynq_mount @@ -20,22 +20,17 @@ # Writes zynq images to the board -# Args: -# $1: Mount point of the sdcard when board is off -# $2: U-Boot build directory - set -ex tmp=$(mktemp -d) -mount=$1 -build=$2 +build=${U_BOOT_BUILD_DIR} -echo "Writing to ${mount} from build at ${build}" +echo "Writing to ${mount_dir} from build at ${build}" # Copy U-Boot over from the build directory -cp ${build}/u-boot.bin ${mount}/rpi3-u-boot.bin +cp ${build}/u-boot.bin ${mount_dir}/rpi3-u-boot.bin zynq-boot-bin.py -o ${tmp}/boot.bin -u ${build}/spl/u-boot-spl-dtb.bin -cp ${tmp}/boot.bin ${mount}/BOOT.bin -cp ${build}/u-boot.img ${mount}/. +cp ${tmp}/boot.bin ${mount_dir}/BOOT.bin +cp ${build}/u-boot.img ${mount_dir}/. rm -rf ${tmp} -- 2.34.1