coreboot-kgpe-d16/util/mma/mma_get_result.sh
Patrick Georgi 6b5bc77c9b treewide: Remove "this file is part of" lines
Stefan thinks they don't add value.

Command used:
sed -i -e '/file is part of /d' $(git grep "file is part of " |egrep ":( */\*.*\*/\$|#|;#|-- | *\* )" | cut -d: -f1 |grep -v crossgcc |grep -v gcov | grep -v /elf.h |grep -v nvramtool)

The exceptions are for:
 - crossgcc (patch file)
 - gcov (imported from gcc)
 - elf.h (imported from GNU's libc)
 - nvramtool (more complicated header)

The removed lines are:
-       fmt.Fprintln(f, "/* This file is part of the coreboot project. */")
-# This file is part of a set of unofficial pre-commit hooks available
-/* This file is part of coreboot */
-# This file is part of msrtool.
-/* This file is part of msrtool. */
- * This file is part of ncurses, designed to be appended after curses.h.in
-/* This file is part of pgtblgen. */
- * This file is part of the coreboot project.
- /* This file is part of the coreboot project. */
-#  This file is part of the coreboot project.
-# This file is part of the coreboot project.
-## This file is part of the coreboot project.
--- This file is part of the coreboot project.
-/* This file is part of the coreboot project */
-/* This file is part of the coreboot project. */
-;## This file is part of the coreboot project.
-# This file is part of the coreboot project. It originated in the
- * This file is part of the coreinfo project.
-## This file is part of the coreinfo project.
- * This file is part of the depthcharge project.
-/* This file is part of the depthcharge project. */
-/* This file is part of the ectool project. */
- * This file is part of the GNU C Library.
- * This file is part of the libpayload project.
-## This file is part of the libpayload project.
-/* This file is part of the Linux kernel. */
-## This file is part of the superiotool project.
-/* This file is part of the superiotool project */
-/* This file is part of uio_usbdebug */

Change-Id: I82d872b3b337388c93d5f5bf704e9ee9e53ab3a9
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41194
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-05-11 17:11:40 +00:00

64 lines
1.5 KiB
Bash
Executable file

#!/usr/bin/env bash
#
# SPDX-License-Identifier: GPL-2.0-only
mma_results_op_bin="${1}"
mma_results_op_bin_tmp="${mma_results_op_bin}".tmp
mma_cbmem_id="0x4d4d4144"
show_usage() {
printf "usage: $(basename "${0}") <output_results.bin>\n"
printf "pass path of a bin file where you want to save results.\n"
}
#
# main entry point
#
main() {
if [ ! "${mma_results_op_bin}" ];then
show_usage
exit -1
fi
printf "Reading cbmem ...\n"
cbmem -r ${mma_cbmem_id} > "${mma_results_op_bin_tmp}" || \
{
printf "error in executing cbmem utility\n" ;
exit -1;
}
#format of o/p is :
# <mma_signature><mma_test_header+data>
#
# where,
# <mma_signature> is 32bit length string "MMAD"
#
# <mma_test_header+data> is the FULL HOB which coreboot
# receives from FSP
# <mma_test_header> is 22 bytes long at the start of the HOB.
# MMA data starts right after 26 bytes
# 26 bytes = (4 bytes of "MMAD"
# + 22 bytes of mma_test_header)
#
mma_signature=$(dd if="${mma_results_op_bin_tmp}" bs=1 count=4 )
if [[ ${mma_signature} != "MMAD" ]];then
printf "MMA signature mismatch" > "${mma_results_op_bin}"
rm -r "${mma_results_op_bin_tmp}"
cbmem -l >> "${mma_results_op_bin}"
printf "MMA signature mismatch\n"
exit -1
fi
dd if="${mma_results_op_bin_tmp}" of="${mma_results_op_bin}" bs=1 skip=26 || \
{
printf "error in generating "${mma_results_op_bin}"\n" ;
exit -1;
}
rm -r "${mma_results_op_bin_tmp}"
printf "MMA data saved to "${mma_results_op_bin}"\n"
}
main "$@"