Output version information to meta

This commit is contained in:
Dan Hawkins 2018-12-16 18:26:50 +00:00
commit 5127186c4f

View file

@ -76,28 +76,39 @@ def modifyapp(NIOSEDS, bspfolder, wdir) {
}
}
def dump_elf_info(NIOSEDS, elffile, outputdir) {
sh """#!/bin/bash
set -x
mkdir -p "${outputdir}"
if [ \$? -ne 0 ]; then exit 1; fi
"${NIOSEDS}/nios2_command_shell.sh" nios2-elf-query "${elffile}" --cpu_name > "${outputdir}/lower_cpu_name.txt"
if [ \$? -ne 0 ]; then exit 1; fi
"${NIOSEDS}/nios2_command_shell.sh" nios2-elf-query "${elffile}" --sidp > "${outputdir}/lower_sidp.txt"
if [ \$? -ne 0 ]; then exit 1; fi
"${NIOSEDS}/nios2_command_shell.sh" nios2-elf-query "${elffile}" --id > "${outputdir}/lower_id.txt"
if [ \$? -ne 0 ]; then exit 1; fi
"${NIOSEDS}/nios2_command_shell.sh" nios2-elf-query "${elffile}" --timestamp > "${outputdir}/lower_timestamp.txt"
if [ \$? -ne 0 ]; then exit 1; fi
"${NIOSEDS}/nios2_command_shell.sh" nios2-elf-query "${elffile}" --sopcinfo > "${outputdir}/lower_sopcinfo.txt"
if [ \$? -ne 0 ]; then exit 1; fi
"""
def dump_elf_info(NIOSEDS, elffile, meta, custominfokeyprefix) {
if (isUnix()) {
def cpu_name = sh(script: """#!/bin/bash
`"${NIOSEDS}/nios2_command_shell.sh" nios2-elf-query "${elffile}" --cpu_name`
""",
returnStdout: true
)
meta.addCustomInfo("${custominfokeyprefix}_cpu_name", cpu_name)
def sidp = sh(script: """#!/bin/bash
`"${NIOSEDS}/nios2_command_shell.sh" nios2-elf-query "${elffile}" --sidp`
""",
returnStdout: true
)
meta.addCustomInfo("${custominfokeyprefix}_sidp", sidp)
def id = sh(script: """#!/bin/bash
`"${NIOSEDS}/nios2_command_shell.sh" nios2-elf-query "${elffile}" --id`
""",
returnStdout: true
)
meta.addCustomInfo("${custominfokeyprefix}_id", id)
def timestamp = sh(script: """#!/bin/bash
`"${NIOSEDS}/nios2_command_shell.sh" nios2-elf-query "${elffile}" --timestamp`
""",
returnStdout: true
)
meta.addCustomInfo("${custominfokeyprefix}_timestamp", timestamp)
def sopcinfo = sh(script: """#!/bin/bash
`"${NIOSEDS}/nios2_command_shell.sh" nios2-elf-query "${elffile}" --sopcinfo`
""",
returnStdout: true
)
meta.addCustomInfo("${custominfokeyprefix}_sopcinfo", sopcinfo)
}
}
return this;