ponmngr: configure serial no. at start

This commit is contained in:
Rahul Thakur 2022-08-17 17:51:19 +00:00 committed by Sukru Senli
parent 8c242bbdad
commit 9be656695c
2 changed files with 27 additions and 4 deletions

View file

@ -1,15 +1,30 @@
#!/bin/sh /etc/rc.common
START=19
STOP=10
STOP=91
USE_PROCD=1
. /lib/functions.sh
include /lib/xpon
configure_serial_number() {
serial_number="$(uci -q get xpon.ani.serial_number)"
if [ ${#serial_number} -eq 12 ]; then
vendor_id="${serial_number:0:4}"
vssn="${serial_number:4:8}"
else
macaddr="$(fw_printenv -n ethaddr | tr -d ':' | tr 'a-z' 'A-Z')"
vendor_id="IOPS"
vssn="${macaddr:4:8}"
fi
set_serial_number $vendor_id $vssn
}
start_service() {
if [ "$(uci -q get xpon.ani.enable)" == "1" ]; then
configure_serial_number
init_xpon
fi
}

View file

@ -1,18 +1,26 @@
#!/bin/sh
USE_PROCD=1
. /lib/functions.sh
set_serial_number() {
vendor_id=$1
vssn=$2
vendor_id="$(echo $vendor_id | hexdump -e '4/1 "%02X" "\n"')"
vendor_id=${vendor_id:0:8}
bs /b/c gpon onu_sn={vendor_id=$vendor_id,vendor_specific=$vssn}
}
init_xpon() {
procd_open_instance pon_msgd
procd_set_param command bcm_msgd -c gpon
procd_close_instance
procd_open_instance pon_daemon
procd_set_param command omcid start -n
procd_set_param respawn
procd_close_instance
}
deinit_xpon() {