From 6338b86317ded65e9f11d9ca4bd6fb537cfc941a Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 3 Dec 2015 22:27:18 +0000 Subject: kirkwood: switch from uci-defaults to board.d Signed-off-by: Jo-Philipp Wich git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47733 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../linux/kirkwood/base-files/etc/board.d/00_model | 13 +++++ .../linux/kirkwood/base-files/etc/board.d/01_leds | 51 +++++++++++++++++ .../kirkwood/base-files/etc/board.d/02_network | 64 +++++++++++++++++++++ .../kirkwood/base-files/etc/uci-defaults/01_leds | 49 ---------------- .../base-files/etc/uci-defaults/02_network | 66 ---------------------- 5 files changed, 128 insertions(+), 115 deletions(-) create mode 100644 target/linux/kirkwood/base-files/etc/board.d/00_model create mode 100644 target/linux/kirkwood/base-files/etc/board.d/01_leds create mode 100644 target/linux/kirkwood/base-files/etc/board.d/02_network delete mode 100644 target/linux/kirkwood/base-files/etc/uci-defaults/01_leds delete mode 100644 target/linux/kirkwood/base-files/etc/uci-defaults/02_network (limited to 'target/linux/kirkwood/base-files') diff --git a/target/linux/kirkwood/base-files/etc/board.d/00_model b/target/linux/kirkwood/base-files/etc/board.d/00_model new file mode 100644 index 0000000000..ec07709e0c --- /dev/null +++ b/target/linux/kirkwood/base-files/etc/board.d/00_model @@ -0,0 +1,13 @@ +#!/bin/sh +# Copyright (C) 2015 OpenWrt.org + +. /lib/functions/uci-defaults-new.sh + +board_config_update + +ucidef_set_board_id "$(cat /tmp/sysinfo/board_name)" +ucidef_set_model_name "$(cat /tmp/sysinfo/model)" + +board_config_flush + +exit 0 diff --git a/target/linux/kirkwood/base-files/etc/board.d/01_leds b/target/linux/kirkwood/base-files/etc/board.d/01_leds new file mode 100644 index 0000000000..9e84d8bb20 --- /dev/null +++ b/target/linux/kirkwood/base-files/etc/board.d/01_leds @@ -0,0 +1,51 @@ +#!/bin/sh +# +# Copyright (C) 2012-2015 OpenWrt.org +# + +. /lib/functions/uci-defaults-new.sh +. /lib/kirkwood.sh + +board_config_update + +board=$(kirkwood_board_name) + +case "$board" in +"dockstar") + ucidef_set_led_default "health" "health" "status:green:health" "1" + ucidef_set_led_default "fault" "fault" "status:orange:fault" "1" + ;; +"linksys-audi") + ucidef_set_led_default "power" "power" "audi:green:power" "1" + ;; +"linksys-viper") + ucidef_set_led_default "health" "health" "viper:white:health" "1" + ucidef_set_led_default "pulse" "pulse" "viper:white:pulse" "1" + ;; +"goflexhome" | \ +"goflexnet") + ucidef_set_led_default "health" "health" "status:green:health" "1" + ucidef_set_led_default "fault" "fault" "status:orange:fault" "0" + ;; +"ib62x0") + ucidef_set_led_default "health" "health" "ib62x0:green:os" "1" + ucidef_set_led_default "fault" "fault" "ib62x0:red:os" "1" + ;; +"pogo_e02") + ucidef_set_led_default "health" "health" "pogo_e02:green:health" "1" + ucidef_set_led_default "fault" "fault" "pogo_e02:orange:fault" "1" + ;; +"guruplug-server-plus") + ucidef_set_led_timer "health" "health" "guruplug:red:health" "200" "800" + ;; +"sheevaplug" | \ +"sheevaplug-esata") + ucidef_set_led_timer "health" "health" "sheevaplug:blue:health" "200" "800" + ;; +*) + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/kirkwood/base-files/etc/board.d/02_network b/target/linux/kirkwood/base-files/etc/board.d/02_network new file mode 100644 index 0000000000..eb091745af --- /dev/null +++ b/target/linux/kirkwood/base-files/etc/board.d/02_network @@ -0,0 +1,64 @@ +#!/bin/sh +# +# Copyright (C) 2012-2015 OpenWrt.org +# + +[ -e /etc/config/network ] && exit 0 + +touch /etc/config/network + +set_lan_dhcp() { + local ifname=$1 + uci batch <