47 #include "deviceUpdateMgr.h"
48 #include "deviceUpdateMgrInternal.h"
49 #include "jsonParser.h"
62 #include "safec_lib.h"
67 #include "secure_wrapper.h"
70 pthread_mutex_t tMutexLock;
71 IARM_Result_t AcceptUpdate(
void *arg);
72 void sendDownLoadInit(
int id);
73 void sendLoadInit(
int id);
75 void processDeviceFile(
string filePath,
string);
76 void processDeviceFolder(
string updatePath,
string);
77 IARM_Result_t deviceUpdateStart(
void);
78 void deviceUpdateRun(list<JSONParser::varVal *> *folders);
79 IARM_Result_t deviceUpdateStop(
void);
80 bool initialized =
false;
81 void _deviceUpdateEventHandler(
const char *owner, IARM_EventId_t eventId,
void *data,
size_t len);
83 map<string, JSONParser::varVal *> configuration;
85 string serverUpdatePath=
"/srv/device_update/";
86 string tempFilePath=
"/tmp/devUpdate/";
87 bool interactiveDownload=
false;
88 bool interactiveLoad=
false;
90 int loadTimeAfterInactive=0;
92 bool backgroundDownload=
true;
93 int requestedPercentIncrement=10;
94 int recheckForUpdatesMin=0;
95 bool loadImageImmediately=
false;
96 bool forceUpdate=
false;
98 int delayTillAnnounceTimeMin=10;
99 int announceCounter=10;
100 bool oneAnnouncePerRun=
false;
105 static pthread_mutex_t mapMutex;
117 map<int, updateInProgress_t *> *updatesInProgress =
new map<int, updateInProgress_t *>();
120 #ifdef RDK_LOGGER_ENABLED
122 int b_rdk_logger_enabled = 0;
124 void logCallback(
const char *buff)
129 int main(
int argc,
char *argv[])
131 const char* debugConfigFile = NULL;
136 if (strcmp(argv[itr],
"--debugconfig") == 0)
141 debugConfigFile = argv[itr];
151 #ifdef RDK_LOGGER_ENABLED
154 IARM_Bus_RegisterForLog(logCallback);
159 time_t tim=time(NULL);
160 tm *now=localtime(&tim);
161 INT_LOG(
"Date is %d/%02d/%02d\n", now->tm_year+1900, now->tm_mon+1, now->tm_mday);
162 INT_LOG(
"Time is %02d:%02d\n", now->tm_hour, now->tm_min);
165 if (deviceUpdateStart() == IARM_RESULT_SUCCESS)
170 list<JSONParser::varVal *> *folders = folderRef->array;
171 deviceUpdateRun(folders);
173 INT_LOG(
"NO FOLDERS IN CONFIG FILE!!!!!!!!!!");
180 IARM_Result_t deviceUpdateStart()
183 IARM_Result_t status = IARM_RESULT_INVALID_STATE;
186 setvbuf(stdout, NULL, _IOLBF, 0);
187 int ret = pthread_mutex_init(&mapMutex, NULL);
189 INT_LOG(
" pthread_mutex_init Error case: %d\n", __LINE__);
190 status = IARM_RESULT_INVALID_STATE;
196 int retval = pthread_mutex_init(&tMutexLock, NULL);
198 INT_LOG(
" pthread_mutex_init Error case: %d\n", __LINE__);
200 pthread_mutex_lock(&tMutexLock);
202 INT_LOG(
"dumMgr:I-ARM IARM_Bus_Init Mgr: %d\n", rc);
205 INT_LOG(
"dumMgr:I-ARM IARM_Bus_Connect Mgr: %d\n", rc);
208 INT_LOG(
"dumMgr:I-ARM IARM_Bus_RegisterEvent Mgr: %d\n", rc);
211 INT_LOG(
"dumMgr:I-ARM IARM_BUS_DEVICE_UPDATE_API_AcceptUpdate Mgr: %d\n", rc);
214 _deviceUpdateEventHandler);
216 _deviceUpdateEventHandler);
218 _deviceUpdateEventHandler);
220 _deviceUpdateEventHandler);
224 pthread_mutex_unlock(&tMutexLock);
225 status = IARM_RESULT_SUCCESS;
230 INT_LOG(
"dumMgr: I-ARM Device Update Mgr Error case: %d\n", __LINE__);
231 status = IARM_RESULT_INVALID_STATE;
238 string confName =
"deviceUpdateConfig.json";
243 filePath =
"/opt/" + confName;
245 if (!_fileExists(filePath))
247 filePath =
"/mnt/nfs/env/" + confName;
248 if (!_fileExists(filePath))
250 filePath =
"/etc/" + confName;
251 if (!_fileExists(filePath))
254 if (!_fileExists(filePath))
258 "I-ARM DevUpdate Mgr: Configuration error. Configuration file(s) missing, no folders to watch!!\n");
266 INT_LOG(
"loading config file %s\n", filePath.c_str());
267 if ((fp = fopen(filePath.c_str(),
"r")) != NULL)
272 while (!feof(fp) && confData.length() < 65535)
274 memset(buf,
'\0',
sizeof(buf));
275 if (0 >= fread(buf, 1,
sizeof(buf) - 1, fp))
277 INT_LOG(
"dumMgr fread failed \n");
281 confData.append(buf);
292 configuration = parser.parse((
const unsigned char *) confData.c_str());
317 if(configuration[
"serverUpdatePath"]!=NULL)
319 serverUpdatePath=configuration[
"serverUpdatePath"]->str;
322 INT_LOG(
"error: no serverUpdatePath in config\n");
324 if(configuration[
"tempFilePath"]!=NULL)
326 tempFilePath=configuration[
"tempFilePath"]->str;
329 INT_LOG(
"error: no tempFilePath in config\n");
331 if(configuration[
"forceUpdate"]!=NULL)
333 forceUpdate=configuration[
"forceUpdate"]->boolean;
336 INT_LOG(
"error: no forceUpdate in config\n");
338 if(configuration[
"interactiveDownload"]!=NULL)
340 interactiveDownload=configuration[
"interactiveDownload"]->boolean;
343 INT_LOG(
"error: no interactiveDownload in config\n");
345 if(configuration[
"interactiveLoad"]!=NULL)
347 interactiveLoad=configuration[
"interactiveLoad"]->boolean;
350 INT_LOG(
"error: no interactiveLoad in config\n");
352 if(configuration[
"loadDelayType"]!=NULL)
354 loadDelayType=atoi(configuration[
"loadDelayType"]->str.c_str());
357 INT_LOG(
"error: no loadDelayType in config\n");
359 if(configuration[
"loadTimeAfterInactive"]!=NULL)
361 loadTimeAfterInactive=atoi(configuration[
"loadTimeAfterInactive"]->str.c_str());
364 INT_LOG(
"error: no loadTimeAfterInactive in config\n");
366 if(configuration[
"timeToLoad"]!=NULL)
368 timeToLoad=atoi(configuration[
"timeToLoad"]->str.c_str());
371 INT_LOG(
"error: no timeToLoad in config\n");
373 if(configuration[
"backgroundDownload"]!=NULL)
375 backgroundDownload=configuration[
"backgroundDownload"]->boolean;
376 INT_LOG (
"setting backgroundDownload=%s\n",backgroundDownload?
"true":
"false");
379 INT_LOG(
"error: no backgroundDownload in config\n");
382 if(configuration[
"loadImageImmediately"]!=NULL)
384 loadImageImmediately=configuration[
"loadImageImmediately"]->boolean;
385 INT_LOG (
"setting loadImageImmediately=%s\n",loadImageImmediately?
"true":
"false");
388 INT_LOG(
"error: no loadImageImmediately in config\n");
391 if(configuration[
"loadBeforeHour"]!=NULL)
393 loadBeforeHour=atoi(configuration[
"loadBeforeHour"]->str.c_str());;
396 INT_LOG(
"error: no loadBeforeHour in config\n");
399 if(configuration[
"requestedPercentIncrement"]!=NULL)
401 requestedPercentIncrement=atoi(configuration[
"requestedPercentIncrement"]->str.c_str());
404 INT_LOG(
"error: no requestedPercentIncrement in config\n");
406 if(configuration[
"recheckForUpdatesMin"]!=NULL)
408 recheckForUpdatesMin=atoi(configuration[
"recheckForUpdatesMin"]->str.c_str());
410 if(configuration[
"delayTillAnnounceTimeMin"]!=NULL)
412 delayTillAnnounceTimeMin=atoi(configuration[
"delayTillAnnounceTimeMin"]->str.c_str());
413 INT_LOG (
"setting delayTillAnnounceTimeMin=%d\n",delayTillAnnounceTimeMin);
416 INT_LOG(
"warning: no delayTillAnnounceTimeMin in config!\n");
418 if(configuration[
"oneAnnouncePerRun"]!=NULL)
420 oneAnnouncePerRun=configuration[
"oneAnnouncePerRun"]->boolean;
421 INT_LOG (
"setting oneAnnouncePerRun=%s\n",oneAnnouncePerRun?
"true":
"false");
424 INT_LOG(
"warning: no oneAnnouncePerRun in config!\n");
428 INT_LOG(
"running with config:\n");
429 INT_LOG (
" serverUpdatePath= %s\n",serverUpdatePath.c_str());
430 INT_LOG (
" tempFilePath=%s\n",tempFilePath.c_str());
431 INT_LOG (
" interactiveDownload=%s\n",interactiveDownload?
"true":
"false");
432 INT_LOG (
" interactiveLoad=%s\n",interactiveLoad?
"true":
"false");
433 INT_LOG (
" loadDelayType=%d\n",loadDelayType);
434 INT_LOG (
" loadTimeAfterInactive=%d\n",loadTimeAfterInactive);
435 INT_LOG (
" timeToLoad=%d\n",timeToLoad);
436 INT_LOG (
" backgroundDownload=%s\n",backgroundDownload?
"true":
"false");
437 INT_LOG (
" loadImageImmediately=%s\n",loadImageImmediately?
"true":
"false");
438 INT_LOG (
" loadBeforeHour=%d\n",loadBeforeHour);
439 INT_LOG (
" requestedPercentIncrement=%d\n",requestedPercentIncrement);
440 INT_LOG (
" recheckForUpdatesMin=%d\n",recheckForUpdatesMin);
441 INT_LOG (
" delayTillAnnounceTimeMin=%d\n",delayTillAnnounceTimeMin);
500 void processDeviceFolder(
string updatePath,
string deviceName)
504 INT_LOG(
"dumMgr:processing device folder:%s\n", updatePath.c_str());
505 if ((dp = opendir(updatePath.c_str())) == NULL)
507 INT_LOG(
"dumMgr:Error(%d) opening updatePath \n", errno);
512 INT_LOG(
"dumMgr:checking folder files\n");
513 while ((dirp = readdir(dp)) != NULL)
515 INT_LOG(
"dumMgr:checking folder files:%s - type=%d\n",dirp->d_name,dirp->d_type);
516 if (dirp->d_type != DT_DIR)
519 string filename = dirp->d_name;
520 INT_LOG(
"dumMgr:checking file:%s\n", filename.c_str());
521 unsigned int idx = filename.rfind(
'.');
522 if (idx != string::npos)
524 string ext = filename.substr(idx + 1);
527 idx = filename.rfind(
'.', idx);
528 if (idx == string::npos)
532 string ext = filename.substr(idx + 1);
535 processDeviceFile(updatePath +
"/" + filename, deviceName);
541 processDeviceFile(updatePath +
"/" + filename, deviceName);
551 void processDeviceFile(
string filePath,
string deviceName)
553 INT_LOG(
"dumMgr:processing Device File:%s\n", filePath.c_str());
554 string cmd =
"rm -rf ";
557 v_secure_system(cmd.c_str());
564 v_secure_system(cmd.c_str());
568 cmd =
"tar -xzpf " + filePath +
" -C " + tempFilePath;
570 v_secure_system(cmd.c_str());
574 vector<string> *myfiles = getdir(tempFilePath);
575 vector<string>::iterator itr;
578 INT_LOG(
"dumMgr: searching Device File:%s\n", filePath.c_str());
579 for (itr = myfiles->begin(); itr != myfiles->end(); itr++)
581 string filename = *itr;
583 int idx = filename.rfind(
'.');
584 if (idx == string::npos)
588 string ext = filename.substr(idx + 1);
593 strncpy(myData.deviceImageFilePath, filePath.c_str(), (IARM_BUS_DEVICE_UPDATE_PATH_LENGTH - 1));
594 myData.deviceImageFilePath[IARM_BUS_DEVICE_UPDATE_PATH_LENGTH - 1] = 0;
595 if (getEventData(tempFilePath + filename, &myData))
598 INT_LOG(
"dumMgr:sending announce event");
602 if (retval == IARM_RESULT_SUCCESS)
610 INT_LOG(
"dumMgr:Announce Event problem, %i\n", retval);
619 INT_LOG(
"dumMgr: Failed in searching Device File:[%s]. getdir returned NULL\n", filePath.c_str());;
624 string getXMLTagText(
string xml,
string tag)
628 int idx = xml.find(
"<" + tag);
629 if (idx == string::npos)
631 INT_LOG(
"dumMgr:tag <%s> not found in xml file: aborting\n", tag.c_str());
635 idx += tag.length() + 2;
638 int idx2 = xml.find(
"</" + tag);
641 return xml.substr(idx, idx2 - idx);
649 std::ifstream myfile;
651 INT_LOG(
"dumMgr:--------------------Checking tar File %s\n", filename.c_str());
652 myfile.open(filename.c_str(), std::ifstream::in);
653 if (myfile.is_open())
655 myfile.seekg(0, myfile.end);
656 int length = myfile.tellg();
657 myfile.seekg(0, myfile.beg);
658 char * buffer =
new char[length + 1];
663 myfile.read(buffer, length);
665 fileContents = buffer;
669 string text = getXMLTagText(fileContents,
"image:softwareVersion");
670 if (text.length() == 0)
672 INT_LOG(
"dumMgr:--------------------Missing Version %s\n", filename.c_str());
675 rc = strcpy_s(myData->deviceImageVersion,
sizeof(myData->deviceImageVersion), text.c_str());
681 text = getXMLTagText(fileContents,
"image:type");
682 myData->deviceImageType = atoi(text.c_str());
684 text = getXMLTagText(fileContents,
"image:productName");
685 rc = strcpy_s(myData->deviceName,
sizeof(myData->deviceName), text.c_str());
694 myData->forceUpdate = forceUpdate;
695 INT_LOG(
"dumMgr:--------------------Done with tar File %s\n", filename.c_str());
699 void deviceUpdateRun(list<JSONParser::varVal *> *folders)
706 if(announceCounter==(delayTillAnnounceTimeMin*60)){
709 int numFolders=folders->size();
710 INT_LOG(
"We have %d folders to watch\n",numFolders);
711 if(oneAnnouncePerRun){
715 time_t theTime = time(NULL);
716 struct tm *aTime = localtime(&theTime);
717 int day = aTime->tm_mday;
718 int selectedUpdate=day%(numFolders);
719 INT_LOG(
"today is :%d, so only checking folder %d (mod %d)\n",day,selectedUpdate,numFolders);
721 for (list<JSONParser::varVal *>::iterator arrayItr = folders->begin(); arrayItr != folders->end();arrayItr++)
723 string updateFolder = (*arrayItr)->str;
724 if(selectedUpdate<=0){
725 string updatePath = serverUpdatePath + updateFolder;
726 INT_LOG(
"checking folder:%s\n",updatePath.c_str());
728 if (updatePath.length() > 0)
730 if (_folderExists(updatePath))
732 INT_LOG(
"I-ARM DevUpdate Mgr: processing folder location <%s>\n", updatePath.c_str());
733 processDeviceFolder(updatePath, updateFolder);
739 INT_LOG(
"skipping folder:%s\n",updateFolder.c_str());
746 for (list<JSONParser::varVal *>::iterator arrayItr = folders->begin(); arrayItr != folders->end();arrayItr++)
748 string updateFolder = (*arrayItr)->str;
749 string updatePath = serverUpdatePath + updateFolder;
750 INT_LOG(
"checking folder:%s\n",updatePath.c_str());
752 if (updatePath.length() > 0)
754 if (_folderExists(updatePath))
756 INT_LOG(
"I-ARM DevUpdate Mgr: processing folder location <%s>\n", updatePath.c_str());
757 processDeviceFolder(updatePath, updateFolder);
764 INT_LOG(
"Done with FOLDERS TO WATCH!!! \n");
769 INT_LOG(
"ERROR - NO FOLDERS TO WATCH!!! \n");
777 if (updatesInProgress->size() > 0)
780 INT_LOG(
"deviceUpdateMgr - updates in progress:\n");
781 map<int, updateInProgress_t *>::iterator pos = updatesInProgress->begin();
782 while (pos != updatesInProgress->end())
784 INT_LOG(
" UpdateID:%d deviceID:%d percentDownload:%d Loaded:%d file:%s\n", pos->first,
785 pos->second->acceptParams->deviceID, pos->second->downloadPercent, pos->second->loadComplete,
786 pos->second->acceptParams->deviceImageFilePath);
787 if (pos->second->errorCode > 0)
789 INT_LOG(
" ERROR on UpdateID:%d Type:%d Message:%s\n", pos->first, pos->second->errorCode,
790 pos->second->errorMsg.c_str());
803 IARM_Result_t AcceptUpdate(
void *arg)
807 INT_LOG(
"dumMgr:Accept Update recieved\n");
810 param->updateSessionID = nextID++;
811 INT_LOG(
"dumMgr:update Session ID=%d\n", param->updateSessionID);
812 param->interactiveDownload = interactiveDownload;
813 param->interactiveLoad = interactiveLoad;
820 uip->acceptParams = updateParams;
821 pthread_mutex_lock(&mapMutex);
822 updatesInProgress->insert(pair<int, updateInProgress_t *>(param->updateSessionID, uip));
823 pthread_mutex_unlock(&mapMutex);
826 INT_LOG(
"dumMgr:Accept Update return success\n");
827 return IARM_RESULT_SUCCESS;
830 IARM_Result_t deviceUpdateStop(
void)
834 pthread_mutex_lock(&tMutexLock);
838 pthread_mutex_unlock(&tMutexLock);
839 pthread_mutex_destroy(&tMutexLock);
841 return IARM_RESULT_SUCCESS;
845 return IARM_RESULT_INVALID_STATE;
858 pthread_mutex_lock(&mapMutex);
860 pthread_mutex_unlock(&mapMutex);
865 void _deviceUpdateEventHandler(
const char *owner, IARM_EventId_t eventId,
void *data,
size_t len)
872 pthread_mutex_lock(&tMutexLock);
876 case IARM_BUS_DEVICE_UPDATE_EVENT_READY_TO_DOWNLOAD:
879 INT_LOG(
"I-ARM: got event IARM_BUS_DEVICE_UPDATE_EVENT_READY_TO_DOWNLOAD\n");
885 INT_LOG(
"I-ARM: got valid updateSessionID Details:\n");
886 INT_LOG(
"I-ARM: currentSWVersion:%s\n", eventData->deviceCurrentSWVersion);
887 INT_LOG(
"I-ARM: newSWVersion:%s\n", eventData->deviceNewSoftwareVersion);
888 INT_LOG(
"I-ARM: deviceHWVersion:%s\n", eventData->deviceHWVersion);
889 INT_LOG(
"I-ARM: deviceBootloaderVersion:%s\n", eventData->deviceBootloaderVersion);
890 INT_LOG(
"I-ARM: deviceName:%s\n", eventData->deviceName);
891 INT_LOG(
"I-ARM: totalSize:%i\n", eventData->totalSize);
892 INT_LOG(
"I-ARM: deviceImageType:%i\n", eventData->deviceImageType);
894 if(interactiveDownload==
false){
895 sendDownLoadInit(eventData->updateSessionID);
898 INT_LOG(
"I-ARM: Interactive Download is true so not sending download Init message\n");
903 INT_LOG(
"I-ARM: did not get valid updateSessionID Got id:%d\n", eventData->updateSessionID);
908 case IARM_BUS_DEVICE_UPDATE_EVENT_DOWNLOAD_STATUS:
911 INT_LOG(
"I-ARM: got event IARM_BUS_DEVICE_UPDATE_EVENT_DOWNLOAD_STATUS\n");
916 INT_LOG(
"I-ARM: percentComplete:%i\n", eventData->percentComplete);
918 uip->downloadPercent = eventData->percentComplete;
919 if(uip->downloadPercent>=100){
920 if(interactiveLoad==
false){
921 sendLoadInit(eventData->updateSessionID);
924 INT_LOG(
"I-ARM: Interactive load is true so not sending load Init message\n");
928 INT_LOG(
"I-ARM: Not ready to load yet:%i\n", eventData->percentComplete);
933 INT_LOG(
"I-ARM: IARM_BUS_DEVICE_UPDATE_EVENT_DOWNLOAD_STATUS invalid updateSessionID Got id:%d\n",
934 eventData->updateSessionID);
938 case IARM_BUS_DEVICE_UPDATE_EVENT_LOAD_STATUS:
941 INT_LOG(
"I-ARM: got event IARM_BUS_DEVICE_UPDATE_EVENT_LOAD_STATUS\n");
946 INT_LOG(
"I-ARM: Complete:%s\n", eventData->loadStatus == 1 ?
"true" :
"false");
947 uip->loadComplete = eventData->loadStatus == 1 ? true :
false;
948 if (uip->loadComplete == 1)
950 INT_LOG(
"I-ARM:load Complete!!!\n");
957 INT_LOG(
"I-ARM: IARM_BUS_DEVICE_UPDATE_EVENT_DOWNLOAD_STATUS invalid updateSessionID Got id:%d\n",
958 eventData->updateSessionID);
962 case IARM_BUS_DEVICE_UPDATE_EVENT_ERROR:
965 INT_LOG(
"I-ARM: got event IARM_BUS_DEVICE_UPDATE_EVENT_ERROR\n");
971 uip->errorCode = eventData->errorType;
972 uip->errorMsg.assign((
const char *) (eventData->errorMessage));
973 INT_LOG(
"I-ARM: errorMessage:%s\n", eventData->errorMessage);
974 INT_LOG(
"I-ARM: errorType:%i\n", eventData->errorType);
978 INT_LOG(
"I-ARM: IARM_BUS_DEVICE_UPDATE_EVENT_DOWNLOAD_STATUS invalid updateSessionID Got id:%d\n",
979 eventData->updateSessionID);
984 INT_LOG(
"I-ARM: unknown event type \n");
988 pthread_mutex_unlock(&tMutexLock);
993 INT_LOG(
"I-ARM:_DevUpdateEventHandler event type not meant for me <%s>...\n", owner);
997 void sendDownLoadInit(
int id)
1002 memset(&eventData, 0,
sizeof(eventData));
1003 eventData.updateSessionID = id;
1004 eventData.backgroundDownload = backgroundDownload;
1005 eventData.requestedPercentIncrement = requestedPercentIncrement;
1006 eventData.loadImageImmediately=loadImageImmediately;
1008 (IARM_EventId_t) IARM_BUS_DEVICE_UPDATE_EVENT_DOWNLOAD_INITIATE, (
void *) &eventData,
sizeof(eventData));
1009 if (retval == IARM_RESULT_SUCCESS)
1012 INT_LOG(
"I-ARM:IARM_BUS_DEVICE_UPDATE_EVENT_DOWNLOAD_INITIATE Event sent successfully");
1017 INT_LOG(
"I-ARM:IARM_BUS_DEVICE_UPDATE_EVENT_DOWNLOAD_INITIATE Event problem, %i", retval);
1021 void sendLoadInit(
int id)
1026 memset(&eventData, 0,
sizeof(eventData));
1027 eventData.updateSessionID = id;
1028 eventData.loadDelayType = (IARM_Bus_Device_Update_LoadDelayType_t)loadDelayType;
1029 eventData.timeAfterInactive = loadTimeAfterInactive;
1034 time_t tim=time(NULL);
1035 tm *now=localtime(&tim);
1036 INT_LOG(
"Time is %02d:%02d\n", now->tm_hour, now->tm_min);
1040 INT_LOG(
"diff time is %i hours\n",loadBeforeHour-now->tm_hour);
1041 if(loadBeforeHour>now->tm_hour){
1043 eventData.timeToLoad = 0;
1045 INT_LOG(
"doing immediate load\n");
1050 eventData.timeToLoad=(24+(loadBeforeHour-now->tm_hour))*60*60;
1052 INT_LOG(
"Waiting till tomorrow - delay of %i seconds\n",eventData.timeToLoad);
1059 (IARM_EventId_t) IARM_BUS_DEVICE_UPDATE_EVENT_LOAD_INITIATE, (
void *) &eventData,
sizeof(eventData));
1060 if (retval == IARM_RESULT_SUCCESS)
1064 INT_LOG(
"I-ARM:IARM_BUS_DEVICE_UPDATE_EVENT_LOAD_INITIATE Event sent successfully");
1069 INT_LOG(
"I-ARM:IARM_BUS_DEVICE_UPDATE_EVENT_LOAD_INITIATE Event problem, %i", retval);