lantiq: move esi calls to dsl_cpe_control scripts to fix ordering wrt. loading vr9...
[openwrt/svn-archive/archive.git] / package / network / config / ltq-adsl-app / files / dsl_control
index e48b72b059437d5e0f08406dc74c56d9fa541d74..0c7221c24fe4bf353df196ec3cf862649b2f7bba 100644 (file)
@@ -10,7 +10,7 @@ EXTRA_HELP="  status  Get DSL status information
 SERVICE_DAEMONIZE=1
 SERVICE_WRITE_PID=1
 
-. /lib/functions/lantiq_dsl.sh
+[ -f /lib/functions/lantiq_dsl.sh ] && . /lib/functions/lantiq_dsl.sh
 
 annex_b=10_00_10_00_00_04_00_00
 annex_bdmt=10_00_00_00_00_00_00_00
@@ -38,11 +38,17 @@ start() {
        eval "xtu=\"\${annex_$annex}\""
 
        [ -z "${firmware}" ] &&
-               firmware=adsl.bin
+               firmware=/lib/firmware/adsl.bin
+       [ -f "${firmware}" ] || {
+               echo failed to find $firmware
+               return 1
+       }
+
+       esi $(printf '%012X' $((1+0x$(tr -d : </sys/class/net/eth0/address))))
 
        service_start /sbin/dsl_cpe_control -i${xtu} \
                        -n /sbin/dsl_notify.sh \
-                       -f /lib/firmware/${firmware}
+                       -f ${firmware}
 }
 
 stop() {