feat(master : nicsensor) 参数配置支持配置fru offset

This commit is contained in:
leimingsheng 2026-03-11 14:09:45 +08:00
parent 8777d0a279
commit 3a15c90acf

@ -249,7 +249,7 @@ print_usage(){
echo " Function 5 - Properties Settings"
echo " 1) Command Format : ./nicsensor.sh [get/set] [property] [value]"
echo " 2) Option Detail"
echo " - [property] : debug, n_detect, server, fru_size, i2cbus"
echo " - [property] : debug|n_detect|server|fru_size|fru_offset|i2cbus"
echo " - [value] : property's value"
echo " 3) E.G. : ./nicsensor.sh set server 5280m7"
echo " : ./nicsensor.sh set debug 1"
@ -382,6 +382,9 @@ get_set_properties(){
elif [ "$Param2" = "fru_size" ];then
target_file="${CONFIG_DIR}ns_frusize"
default_data=$fru_size
elif [ "$Param2" = "fru_offset" ];then
target_file="${CONFIG_DIR}ns_fruoffset"
default_data=$fru_offset
elif [ "$Param2" = "i2cbus" ];then
target_file="${CONFIG_DIR}ns_i2cbus"
default_data=$i2c_bus
@ -422,6 +425,10 @@ load_properties_from_cache(){
fru_size=`cat ${CONFIG_DIR}ns_frusize`
fi
if [ -e "${CONFIG_DIR}ns_fruoffset" ];then
fru_offset=`cat ${CONFIG_DIR}ns_fruoffset`
fi
if [ -e "${CONFIG_DIR}ns_i2cbus" ];then
i2c_bus=`cat ${CONFIG_DIR}ns_i2cbus`
fi