From patchwork Wed Feb 24 16:50:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Hrubis X-Patchwork-Id: 1443971 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (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 ozlabs.org (Postfix) with ESMTPS id 4Dm2330nMTz9sTD for ; Thu, 25 Feb 2021 03:50:06 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 712243C5A9F for ; Wed, 24 Feb 2021 17:50:04 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [IPv6:2001:4b78:1:20::2]) by picard.linux.it (Postfix) with ESMTP id B95A13C5A6A for ; Wed, 24 Feb 2021 17:49:25 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-2.smtp.seeweb.it (Postfix) with ESMTPS id 78880601A75 for ; Wed, 24 Feb 2021 17:49:25 +0100 (CET) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 5FD9AAF9C; Wed, 24 Feb 2021 16:49:24 +0000 (UTC) From: Cyril Hrubis To: ltp@lists.linux.it Date: Wed, 24 Feb 2021 17:50:44 +0100 Message-Id: <20210224165045.17738-5-chrubis@suse.cz> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210224165045.17738-1-chrubis@suse.cz> References: <20210224165045.17738-1-chrubis@suse.cz> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-2.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.2 required=7.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-2.smtp.seeweb.it Subject: [LTP] [PATCH v2 4/5] Sample hardware discovery and reconfigure scripts X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michal Simek , Carlos Hernandez , automated-testing@yoctoproject.org, Orson Zhai Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" This is not going to be part of the final patchset. Signed-off-by: Cyril Hrubis --- hardware-discovery.sh | 36 ++++++++++++++++++++++++++++++++++++ hardware-reconfigure.sh | 3 +++ 2 files changed, 39 insertions(+) create mode 100755 hardware-discovery.sh create mode 100755 hardware-reconfigure.sh diff --git a/hardware-discovery.sh b/hardware-discovery.sh new file mode 100755 index 000000000..2d1eeefaa --- /dev/null +++ b/hardware-discovery.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +if [ "$1" = "UART-loopback" ]; then + echo '{' + echo ' "reconfigure": "hardware-reconfigure.sh",' + echo ' "hwconfs": [' + echo ' {' + echo ' "uid": "ttyUSB0-ttyUSB0-01",' + echo ' "tx": "/dev/ttyUSB0",' + echo ' "rx": "/dev/ttyUSB0",' + echo ' "hwflow": 0,' + echo ' "baud_rates": [' + echo ' 4800,' + echo ' 9600,' + echo ' 19200' + echo ' ]' + echo ' },' + echo ' {' + echo ' "uid": "ttyUSB0-ttyUSB0-02",' + echo ' "tx": "/dev/ttyUSB0",' + echo ' "rx": "/dev/ttyUSB0",' + echo ' "hwflow": 1,' + echo ' "baud_rates": [' + echo ' 4800,' + echo ' 9600,' + echo ' 19200' + echo ' ]' + echo ' }' + echo ' ]' + echo '}' + + exit 0 +fi + +echo '{}' +exit 0 diff --git a/hardware-reconfigure.sh b/hardware-reconfigure.sh new file mode 100755 index 000000000..079f6588a --- /dev/null +++ b/hardware-reconfigure.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "Reconfigure '$@'"