-
-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #572 from m-1-k-3/profile_handling
Improved default profile handling / running modules script
- Loading branch information
Showing
6 changed files
with
121 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash -p | ||
# see: https://developer.apple.com/library/archive/documentation/OpenSource/Conceptual/ShellScripting/ShellScriptSecurity/ShellScriptSecurity.html#//apple_ref/doc/uid/TP40004268-CH8-SW29 | ||
|
||
# EMBA - EMBEDDED LINUX ANALYZER | ||
# | ||
# Copyright 2020-2023 Siemens Energy AG | ||
# | ||
# EMBA comes with ABSOLUTELY NO WARRANTY. This is free software, and you are | ||
# welcome to redistribute it under the terms of the GNU General Public License. | ||
# See LICENSE file for usage of this software. | ||
# | ||
# EMBA is licensed under GPLv3 | ||
# | ||
# Author(s): Michael Messner | ||
|
||
# Description: EMBA helper script to identify currently running EMBA modules | ||
# start it with "watch". E.g., | ||
# watch -c ./helpers/running_modules.sh ~/firmware-stuff/emba_logs_dir300_new_bins | ||
|
||
|
||
export GREEN="\033[0;32m" | ||
export ORANGE="\033[0;33m" | ||
export NC="\033[0m" # no color | ||
|
||
if [[ $# -eq 0 ]]; then | ||
echo -e "\\n""${ORANGE}""In order to be able to use this script, you have to specify an EMBA firmware log directory${NC}" | ||
exit 1 | ||
fi | ||
|
||
EMBA_LOG_DIR="${1:-}" | ||
EMBA_LOG_FILE="${EMBA_LOG_DIR}""/emba.log" | ||
|
||
if ! [[ -f "${EMBA_LOG_FILE}" ]]; then | ||
echo -e "\\n""${ORANGE}""No valid EMBA firmware log directory found.${NC}" | ||
exit 1 | ||
fi | ||
|
||
mapfile -t STARTED_EMBA_PROCESSES < <(grep starting "${EMBA_LOG_FILE}" | awk '{print $9}'|| true) | ||
|
||
for EMBA_STARTED_PROC in "${STARTED_EMBA_PROCESSES[@]}"; do | ||
if ! grep -q "${EMBA_STARTED_PROC}"" finished" "${EMBA_LOG_FILE}"; then | ||
echo -e "[*] EMBA module ${GREEN}${EMBA_STARTED_PROC}${NC} currently running" | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# EMBA - EMBEDDED LINUX ANALYZER | ||
# | ||
# Copyright 2020-2023 Siemens Energy AG | ||
# Copyright 2020-2023 Siemens AG | ||
# | ||
# EMBA comes with ABSOLUTELY NO WARRANTY. This is free software, and you are | ||
# welcome to redistribute it under the terms of the GNU General Public License. | ||
# See LICENSE file for usage of this software. | ||
# | ||
# EMBA is licensed under GPLv3 | ||
# | ||
# Author(s): Michael Messner, Pascal Eckmann | ||
# | ||
# Description: This is a default EMBA profile. You can Use it as a template for your own profiles | ||
# or start emba with "-p default-scan.emba" to use it | ||
|
||
export FORMAT_LOG=1 | ||
export THREADED=1 | ||
export SHORT_PATH=1 | ||
export HTML=1 | ||
export QEMULATION=1 | ||
|
||
# we output the profile only at the beginning - outside the docker environment | ||
if [[ $IN_DOCKER -ne 1 ]] ; then | ||
print_output "$(indent "$(orange "Adds ANSI color codes to log")")" "no_log" | ||
print_output "$(indent "$(orange "Activate multi threading (destroys regular console output)")")" "no_log" | ||
print_output "$(indent "$(orange "Prints only relative paths")")" "no_log" | ||
print_output "$(indent "$(orange "Activates web report creation in log path")")" "no_log" | ||
if [[ "$USE_DOCKER" -ne 1 ]]; then | ||
print_output "$(indent "$(orange "Enables automated qemu emulation tests (WARNING this module could harm your host!)")")" "no_log" | ||
else | ||
print_output "$(indent "$(orange "Enables automated qemu emulation tests")")" "no_log" | ||
fi | ||
print_output "$(indent "$(orange "Runs EMBA in docker container")")" "no_log" | ||
export USE_DOCKER=1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters