sysinfo: add 0x prefix to SEC_CONFIG_WORD to fix conditional expression

Commit c24d1d96 ("sysinfo: adapt script after removal of deprecated fsl_otp
driver") introduced a mistake masking the SEC_CONFIG[1] bit read from the OTP.
This commit fix the read command to force it in hex format and finally match
with the mask in the script.

https://jira.digi.com/browse/DEL-7263

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
This commit is contained in:
Arturo Buzarra 2020-10-14 16:46:20 +02:00
parent 666c361df2
commit f6c2cec797
1 changed files with 1 additions and 1 deletions

View File

@ -263,7 +263,7 @@ make_report(){
else
if [ -e ${OTP_PATH}/nvmem ]; then
# Check SEC_CONFIG on OCOTP_CFG5 (ADDR=6) bit 1.
SEC_CONFIG_WORD=$(dd if=${OTP_PATH}/nvmem of=/dev/stdout bs=4 skip=6 count=1 status=none | hexdump -n 4 -v -e '1/4 "%08x\n"')
SEC_CONFIG_WORD=$(dd if=${OTP_PATH}/nvmem of=/dev/stdout bs=4 skip=6 count=1 status=none | hexdump -n 4 -v -e '1/4 "0x%08x\n"')
if [ "$((${SEC_CONFIG_WORD} & 0x2))" != "0" ]; then
echo "Security status: [CLOSED]"
else