Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC]: patch-u-boot-env: optimize patch-u-boot-env service execution #585

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rakeshk7097
Copy link

Update patch-u-boot-env.service to set the U-Boot environment (e.g., watchdog_timeout_ms=60000) earlier and more reliably during boot.With the special case when watchdog_timeout_ms value set as '0' patch-u-boot-env.service ExecStart is not executing the 'fw_setenv watchdog_timeout_ms 60000' in this case patch-u-boot-env.service is getting failed in setting the watchdog_timeout_ms as 60000. Running the service after 'local-fs.target' and 'systemd-udev-settle.service' is letting the block device intialize ready to run the fw_setenv command.

Update patch-u-boot-env.service to set the U-Boot environment (e.g., watchdog_timeout_ms=60000)
earlier and more reliably during boot.With the special case when watchdog_timeout_ms
value set as '0' patch-u-boot-env.service ExecStart is not executing the
'fw_setenv watchdog_timeout_ms 60000' in this case patch-u-boot-env.service is
getting failed in setting the watchdog_timeout_ms as 60000.
Running the service after 'local-fs.target' and 'systemd-udev-settle.service'
is letting the block device intialize ready to run the fw_setenv command.

Signed-off-by: Rakesh Kumar <kumar.rakesh@siemens.com>
@rakeshk7097
Copy link
Author

Issue reproduction steps:

  • Set the watchdog_timeout_ms as 0 from terminal.
  • In the next boot if patch-u-boot-env.service is enabled then it should ideally set the watchdog_timeout_ms value as 60000 but its not able to do so.

@jan-kiszka @BaochengSu , Could you please give any suggestion on this.

Regards,
Rakesh

@jan-kiszka
Copy link
Collaborator

We are hunting some sporadic setup issue around this as well, and your patch looks promising. However, we didn't get any error messages in case fw_setenv failed to set the watchdog. Did you see any errors? Or was the watchdog_timeout_ms just not updated, silently?

@colpane
Copy link
Contributor

colpane commented Feb 25, 2025

This is the same (sporadic) issue I have reported to both of you. We are still trying to get what fw_setenv returns at least (in our case it is silent). Maybe Rakesh did observe something.

@rakeshk7097
Copy link
Author

rakeshk7097 commented Feb 25, 2025

Yes @jan-kiszka , its sporadic, but we also didn't observer any error while running the service, sometimes we are seeing that service got started and finished also but this fw_setenv watchdog_timeout_ms 60000 in service file seems executed silently.
I tried with putting as sleep of 3 sec after ExecStart as ExecStartPost and this is also working fine, there I suspected fw_setenv might needs device node to populate and ready which systemd-udev-settle.service fulfill.

Do we need to set the timer watchdog_timeout_ms value hardcoded as 60sec even if its 0.How about if we skip setting this explicit timer value from service file.
Cases:-

  1. if timer is greater than 0 then handle from config
  2. Equal to 0 , this service won't update any value to the timer.

How about the above configuration ?

Below is the log
~# journalctl -u patch-u-boot-env.service -b Feb 25 14:18:12 industrial-edge-iot2050 systemd[1]: Starting patch-u-boot-env.service - update u-boot environment for swupdate... Feb 25 14:18:14 industrial-edge-iot2050 systemctl[1431]: Removed "/etc/systemd/system/multi-user.target.wants/patch-u-boot-env.service". Feb 25 14:18:20 industrial-edge-iot2050 systemd[1]: Finished patch-u-boot-env.service - update u-boot environment for swupdate. root@industrial-edge-iot2050:~#

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants