mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-09 12:49:24 +00:00
HV:Acrn-hypvervisor Root Directory Clean-up and create misc/ folder for Acrn daemons, services and tools.
This patch is to clean-up acrn-hypervisor root directory, targt only 5 folders under acrn-hypervisor:1.hypervisor,2.devicemodel,3.misc,4.doc,5.build Tracked-On: #3482 Signed-off-by: Terry Zou <terry.zou@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
53
misc/tools/acrn-crashlog/data/usercrash-wrapper
Executable file
53
misc/tools/acrn-crashlog/data/usercrash-wrapper
Executable file
@@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (C) <2018> Intel Corporation
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
if [ $# != 13 ]; then
|
||||
logger "Expected 13 arguments, got $#"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
# Error Handling
|
||||
default_core_pattern_file="/var/log/crashlog/default_core_pattern"
|
||||
|
||||
if [ ! -f $default_core_pattern_file ]; then
|
||||
logger "File default_core_pattern doesn't exist under /var/log/crashlog"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
# We know the parameter order
|
||||
my_order=(%E %P %u %g %s %t %c %h %e %p %i %I %d)
|
||||
my_params=($*)
|
||||
|
||||
# An O(n^2) function to look up the value
|
||||
function get_params()
|
||||
{
|
||||
local ret=""
|
||||
for args in $*
|
||||
do
|
||||
for index in ${!my_order[@]}
|
||||
do
|
||||
if [ ${my_order[${index}]} = ${args} ]
|
||||
then
|
||||
ret="${ret} ${my_params[${index}]}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
done
|
||||
echo ${ret}
|
||||
}
|
||||
|
||||
# get default core_pattern parameters list
|
||||
default_content=`cat $default_core_pattern_file`
|
||||
default_params=${default_content#* }
|
||||
|
||||
# abstract the application of the default core_pattern
|
||||
t_app=${default_content%% *}
|
||||
default_app=${t_app#*|}
|
||||
|
||||
usercrash_var=$(get_params "%p %e %s")
|
||||
default_var=$(get_params ${default_params})
|
||||
|
||||
tee >(/usr/bin/usercrash_c ${usercrash_var}) | ${default_app} ${default_var}
|
Reference in New Issue
Block a user