summaryrefslogtreecommitdiffstats
path: root/src/build/tools/hb
diff options
context:
space:
mode:
Diffstat (limited to 'src/build/tools/hb')
-rwxr-xr-xsrc/build/tools/hb21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/build/tools/hb b/src/build/tools/hb
index 7771a1d4b..22e5ca7ed 100755
--- a/src/build/tools/hb
+++ b/src/build/tools/hb
@@ -392,8 +392,25 @@ hb_startsimics()
fi
needs_machine_variable
- # Force simics into Secure Mode
- export SECURITY_HW_POLICY="1"
+
+ # Dynamically check config file if secureboot enabled build occurred and
+ # set mode accordingly
+ if [[ -f ${PROJECT_ROOT}/obj/genfiles/config.h ]]; then
+ if cat ${PROJECT_ROOT}/obj/genfiles/config.h | grep -q "CONFIG_SECUREBOOT 1"; then
+ echo "In secure mode"
+ if [ -z "${SECURITY_HW_POLICY}" ]; then
+ export SECURITY_HW_POLICY="1"
+ fi
+ else
+ if [ -z "${SECURITY_HW_POLICY}" ]; then
+ export SECURITY_HW_POLICY="0"
+ fi
+ echo "In unsecure mode"
+ fi
+ else
+ echo "File DNE ${PROJECT_ROOT}/obj/genfiles/config.h"
+ exit -1
+ fi
execute_in_sandbox \
"start_simics -machine ${MACHINE} ${SIMICSOPTIONS} $*" "ppc"
}
OpenPOWER on IntegriCloud