From 355f0444f3622347650776dd8f1e388dc5d000ca Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Tue, 17 Dec 2019 01:15:35 +0100 Subject: lantiq: split base-files into subtargets This splits the device-dependent base-files into subtarget directories, like done recently for ath79 and ramips. While this increases the overall lines of codes, it will make the code per subtarget smaller and easier to keep track of features and devices. While at it, several variables at the top of 02_network are removed, as they were never changed. The values are put directly into the function calls where they are used. Remove unneeded LED setup from 01_leds, and remove 01_leds entirely for falcon subtarget (as it is not used there). Applies alphabetic reordering to device cases in base-files. Signed-off-by: Adrian Schmutzler --- .../lantiq/ase/base-files/etc/board.d/01_leds | 32 +++++++++++++ .../lantiq/ase/base-files/etc/board.d/02_network | 52 ++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100755 target/linux/lantiq/ase/base-files/etc/board.d/01_leds create mode 100755 target/linux/lantiq/ase/base-files/etc/board.d/02_network (limited to 'target/linux/lantiq/ase/base-files/etc/board.d') diff --git a/target/linux/lantiq/ase/base-files/etc/board.d/01_leds b/target/linux/lantiq/ase/base-files/etc/board.d/01_leds new file mode 100755 index 0000000000..6a8de7d7a5 --- /dev/null +++ b/target/linux/lantiq/ase/base-files/etc/board.d/01_leds @@ -0,0 +1,32 @@ +#!/bin/sh +# +# Copyright (C) 2011-2015 OpenWrt.org +# + +. /lib/functions/leds.sh +. /lib/functions/uci-defaults.sh + +board_config_update + +led_dsl="$(get_dt_led dsl)" +[ -n "$led_dsl" ] && { + led_internet="$(get_dt_led internet)" + if [ -n "$led_internet" ]; then + ucidef_set_led_default "dsl" "dsl" "$led_dsl" "0" + ucidef_set_led_netdev "internet" "internet" "$led_internet" "pppoe-wan" + else + ucidef_set_led_netdev "dsl" "dsl" "$led_dsl" "dsl0" + fi +} + +board=$(board_name) + +case "$board" in +allnet,all0333cj) + ucidef_set_led_netdev "lan" "lan" "all0333cj:green:lan" "eth0.1" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/lantiq/ase/base-files/etc/board.d/02_network b/target/linux/lantiq/ase/base-files/etc/board.d/02_network new file mode 100755 index 0000000000..d37e999243 --- /dev/null +++ b/target/linux/lantiq/ase/base-files/etc/board.d/02_network @@ -0,0 +1,52 @@ +#!/bin/sh +# +# Copyright (C) 2011-2015 OpenWrt.org +# + +. /lib/functions/uci-defaults.sh +. /lib/functions/system.sh +. /lib/functions/lantiq.sh + +board_config_update + +annex="a" + +lan_mac="" +wan_mac="" + +board=$(board_name) + +case "$board" in +allnet,all0333cj) + annex="b" + lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr) + wan_mac=$(macaddr_add "$lan_mac" 1) + ucidef_set_interface_lan 'eth0' + ;; +netgear,dgn1000b) + annex="b" + ucidef_set_interface_lan 'eth0' + ;; +*) + ucidef_set_interface_lan 'eth0' + ;; +esac + +ls /lib/modules/$(uname -r)/ltq_atm* 1> /dev/null 2>&1 && \ + ucidef_add_atm_bridge 1 32 "llc" "bridged" "dsl" + +if lantiq_is_vdsl_system; then + ucidef_add_vdsl_modem "$annex" "av" +else + ucidef_add_adsl_modem "$annex" "/lib/firmware/adsl.bin" +fi + +ucidef_set_interface_wan "dsl0" "pppoe" + +[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" "$lan_mac" +[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" "$wan_mac" + +board_config_flush + +exit 0 + -- cgit v1.2.3