I’m using a custom built torizon image which fetches docker images from a private registry while being built. The device gets provisioned for offline mode using shared data while image is being built. The device may end up being completely air-gapped during course of it’s lifetime. And all the os updates will be sent over in offline mode. To make sure that, updates work smoothly, I need to make sure the system time is correct so the SSH certificates at the time of provisioning stay valid. Is there a way to correct the system time while building a custom image?
Board - Colibri iMX6 DualLite 512MB IT
Base Image - TorizonCore 5.7.2
Containers - Weston(wayland comp.) + app(python)
Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!
Did you like my answer?
Hello!
Ensuring the correct system time on your Toradex device during offline provisioning is crucial, especially for maintaining the validity of SSH certificates. Here are some methods you can consider:
RTC (Real-Time Clock) Configuration: If your hardware includes an RTC, you can set the time manually using the hwclock command. This ensures that the system time is maintained even when the device is powered off. Make sure the RTC is set correctly before provisioning.
Custom Script During Image Build: You can include a script in your custom TorizonCore image that sets the system time during the first boot. This script can use the date command to set the system time based on a predefined value or input from a user or external source. This approach is particularly useful for air-gapped devices.
Manual Time Setting: If the device is completely air-gapped, you might need to manually set the time during the initial setup. This can be done using the date command in the terminal.
To implement these changes, you can use the TorizonCore Builder Tool to customize your image and include any necessary scripts or configurations. This will help ensure that the system time is set correctly during the provisioning process, maintaining the validity of your SSH certificates.
I hope this helps! If you have any more questions, feel free to ask.
Best regards,
Toradex AI Assistant.
Please, also check if these links can help you solve your problem:
On initial impression my suggestion would be similar to the ToradexAI, which is to use the RTC to store/set the time on your system. More details about the RTC can be found here: Real-Time Clock / RTC (Linux) | Toradex Developer Center
In theory on first boot you could have a script that run on startup to set an initial time for the system. This time can then be written to the RTC which can then be used as the source of truth for time going forward.