Skip to content

Commit bbc7f6b

Browse files
bexcranhrw
authored andcommitted
Platform/Ampere: Fix fw_ver.sh to avoid octal values
Update fw_ver.sh to run `date` with a minus after the % sign to suppress the leading zero that's normally printed. This prevents printf from interpreting the values as octal, which was causing a failure when August (month 8) began. Signed-off-by: Rebecca Cran <[email protected]>
1 parent 865ed82 commit bbc7f6b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Platform/Ampere/Tools/fw_ver.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ MAJOR_VER="$(date +%y)"
1313
MINOR_VER="$(date +%m)"
1414
MICRO_VER="$(date +%d)"
1515
VER="${MAJOR_VER}.${MINOR_VER}.${MICRO_VER}-$(printf '%02d' ${BUILD})"
16-
YHEX=$(printf '%03x' $(date +%y))
17-
MHEX=$(printf '%01x' $(date +%m))
18-
DHEX=$(printf '%02x' $(date +%e))
16+
YHEX=$(printf '%03x' $(date +%-y))
17+
MHEX=$(printf '%01x' $(date +%-m))
18+
DHEX=$(printf '%02x' $(date +%-e))
1919
BHEX=$(printf '%02x' ${BUILD})
2020
VER_HEX=0x${YHEX}${MHEX}${DHEX}${BHEX}

0 commit comments

Comments
 (0)