From ba3ad2451426b5a9db9294ed8ebedc7757c2c6e0 Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Tue, 29 May 2012 16:39:15 +0000 Subject: kirkwood: use uci-defaults to configure different boards Signed-off-by: Luka Perkov SVN-Revision: 31990 --- .../base-files-Dockstar/etc/config/network | 9 ---- .../kirkwood/base-files-Dockstar/etc/config/system | 21 -------- target/linux/kirkwood/base-files.mk | 3 ++ .../kirkwood/base-files/etc/uci-defaults/leds | 57 ++++++++++++++++++++++ .../kirkwood/base-files/etc/uci-defaults/network | 42 ++++++++++++++++ target/linux/kirkwood/base-files/lib/kirkwood.sh | 5 ++ 6 files changed, 107 insertions(+), 30 deletions(-) delete mode 100644 target/linux/kirkwood/base-files-Dockstar/etc/config/network delete mode 100644 target/linux/kirkwood/base-files-Dockstar/etc/config/system create mode 100644 target/linux/kirkwood/base-files.mk create mode 100644 target/linux/kirkwood/base-files/etc/uci-defaults/leds create mode 100644 target/linux/kirkwood/base-files/etc/uci-defaults/network create mode 100644 target/linux/kirkwood/base-files/lib/kirkwood.sh (limited to 'target/linux') diff --git a/target/linux/kirkwood/base-files-Dockstar/etc/config/network b/target/linux/kirkwood/base-files-Dockstar/etc/config/network deleted file mode 100644 index 9fd44f1..0000000 --- a/target/linux/kirkwood/base-files-Dockstar/etc/config/network +++ /dev/null @@ -1,9 +0,0 @@ -config 'interface' 'loopback' - option 'ifname' 'lo' - option 'proto' 'static' - option 'ipaddr' '127.0.0.1' - option 'netmask' '255.0.0.0' - -config 'interface' 'lan' - option 'ifname' 'eth0' - option 'proto' 'dhcp' diff --git a/target/linux/kirkwood/base-files-Dockstar/etc/config/system b/target/linux/kirkwood/base-files-Dockstar/etc/config/system deleted file mode 100644 index 81ac978..0000000 --- a/target/linux/kirkwood/base-files-Dockstar/etc/config/system +++ /dev/null @@ -1,21 +0,0 @@ -# system file for Dockstar -config system - option 'hostname' 'OpenWrt' - option 'timezone' 'UTC' - -config timeserver ntp - list server 0.openwrt.pool.ntp.org - list server 1.openwrt.pool.ntp.org - list server 2.openwrt.pool.ntp.org - list server 3.openwrt.pool.ntp.org - -config led - option 'sysfs' 'dockstar:green:health' - option 'trigger' 'none' - option 'default' '1' - -config led - option 'sysfs' 'dockstar:orange:misc' - option 'trigger' 'netdev' - option 'mode' 'tx rx' - option 'dev' 'eth0' diff --git a/target/linux/kirkwood/base-files.mk b/target/linux/kirkwood/base-files.mk new file mode 100644 index 0000000..fdd2c71 --- /dev/null +++ b/target/linux/kirkwood/base-files.mk @@ -0,0 +1,3 @@ +define Package/base-files/install-target + rm -f $(1)/etc/config/network +endef diff --git a/target/linux/kirkwood/base-files/etc/uci-defaults/leds b/target/linux/kirkwood/base-files/etc/uci-defaults/leds new file mode 100644 index 0000000..a0b1c1c --- /dev/null +++ b/target/linux/kirkwood/base-files/etc/uci-defaults/leds @@ -0,0 +1,57 @@ +#!/bin/sh +# +# Copyright (C) 2012 OpenWrt.org +# + +COMMIT_SYSTEM=0 + +set_led_netdev() { + local cfg="led_$1" + local sysfs=$2 + local dev=$3 + + uci -q get system.$cfg && return 0 + + uci batch <