Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/rdk/getDeviceDetails.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ logFile="/opt/logs/getDeviceDetails.$$.log"
lockDir=/tmp/.getDeviceDetails.lock
lockPidFile=/tmp/.getDeviceDetails.lock/.lockPidFile
deviceDetailsCache=/tmp/.deviceDetails.cache
GDD_TRACE=${GDD_TRACE:-1}
trace_gdd() {
[ "$GDD_TRACE" = "1" ] && echo "GDD_TRACE: ts=$(date +%s) pid=$$ cmd=$command param=$parameter $*" >> /tmp/gdd_trace.log
}
Comment thread
nanimatta marked this conversation as resolved.
Comment on lines +35 to +38

# to enable logging: uncomment out echo and comment out colon :
logMsg()
Expand Down Expand Up @@ -408,7 +412,9 @@ executeServiceRequest()
echo "$IPAddress" > /tmp/.estb_ip
;;
"macAddress" | "estb_mac")
trace_gdd "estb_mac_start"
MacAddress=`getEstbMacAddress`
trace_gdd "estb_mac_done rc=$?"
Comment on lines +415 to +417
echo "$MacAddress" > /tmp/.macAddress
echo "$MacAddress" > /tmp/.estb_mac
;;
Expand All @@ -428,7 +434,9 @@ executeServiceRequest()
"wifi_mac")
[ -f /proc/device-tree/wifi-mac-addr ] && WiFiMac=$(cat /proc/device-tree/wifi-mac-addr) || WiFiMac=
if [ "$WiFiMac" == "" ]; then
trace_gdd "wifi_mac_start"
getWiFiMac
trace_gdd "wifi_mac_done rc=$?"
fi
echo "$WiFiMac" > /tmp/.wifi_mac
;;
Expand Down Expand Up @@ -544,6 +552,7 @@ updateMissingParameters()

lock()
{
trace_gdd "lock_wait_start"
locktime=0
while ! mkdir "$lockDir" &>/dev/null ; do
logMsg "wait to acquire lock"
Expand All @@ -566,6 +575,7 @@ lock()
echo "$$" > $lockPidFile
logMsg "lock acquired successfully"
trap 'unlock "active process"' 0 1 13 15 &>/dev/null
trace_gdd "lock_wait_done"
}

unlock()
Expand Down