From patchwork Sat Dec 6 14:14:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Jackiewicz X-Patchwork-Id: 418394 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E0FD41400DD for ; Sun, 7 Dec 2014 01:14:52 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 45AFE28BFD6; Sat, 6 Dec 2014 15:13:03 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id B4AE9284680 for ; Sat, 6 Dec 2014 15:12:53 +0100 (CET) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-wg0-f48.google.com (mail-wg0-f48.google.com [74.125.82.48]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Sat, 6 Dec 2014 15:12:53 +0100 (CET) Received: by mail-wg0-f48.google.com with SMTP id y19so2989462wgg.21 for ; Sat, 06 Dec 2014 06:14:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mime-version:content-type :content-transfer-encoding; bh=yQy9gTzXW+cX6zuohi774wWKJEWfskErBUwP6tANmVk=; b=A350A8yNixqgFxRNEyPV3eO6EfxZC6JNZFNpqsGg73uKBh6w8DmEICWMxRwRYJxfiz Yq7brYgfhg4WElkAZXKv0xvioxJeXW6eiVXSgwPqknR8AdIsKjliJWN+fDB0GgcH8AJk rCkD14Uan78xDCnBlc1Dh/VvEjO+VGSQzqsjP8Fa9uzU+NE4oMgtTrrkAIacULPMMA1H mM0zh8UOx8/j9iv+ie9/pKYiUd25OqV8mXP2VRlug2/jIW55m9qkFPYu58W99hsH/Grq 8StEG3fPKGvvlcYHVsKfLPk8jHLRpq+ef6xGg1E3GOCiWcu112TPDCXIwxjXUf+92h1r m3Hg== X-Received: by 10.194.2.164 with SMTP id 4mr31139561wjv.55.1417875274271; Sat, 06 Dec 2014 06:14:34 -0800 (PST) Received: from samsung (178235241016.warszawa.vectranet.pl. [178.235.241.16]) by mx.google.com with ESMTPSA id bo18sm2026958wib.11.2014.12.06.06.14.31 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Sat, 06 Dec 2014 06:14:33 -0800 (PST) Date: Sat, 6 Dec 2014 15:14:25 +0100 From: Cezary Jackiewicz To: openwrt-devel@lists.openwrt.org Message-ID: <20141206151425.0ba597cd@samsung> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.23; x86_64-pc-linux-gnu) MIME-Version: 1.0 Subject: [OpenWrt-Devel] [PATCH] kirkwood: add a script to detect the board name and populate /tmp/sysinfo. X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Add a script to detect the board name and populate /tmp/sysinfo. Sets the status LED for Linksys EA4500. Signed-off-by: Cezary Jackiewicz diff --git a/target/linux/kirkwood/base-files/etc/diag.sh b/target/linux/kirkwood/base-files/etc/diag.sh new file mode 100755 index 0000000..bd6bd98 --- /dev/null +++ b/target/linux/kirkwood/base-files/etc/diag.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# Copyright (C) 2014 OpenWrt.org + +. /lib/functions/leds.sh +. /lib/kirkwood.sh + +get_status_led() { + case $(kirkwood_board_name) in + ea4500) + status_led="ea4500:white:health" + ;; + esac +} + +set_state() { + get_status_led + + case "$1" in + preinit) + status_led_blink_preinit + ;; + failsafe) + status_led_blink_failsafe + ;; + done) + status_led_on + ;; + esac +}