Table 6-5: md5sum command – Kontron COMe-cP2020 User Manual

Page 84

Advertising
background image

www.kontron.com

COMe-P2020 User Guide

84

Table 6-5:

md5sum Command

md5

sum

Creates or checks the md5 message digest over a memory area

SYNTAX:

md5sum <data-address> <length> [<cksum-address>]

md5sum

command

<data-address>

parameter: hexadecimal

start address of memory area

<length>

parameter: hexadecimal

length of memory area

<cksum-address>

parameter: hexadecimal

If present: compares the calculated md5 message digest with the md5 message
digest available at this address.
If absent: calculates the md5 message digest over the specified memory range and
prints it to the console.

DESCRIPTION: This command is used to create or check the md5 message digest over a memory area.

If the optional 3

rd

parameter <checksum-address> is omitted, the md5 message digest is calculated over

the specified memory range and printed to the console.

If the optional 3

rd

parameter <cksum-address> is specified, the md5 message digest is calculated over the

specified memory range and compared with the md5 message digest at <cksum-address>. If the digest is
identical, the command returns 0; if the digests do not match, a value other than zero is returned. When a
comparison is made, nothing is printed to the console since this usage of the command is meant to be used
within scripts.
The md5 message digest at <cksum-address> may be specified in ASCII or binary format.

USAGE: 1. Calculate an md5 message digest:

=> md5sum 100000 80000

8fe7006660a2df2265b7cd707eb98786

=>

2. Check the md5 message digest of a file previously loaded to 100000 with a size of 80000 and its md5
message digest loaded to 10000 in a script

=> setenv check_crc “if md5sum 100000 80000 10000; then echo ‘md5
message digest OK’; else echo ‘md5 message digest BAD’; fi”

=>run check_crc

md5 message digest OK

=>

Advertising