Changeset 31994


Ignore:
Timestamp:
2012-05-29T18:39:20+02:00 (6 years ago)
Author:
juhosg
Message:

kirkwood: use the generic uci-default functions for initial LED setup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/kirkwood/base-files/etc/uci-defaults/leds

    r31990 r31994  
    44# 
    55 
    6 COMMIT_SYSTEM=0 
    7  
    8 set_led_netdev() { 
    9         local cfg="led_$1" 
    10         local sysfs=$2 
    11         local dev=$3 
    12  
    13         uci -q get system.$cfg && return 0 
    14  
    15         uci batch <<EOF 
    16 set system.$cfg='led' 
    17 set system.$cfg.sysfs='$sysfs' 
    18 set system.$cfg.trigger='netdev' 
    19 set system.$cfg.dev='$dev' 
    20 set system.$cfg.mode='link tx rx' 
    21 EOF 
    22         COMMIT_SYSTEM=1 
    23 } 
    24  
    25 set_led_default() { 
    26         local cfg="led_$1" 
    27         local sysfs=$2 
    28         local default=$3 
    29  
    30         uci -q get system.$cfg && return 0 
    31  
    32         uci batch <<EOF 
    33 set system.$cfg='led' 
    34 set system.$cfg.sysfs='$sysfs' 
    35 set system.$cfg.trigger='none' 
    36 set system.$cfg.default='$default' 
    37 EOF 
    38         COMMIT_SYSTEM=1 
    39 } 
    40  
     6. /lib/fuctions/uci-defaults.sh 
    417. /lib/kirkwood.sh 
    428 
     
    4511case "$hardware" in 
    4612"Seagate FreeAgent DockStar") 
    47         set_led_netdev "eth0" "dockstar:orange:misc" "eth0" 
    48         set_led_default "health" "dockstar:green:health" "1" 
     13        ucidef_set_led_netdev "eth0" "dockstar:orange:misc" "eth0" 
     14        ucidef_set_led_default "health" "dockstar:green:health" "1" 
    4915        ;; 
    5016 
     
    5319esac 
    5420 
    55 [ "$COMMIT_SYSTEM" == "1" ] && uci commit system 
     21ucidef_commit_leds 
    5622 
    5723exit 0 
Note: See TracChangeset for help on using the changeset viewer.