diff options
author | Vlad Sytchenko <vsytch@google.com> | 2023-09-06 20:07:47 +0300 |
---|---|---|
committer | Vlad Sytchenko <vsytch@google.com> | 2023-09-06 20:16:17 +0300 |
commit | 1d45ce20de0f0e48c356599a0e3d38726aea5aaa (patch) | |
tree | a820d5f675cb7e892f481a61619fea568a60b8d0 /meta-google/recipes-google/ipmi | |
parent | 6fe94bcdd58c50ed7babeaab4c6cd167f14ed4d6 (diff) | |
download | openbmc-1d45ce20de0f0e48c356599a0e3d38726aea5aaa.tar.xz |
meta-google: ipmi-fru-sh: Correct checksum calculation
Blocks reads, whos values are greated than 128, will be formated as
negative integers, causing cascading errors in the checksum calculation.
Format using unsigned specifier instead to prevent this.
Tested:
Before:
```
dd if=/sys/bus/i2c/devices/13-0050/eeprom bs=1 count=8 skip=8 | \
hexdump -v -e '1/1 "%d "'
1 1 32 36 -107 47 -115 -121
```
After:
```
dd if=/sys/bus/i2c/devices/13-0050/eeprom bs=1 count=8 skip=8 | \
hexdump -v -e '1/1 "%u "'
1 1 32 36 149 47 141 135
```
Change-Id: I187f0918a25005310bb900022047e03fe68483d4
Signed-off-by: Vlad Sytchenko <vsytch@google.com>
Diffstat (limited to 'meta-google/recipes-google/ipmi')
-rw-r--r-- | meta-google/recipes-google/ipmi/ipmi-fru-sh/lib.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/meta-google/recipes-google/ipmi/ipmi-fru-sh/lib.sh b/meta-google/recipes-google/ipmi/ipmi-fru-sh/lib.sh index 0f6de8f73f..0ab9b9dcab 100644 --- a/meta-google/recipes-google/ipmi/ipmi-fru-sh/lib.sh +++ b/meta-google/recipes-google/ipmi/ipmi-fru-sh/lib.sh @@ -180,7 +180,7 @@ read_bytes() { else echo "Reading $file at $offset for $size" >&2 dd if="$file" bs=1 count="$size" skip="$offset" 2>/dev/null | \ - hexdump -v -e '1/1 "%d "' + hexdump -v -e '1/1 "%u "' fi } |