Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP1:GA
kdump.17334
kdump-kdump_echo-and-kdump_logger-helpers.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File kdump-kdump_echo-and-kdump_logger-helpers.patch of Package kdump.17334
From: Lance Wang <lzwang@suse.com> Date: Tue, 16 Jan 2018 13:37:37 +0100 Subject: load.sh: introduce kdump_echo and kdump_logger helpers References: bsc#951144 Upstream: merged Git-commit: b76b8fccbac6a7d2340d0452a6ba86530f588bfa Instead of checking the verbosity flags every time, check them once and provide an appropriate function definition. Signed-off-by: Lance Wang <lzwang@suse.com> --- init/load.sh | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) --- a/init/load.sh +++ b/init/load.sh @@ -163,9 +163,7 @@ function load_kdump_kexec() KEXEC_CALL="$KEXEC -p $kdump_kernel --append=\"$kdump_commandline\"" KEXEC_CALL="$KEXEC_CALL --initrd=$kdump_initrd $kexec_options" - if [ $((${KDUMP_VERBOSE:-0} & 4)) -gt 0 ] ; then - echo "Loading kdump kernel: $KEXEC_CALL" - fi + kdump_echo "Loading kdump kernel: $KEXEC_CALL" local output output=$(eval "$KEXEC_CALL" 2>&1) @@ -179,14 +177,10 @@ function load_kdump_kexec() # would be supressed (bnc#374185) echo -n "$output" - if [ $((${KDUMP_VERBOSE:-0} & 1)) -gt 0 ] ; then - if [ $result -eq 0 ] ; then - logger -i -t kdump \ - "Loaded kdump kernel: $KEXEC_CALL, Result: $output" - else - logger -i -t kdump \ - "FAILED to load kdump kernel: $KEXEC_CALL, Result: $output" - fi + if [ $result -eq 0 ] ; then + kdump_logger "Loaded kdump kernel: $KEXEC_CALL, Result: $output" + else + kdump_logger "FAILED to load kdump kernel: $KEXEC_CALL, Result: $output" fi return $result @@ -299,6 +293,24 @@ function rebuild_kdumprd() eval $($KDUMPTOOL dump_config) +if [ $((${KDUMP_VERBOSE:-0} & 4)) -gt 0 ] ; then + function kdump_echo() + { + echo "$@" + } +else + function kdump_echo(){ :; } +fi + +if [ $((${KDUMP_VERBOSE:-0} & 1)) -gt 0 ] ; then + function kdump_logger() + { + logger -i -t kdump "$@" + } +else + function kdump_logger(){ :; } +fi + if [ $((${KDUMP_VERBOSE:-0} & 16)) -gt 0 ] ; then KDUMPTOOL="$KDUMPTOOL -D" fi
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor