1f08c3bdfSopenharmony_ci#!/bin/bash 2f08c3bdfSopenharmony_ci# 3f08c3bdfSopenharmony_ci# Simulate the environment of mce-test driver or test case shell 4f08c3bdfSopenharmony_ci# script, used for debugging. You can invoking mce-test library 5f08c3bdfSopenharmony_ci# functions directly in shell created. 6f08c3bdfSopenharmony_ci# 7f08c3bdfSopenharmony_ci# Copyright (C) 2009, Intel Corp. 8f08c3bdfSopenharmony_ci# Author: Huang Ying <ying.huang@intel.com> 9f08c3bdfSopenharmony_ci# 10f08c3bdfSopenharmony_ci# This file is released under the GPLv2. 11f08c3bdfSopenharmony_ci# 12f08c3bdfSopenharmony_ci 13f08c3bdfSopenharmony_cisd=$(dirname "$0") 14f08c3bdfSopenharmony_ciexport ROOT=`(cd $sd/..; pwd)` 15f08c3bdfSopenharmony_ci 16f08c3bdfSopenharmony_ciif [ $# -eq 1 ]; then 17f08c3bdfSopenharmony_ci export driver=$1 18f08c3bdfSopenharmony_cielse 19f08c3bdfSopenharmony_ci export driver=simple 20f08c3bdfSopenharmony_cifi 21f08c3bdfSopenharmony_ci 22f08c3bdfSopenharmony_citmpfile=$(mktemp) 23f08c3bdfSopenharmony_ci 24f08c3bdfSopenharmony_citrap "rm $tmpfile" EXIT 25f08c3bdfSopenharmony_ci 26f08c3bdfSopenharmony_cicat <<"EOF" > $tmpfile 27f08c3bdfSopenharmony_ciif [ -f /etc/bash.bashrc ]; then 28f08c3bdfSopenharmony_ci source /etc/bash.bashrc 29f08c3bdfSopenharmony_cifi 30f08c3bdfSopenharmony_ci 31f08c3bdfSopenharmony_ciif [ -f $HOME/.bashrc ]; then 32f08c3bdfSopenharmony_ci source $HOME/.bashrc 33f08c3bdfSopenharmony_cifi 34f08c3bdfSopenharmony_ci 35f08c3bdfSopenharmony_ci. $ROOT/lib/functions.sh 36f08c3bdfSopenharmony_cisetup_path 37f08c3bdfSopenharmony_ci. $ROOT/lib/dirs.sh 38f08c3bdfSopenharmony_ci. $ROOT/lib/mce.sh 39f08c3bdfSopenharmony_ci. $ROOT/lib/soft-inject.sh 40f08c3bdfSopenharmony_ci 41f08c3bdfSopenharmony_ciexport PS1="MDE $driver: " 42f08c3bdfSopenharmony_ci 43f08c3bdfSopenharmony_ciecho "-----------------------------------------------------" 44f08c3bdfSopenharmony_ciecho "| MCE-test shell, You can use mce internal function |" 45f08c3bdfSopenharmony_ciecho "-----------------------------------------------------" 46f08c3bdfSopenharmony_ciEOF 47f08c3bdfSopenharmony_ci 48f08c3bdfSopenharmony_ciexport PS1="MCE $driver: " 49f08c3bdfSopenharmony_ci/bin/bash --rcfile $tmpfile 50f08c3bdfSopenharmony_cirm $tmpfile 51