How to shorten the probation period after software update

Hi,

our WP7607 application is based upon R13.1 (legato 19.02).
Apparently the probation counter is not only incremented after a crash, but, also when you disconnect/connect the supply from the hardware board.
This means that if you do this 4 times within a few minutes, that your system will be replaced by the previous version.
To avoid this behaviour in our production environment, the legato system is flashed in the modules, and afterwards we use a script to mark the system as ‘good’. (it calls ‘update --mark-good’.)

I wonder how a technician can do this after a system update in the field, using an USB stick.

  • We tried to call le_updateCtrl_MarkGood(true) while handling the state LE_UPDATE_STATE_SUCCESS in our updater application.
    Apparently, this had no effect.
  • We tried to add LE_PROBATION_MS=60000 in the envVars section of our main application.
    Apparently, the updateDaemon stills uses 1800000 (30 min) as probation period because our main application only starts several seconds after the updateDaemon service.

Does anybody have a solution to shorten the probation period, or mark the system as ‘good’, as a default?

Greetings,
annaertd

Hi annaertd,

How do you call le_updateCtrl_MarkGood() in your app?
It works for me quite well, below my test log:

[running] helloWorld
root@swi-mdm9x28:~# legato status
Systems installed:
  11 [good]
  12 [tried 1] <-- current
Legato framework is running.
root@swi-mdm9x28:~# logread -f
Oct 25 02:48:12 swi-mdm9x28 user.debug Legato:  DBUG | helloWorld[3121]/framework T=main | le_updateCtrl_client.c le_updateCtrl_MarkGood() 813 | Sending message to server and waiting for response : 1 bytes sent
Oct 25 02:48:12 swi-mdm9x28 user.info Legato:  INFO | updateDaemon[619]/updateDaemon T=main | updateDaemon.c updateDaemon_MarkGood() 228 | System passed probation. Marking 'good'.
Oct 25 02:48:12 swi-mdm9x28 user.info Legato:  INFO | updateDaemon[619]/updateDaemon T=main | system.c system_RemoveUnusedApps() 990 | App with MD5 sum 1e1e104ef8b8fe3bf1e425ef7d1fc84d is still needed.
Oct 25 02:48:12 swi-mdm9x28 user.info Legato:  INFO | updateDaemon[619]/updateDaemon T=main | system.c system_RemoveUnusedApps() 990 | App with MD5 sum c81b7f14a400425b79887db78c879474 is still needed.
Oct 25 02:48:12 swi-mdm9x28 user.info Legato:  INFO | updateDaemon[619]/updateDaemon T=main | system.c system_RemoveUnusedApps() 990 | App with MD5 sum c2cd4551c6040d1f722db9c19336a929 is still needed.
Oct 25 02:48:12 swi-mdm9x28 user.info Legato:  INFO | updateDaemon[619]/updateDaemon T=main | system.c system_RemoveUnusedApps() 990 | App with MD5 sum 8fdf48818fed214fcb3a2dbbe8e7a4d2 is still needed.
Oct 25 02:48:12 swi-mdm9x28 user.info Legato:  INFO | updateDaemon[619]/updateDaemon T=main | system.c system_RemoveUnusedApps() 990 | App with MD5 sum 5ff06be134c47eef9f5b8fc27a673112 is still needed.
Oct 25 02:48:12 swi-mdm9x28 user.info Legato:  INFO | updateDaemon[619]/updateDaemon T=main | system.c system_RemoveUnusedApps() 990 | App with MD5 sum b8b9892bdc40a3e8596c52b1d3b9042d is still needed.
Oct 25 02:48:12 swi-mdm9x28 user.info Legato:  INFO | updateDaemon[619]/updateDaemon T=main | system.c system_RemoveUnusedApps() 990 | App with MD5 sum c067d6b2574f82a2acf9c30aa2852730 is still needed.
Oct 25 02:48:12 swi-mdm9x28 user.info Legato:  INFO | updateDaemon[619]/updateDaemon T=main | system.c system_RemoveUnusedApps() 990 | App with MD5 sum 07319f02b5072aa140347ae5395cf4a7 is still needed.
Oct 25 02:48:12 swi-mdm9x28 user.info Legato:  INFO | updateDaemon[619]/updateDaemon T=main | system.c system_RemoveUnusedApps() 990 | App with MD5 sum 5bff6c540fcfe2b5c9f91618ef5687c1 is still needed.
Oct 25 02:48:12 swi-mdm9x28 user.info Legato:  INFO | updateDaemon[619]/updateDaemon T=main | system.c system_RemoveUnusedApps() 990 | App with MD5 sum f7c926eea512cb4778b6c6cc001021ec is still needed.
Oct 25 02:48:12 swi-mdm9x28 user.info Legato:  INFO | updateDaemon[619]/updateDaemon T=main | system.c system_RemoveUnusedApps() 990 | App with MD5 sum ac14c81254b68e6e7fb92dac9d6e7f99 is still needed.
Oct 25 02:48:12 swi-mdm9x28 user.info Legato:  INFO | updateDaemon[619]/updateDaemon T=main | system.c system_RemoveUnusedApps() 990 | App with MD5 sum 672e64922e3cb258b2dbc36e8fbcac60 is still needed.
Oct 25 02:48:12 swi-mdm9x28 user.info Legato:  INFO | updateDaemon[619]/updateDaemon T=main | system.c system_RemoveUnusedApps() 990 | App with MD5 sum 5a8ce545afe8a8ed4865880de2d1c117 is still needed.
Oct 25 02:48:12 swi-mdm9x28 user.info Legato:  INFO | updateDaemon[619]/updateDaemon T=main | system.c system_RemoveUnusedApps() 990 | App with MD5 sum 2a700ade0b43a83ccfcbfa023fd091a4 is still needed.
Oct 25 02:48:12 swi-mdm9x28 user.debug Legato:  DBUG | updateDaemon[619]/framework T=main | le_updateCtrl_server.c Handle_le_updateCtrl_MarkGood() 497 | Sending response to client session 0x28a7c : 4 bytes sent
^C
root@swi-mdm9x28:~# legato status
Systems installed:
  12 [good] <-- current
Legato framework is running.
root@swi-mdm9x28:~#

Would you please share your log and code snippet to check?

And how the USB stick run the update?

Thx

How do you use a USB stick to perform updates? Sound interesting.

hi @annaertd,
did you succeed in changing the probation period?
Best Regards

Hi,

I was not able to change the probation period by changing the environment variable LE_PROBATION_MS.
At startup of the legato system, the value of this environment variable is read by the updateDaemon service.
So, if I try to change the value of this environment variable when my application gets started, this is far too late.
The default probation time of 30 minutes is already loaded, when my application starts running.

But, I managed to force my legato system as a ‘good’ system, using the API call le_updateCtrl_MarkGood(true) in the COMPONENT_INIT part of my application.
This API call ends the probation period.
The legato system is marked as ‘good’, at every startup of my application, but, this shouldn’t be a problem according the legato documentation.

greetings,
annaertd

Hi @fjanicki,

my USB update stick is mounted on /etc/usbflash1/, and
my legato system update file is called /etc/usbflash1/mySystemUpdate.wp76xx.update

I have created a separate updater application which opens the update file, adds a progress handler and starts the update:

1/ fdUpdateFile = open(“/etc/usbflash1/mySystemUpdate.wp76xx.update”, O_RDONLY)
2/ le_update_AddProgressHandler(myProgressHandler, NULL)
3/ le_update_Start(fdUpdateFile)

The progress handler contains a switch case which handles the different values of the le_update_State_t enumeration.
When the handler tackles a different state, I put the according info on my LCD character display.

greetings,
annaertd

1 Like

super interesting, thanks!