Refactored variable names

This commit is contained in:
tshalvi 2024-02-20 11:34:52 +00:00
parent d81c50168e
commit aeda85bdcb

View File

@ -22,22 +22,21 @@ function startplatform() {
# boot type # boot type
if [[ x"$sonic_asic_platform" == x"mellanox" ]]; then if [[ x"$sonic_asic_platform" == x"mellanox" ]]; then
metadata=$(sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]') metadata=$(sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]')
PLATFORM=$(echo "$metadata" | grep -oP "'platform': '\K[^']+") platform=$(echo "$metadata" | grep -oP "'platform': '\K[^']+")
PLATFORM_DIR="/usr/share/sonic/device/$PLATFORM" platform_dir="/usr/share/sonic/device/$platform"
HWSKU=$(echo "$metadata" | grep -oP "'hwsku': '\K[^']+") hwsku=$(echo "$metadata" | grep -oP "'hwsku': '\K[^']+")
HWSKU_DIR="$PLATFORM_DIR/$HWSKU" hwsku_dir="$platform_dir/$hwsku"
sai_profile_json_file="$HWSKU_DIR/sai.profile" sai_profile_json_file="$hwsku_dir/sai.profile"
INDEPENDENT_MODE=$(grep '^SAI_INDEPENDENT_MODULE_MODE=' $sai_profile_json_file | cut -d '=' -f 2) independent_mode=$(grep '^SAI_INDEPENDENT_MODULE_MODE=' $sai_profile_json_file | cut -d '=' -f 2)
if [[ "$INDEPENDENT_MODE" == "1" ]]; then if [[ "$independent_mode" == "1" ]]; then
cat $PLATFORM_DIR/media_settings_src.json > $PLATFORM_DIR/media_settings.json cat $platform_dir/media_settings_src.json > $platform_dir/media_settings.json
else else
if [[ -f $PLATFORM_DIR/media_settings.json ]]; then if [[ -f $platform_dir/media_settings.json ]]; then
rm $PLATFORM_DIR/media_settings.json rm $platform_dir/media_settings.json
fi fi
fi fi
BOOT_TYPE=`getBootType` BOOT_TYPE=`getBootType`
if [[ x"$WARM_BOOT" == x"true" || x"$BOOT_TYPE" == x"fast" ]]; then if [[ x"$WARM_BOOT" == x"true" || x"$BOOT_TYPE" == x"fast" ]]; then
export FAST_BOOT=1 export FAST_BOOT=1