feat(master : nicsensor) update to 1.9.8

1.支持get/set配置默认i2cbus
This commit is contained in:
leimingsheng 2026-03-11 11:17:37 +08:00
parent 3a66d3557b
commit 67b07fcf8b

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
set -eo pipefail set -eo pipefail
SCRIPT_VERSION="1.9.7" SCRIPT_VERSION="1.9.8"
# --------------------------------------------------------- # ---------------------------------------------------------
# Project Feature Varible (Change if need) # Project Feature Varible (Change if need)
# --------------------------------------------------------- # ---------------------------------------------------------
@ -249,7 +249,7 @@ print_usage(){
echo " Function 5 - Properties Settings" echo " Function 5 - Properties Settings"
echo " 1) Command Format : ./nicsensor.sh [get/set] [property] [value]" echo " 1) Command Format : ./nicsensor.sh [get/set] [property] [value]"
echo " 2) Option Detail" echo " 2) Option Detail"
echo " - [property] : debug, n_detect, server, fru_size" echo " - [property] : debug, n_detect, server, fru_size, i2cbus"
echo " - [value] : property's value" echo " - [value] : property's value"
echo " 3) E.G. : ./nicsensor.sh set server 5280m7" echo " 3) E.G. : ./nicsensor.sh set server 5280m7"
echo " : ./nicsensor.sh set debug 1" echo " : ./nicsensor.sh set debug 1"
@ -382,6 +382,9 @@ get_set_properties(){
elif [ "$Param2" = "fru_size" ];then elif [ "$Param2" = "fru_size" ];then
target_file="${CONFIG_DIR}ns_frusize" target_file="${CONFIG_DIR}ns_frusize"
default_data=$fru_size default_data=$fru_size
elif [ "$Param2" = "i2cbus" ];then
target_file="${CONFIG_DIR}ns_i2cbus"
default_data=$i2c_bus
else else
fmt_print "console" $ERROR "Invalid Property : $Param2" fmt_print "console" $ERROR "Invalid Property : $Param2"
exit 1 exit 1
@ -418,6 +421,10 @@ load_properties_from_cache(){
if [ -e "${CONFIG_DIR}ns_frusize" ];then if [ -e "${CONFIG_DIR}ns_frusize" ];then
fru_size=`cat ${CONFIG_DIR}ns_frusize` fru_size=`cat ${CONFIG_DIR}ns_frusize`
fi fi
if [ -e "${CONFIG_DIR}ns_i2cbus" ];then
i2c_bus=`cat ${CONFIG_DIR}ns_i2cbus`
fi
} }
# According to boardid, parse server_type # According to boardid, parse server_type