summaryrefslogtreecommitdiff
path: root/recipes-kernel/rs9113
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2021-12-09 09:19:20 -0600
committerSerhii Voloshynov <serhii.voloshynov@globallogic.com>2022-01-11 16:55:40 +0200
commite183f5fb4fda9eb2a9af423453adf4332810005b (patch)
treeeae37bc4752232cd04b291ca3aaab4e6775015a1 /recipes-kernel/rs9113
parent6b6d8a2e79d1f5fa6c09b8ae603908bd59e5c4ba (diff)
downloadmeta-multitech-atmel-e183f5fb4fda9eb2a9af423453adf4332810005b.tar.gz
meta-multitech-atmel-e183f5fb4fda9eb2a9af423453adf4332810005b.tar.bz2
meta-multitech-atmel-e183f5fb4fda9eb2a9af423453adf4332810005b.zip
Improve logging in /etc/init.d/rs9113
Diffstat (limited to 'recipes-kernel/rs9113')
-rwxr-xr-xrecipes-kernel/rs9113/files/rs9113/rs9113.init23
1 files changed, 12 insertions, 11 deletions
diff --git a/recipes-kernel/rs9113/files/rs9113/rs9113.init b/recipes-kernel/rs9113/files/rs9113/rs9113.init
index ced9e35..5a5ed47 100755
--- a/recipes-kernel/rs9113/files/rs9113/rs9113.init
+++ b/recipes-kernel/rs9113/files/rs9113/rs9113.init
@@ -25,22 +25,23 @@ RSTLOG=/var/config/rs9113rstlog
pid=$$
LOG_ERR=3
LOG_INFO=6
-
-prefix="<${pr}>rs9113[${pid}]: "
+name=rs9113
+format="%s[%d] %12.2fs: %s"
+prefix1="<${pr}>rs9113[${pid}]: "
+prefix2="rs9113[${pid}]: "
function syslog {
pr=$1
shift
- [[ $(cat /proc/uptime =~ ([^[:space:]]+) ]]
- s=$(printf "%12.12fs %s" ${BASH_REMATCH[1]} "${prefix}$@")
- echo "$s" >/dev/kmsg
- echo "$s"
+ [[ $(cat /proc/uptime) =~ ([^[:space:]]+) ]]
+ s=$(printf "${format}" $name $pid ${BASH_REMATCH[1]} "$@")
+ echo "<${pr}>${s}" >/dev/kmsg
echo "$s" >>${RSTLOG}
}
function logfile {
- [[ $(cat /proc/uptime =~ ([^[:space:]]+) ]]
- s=$(printf "%12.12fs %s" ${BASH_REMATCH[1]} "${prefix}$@")
- echo "$s" >${RSTLOG}
+ [[ $(cat /proc/uptime) =~ ([^[:space:]]+) ]]
+ s=$(printf "${format}" $pr $name $pid ${BASH_REMATCH[1]} "$@")
+ echo "$s" >>${RSTLOG}
}
function logpipe {
@@ -92,7 +93,7 @@ case "$1" in
exit 0
fi
rs9113_reset
- syslog LOG_INFO "Loading rs9113 modules with COEX=$COEX_MODE and Country=$SET_COUNTRY_CODE"
+ syslog $LOG_INFO "Loading rs9113 modules with COEX=$COEX_MODE and Country=$SET_COUNTRY_CODE"
/usr/sbin/rs9113_load_modules.sh $CONFIG
RETVAL=$?
if [ $RETVAL -eq 0 ] ; then
@@ -103,7 +104,7 @@ case "$1" in
;;
stop)
- syslog LOG_INFO "Unloading rs9113 modules"
+ syslog $LOG_INFO "Unloading rs9113 modules"
/usr/sbin/rs9113_remove_modules.sh
RETVAL=$?
if [ $RETVAL -eq 0 ] ; then