summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJayanth Othayoth <ojayanth@in.ibm.com>2017-07-13 05:48:33 -0500
committerPatrick Williams <patrick@stwcx.xyz>2017-07-28 18:31:13 +0000
commitab741df3415931d146460af88e79716e4bd40fe2 (patch)
treeb5a061effd0baea01543fe33c57111b0df41ad5e
parentf655cb46f4da5f1eee172cbed8318ec1898d0c51 (diff)
downloadphosphor-debug-collector-ab741df3415931d146460af88e79716e4bd40fe2.tar.gz
phosphor-debug-collector-ab741df3415931d146460af88e79716e4bd40fe2.zip
ffdc: Added -e option to enable dump specific functions
Added support for the dump specific filename format. Change-Id: I8771017c5a029675f98bca54170dc3330ac2c24d Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
-rw-r--r--ffdc14
1 files changed, 14 insertions, 0 deletions
diff --git a/ffdc b/ffdc
index 3adf81c..4ee0814 100644
--- a/ffdc
+++ b/ffdc
@@ -1,5 +1,7 @@
#!/bin/sh
+# TODO openbmc/openbmc#1622 remove -e option related changes.
+
help=$'FFDC File Collection Script
Collects various FFDC files and system parameters and places them in a .tar
@@ -9,6 +11,7 @@ usage: ffdc [OPTION]
Options:
-d, --dir <directory> Specify destination directory. Defaults to /tmp if
invalid or unspecified.
+ -e, --enable_dump Enable BMC Dump specific features.
-h, --help Display this help text and exit.
'
@@ -38,6 +41,7 @@ declare -a arr=(
dir=$"ffdc_$(date +"%Y-%m-%d_%H-%M-%S")"
dest="/tmp"
+enable_dump=false
while [[ $# -gt 0 ]]; do
key="$1"
@@ -52,6 +56,10 @@ while [[ $# -gt 0 ]]; do
fi
shift 2
;;
+ -e|--enable_dump)
+ enable_dump=true
+ shift
+ ;;
-h|--help)
echo "$help"
exit
@@ -65,6 +73,12 @@ done
echo "Using destination directory $dest"
+if [ $enable_dump = true ]; then
+ id=$(basename $dest)
+ printf -v f_id "%08d" $id
+ dir=$"obmcdump_"$f_id"_$(date +"%s")"
+fi
+
mkdir -p "$dest/$dir"
for ((i=0;i<${#arr[@]};i+=2)); do
OpenPOWER on IntegriCloud