From 12d42d06a5f6e31f1a4c1940aa7f88824b70ad82 Mon Sep 17 00:00:00 2001 From: Luka Perkov Date: Thu, 26 Jun 2014 10:13:47 +0000 Subject: kirkwood: move kirkwood.sh to /lib/ for consistency Signed-off-by: Luka Perkov git-svn-id: svn://svn.openwrt.org/openwrt/trunk@41338 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../kirkwood/base-files/etc/uci-defaults/01_leds | 2 +- .../base-files/etc/uci-defaults/02_network | 2 +- .../kirkwood/base-files/lib/functions/kirkwood.sh | 58 ---------------------- target/linux/kirkwood/base-files/lib/kirkwood.sh | 58 ++++++++++++++++++++++ 4 files changed, 60 insertions(+), 60 deletions(-) delete mode 100755 target/linux/kirkwood/base-files/lib/functions/kirkwood.sh create mode 100755 target/linux/kirkwood/base-files/lib/kirkwood.sh (limited to 'target/linux/kirkwood') diff --git a/target/linux/kirkwood/base-files/etc/uci-defaults/01_leds b/target/linux/kirkwood/base-files/etc/uci-defaults/01_leds index cdaac813f8..07c1a0ec00 100644 --- a/target/linux/kirkwood/base-files/etc/uci-defaults/01_leds +++ b/target/linux/kirkwood/base-files/etc/uci-defaults/01_leds @@ -4,7 +4,7 @@ # . /lib/functions/uci-defaults.sh -. /lib/functions/kirkwood.sh +. /lib/kirkwood.sh board=$(kirkwood_board_name) diff --git a/target/linux/kirkwood/base-files/etc/uci-defaults/02_network b/target/linux/kirkwood/base-files/etc/uci-defaults/02_network index 949e4d71a7..e795d65dc1 100644 --- a/target/linux/kirkwood/base-files/etc/uci-defaults/02_network +++ b/target/linux/kirkwood/base-files/etc/uci-defaults/02_network @@ -21,7 +21,7 @@ EOF } . /lib/functions/uci-defaults.sh -. /lib/functions/kirkwood.sh +. /lib/kirkwood.sh board=$(kirkwood_board_name) diff --git a/target/linux/kirkwood/base-files/lib/functions/kirkwood.sh b/target/linux/kirkwood/base-files/lib/functions/kirkwood.sh deleted file mode 100755 index ba080f4a7a..0000000000 --- a/target/linux/kirkwood/base-files/lib/functions/kirkwood.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2014 OpenWrt.org -# - -KIRKWOOD_BOARD_NAME= -KIRKWOOD_MODEL= - -kirkwood_board_detect() { - local machine - local name - - machine=$(cat /proc/device-tree/model) - - case "$machine" in - "Seagate FreeAgent Dockstar") - name="dockstar" - ;; - - "Iomega Iconnect") - name="iconnect" - ;; - - "RaidSonic ICY BOX IB-NAS62x0 (Rev B)") - name="ib62x0" - ;; - - "Cloud Engines Pogoplug E02") - name="pogo_e02" - ;; - - "Linksys EA4500") - name="ea4500" - ;; - - *) - name="generic" - ;; - esac - - [ -z "$KIRKWOOD_BOARD_NAME" ] && KIRKWOOD_BOARD_NAME="$name" - [ -z "$KIRKWOOD_MODEL" ] && KIRKWOOD_MODEL="$machine" - - [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" - - echo "$KIRKWOOD_BOARD_NAME" > /tmp/sysinfo/board_name - echo "$KIRKWOOD_MODEL" > /tmp/sysinfo/model -} - -kirkwood_board_name() { - local name - - [ -f /tmp/sysinfo/board_name ] || kirkwood_board_detect - [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name) - [ -z "$name" ] && name="unknown" - - echo "$name" -} diff --git a/target/linux/kirkwood/base-files/lib/kirkwood.sh b/target/linux/kirkwood/base-files/lib/kirkwood.sh new file mode 100755 index 0000000000..ba080f4a7a --- /dev/null +++ b/target/linux/kirkwood/base-files/lib/kirkwood.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# +# Copyright (C) 2014 OpenWrt.org +# + +KIRKWOOD_BOARD_NAME= +KIRKWOOD_MODEL= + +kirkwood_board_detect() { + local machine + local name + + machine=$(cat /proc/device-tree/model) + + case "$machine" in + "Seagate FreeAgent Dockstar") + name="dockstar" + ;; + + "Iomega Iconnect") + name="iconnect" + ;; + + "RaidSonic ICY BOX IB-NAS62x0 (Rev B)") + name="ib62x0" + ;; + + "Cloud Engines Pogoplug E02") + name="pogo_e02" + ;; + + "Linksys EA4500") + name="ea4500" + ;; + + *) + name="generic" + ;; + esac + + [ -z "$KIRKWOOD_BOARD_NAME" ] && KIRKWOOD_BOARD_NAME="$name" + [ -z "$KIRKWOOD_MODEL" ] && KIRKWOOD_MODEL="$machine" + + [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" + + echo "$KIRKWOOD_BOARD_NAME" > /tmp/sysinfo/board_name + echo "$KIRKWOOD_MODEL" > /tmp/sysinfo/model +} + +kirkwood_board_name() { + local name + + [ -f /tmp/sysinfo/board_name ] || kirkwood_board_detect + [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name) + [ -z "$name" ] && name="unknown" + + echo "$name" +} -- cgit v1.2.3