meta-fii/meta-kudo: Modify kudo.sh fw to display version in decimal
Modify the kudo.sh fw to display BMC version format in decimal
Signed-off-by: Mustafa Shehabi <mustafa.shehabi@fii-na.com>
Signed-off-by: XP Chen <xiao-peng.chen@fii-na.com>
Change-Id: Ifdc18e4b417bd764794750a2f7a28db849c17eca
diff --git a/meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-cmd/kudo.sh b/meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-cmd/kudo.sh
index 03adb8e..3a528ab 100644
--- a/meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-cmd/kudo.sh
+++ b/meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-cmd/kudo.sh
@@ -91,8 +91,24 @@
cmd=$(cat $MB_CPLD_VER_FILE)
echo " MB_CPLD: " $cmd
- cmd=$(cat /etc/os-release | grep VERSION -w | cut -d '=' -f 2)
- echo " BMC : " ${cmd}
+ # BMC Version
+
+ # Save VERSION_ID line in string "VERSION_ID=vXX.XX-XX-kudo"
+ StringVersion=$(cat /etc/os-release | awk '/VERSION_ID/')
+
+ #Save Major Version value between v and . "vXX." then convert Hex to Decimal
+ MajorVersion=${StringVersion#*v}
+ MajorVersion=$(( 16#${MajorVersion%.*}))
+
+ #Save SubMajor Version valeu between . and - ".XX-" then convert Hex to Decimal
+ SubMajorVersion=${StringVersion#*.}
+ SubMajorVersion=$(( 16#${SubMajorVersion%-*}))
+
+ #Save Minor Version value between - and - "-XX-" then convert Hex to Decimal
+ MinorVersion=${StringVersion#*-}
+ MinorVersion=$(( 16#${MinorVersion%-*}))
+
+ echo " BMC: " ${MajorVersion}.${SubMajorVersion}.${MinorVersion}
#BMC PWR Sequencer
i2cset -y -f -a 14 0x59 0xfe 0x0000 w