]>
Commit | Line | Data |
---|---|---|
a827807a | 1 | #! @BUILD_SHEBANG@ |
7994a09a BC |
2 | |
3 | # create a randome file | |
f153fcb5 | 4 | file="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1 |
7994a09a BC |
5 | cat >$file <<EOF |
6 | hello world! | |
7 | EOF | |
8 | ||
87a04a2d VS |
9 | . "@builddir@/grub-core/modinfo.sh" |
10 | ||
11 | if [ x"${grub_modinfo_platform}" = xemu ]; then | |
12 | grub_file="(host)$file" | |
13 | else | |
14 | grub_file="/boot/grub/file" | |
15 | fi | |
16 | ||
17 | ||
f153fcb5 | 18 | outfile1="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1 |
7994a09a | 19 | @builddir@/grub-shell --files=/boot/grub/file=$file >$outfile1 <<EOF |
87a04a2d | 20 | sha512sum $grub_file |
7994a09a BC |
21 | EOF |
22 | ||
f153fcb5 | 23 | outfile2="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1 |
7994a09a BC |
24 | sha512sum $file >$outfile2 |
25 | ||
26 | SHA1=`cat $outfile1 | tr -d '\n' | cut -f1 -d\ ` | |
27 | SHA2=`cat $outfile2 | cut -f1 -d\ ` | |
28 | ||
29 | if test "$SHA1" = "$SHA2"; then | |
30 | rm -f ${outfile1} ${outfile2} | |
31 | exit 0 | |
32 | else | |
33 | echo "GRUB sha512sum output did not match sha512sum output." | |
34 | echo "See diff -u ${outfile1} ${outfile2}" | |
35 | exit 1 | |
36 | fi |