Torizon offline updates can be configured as described here, specifying an offline_updates_source entry in /etc/sota/conf.d/99-offline-updates.toml file.
I see that on Torizon OS the USB stick are automatically mounted under /media/ with a mountpoint that is the name (or the ID) of the USB stick.
So, two different USB sticks are mounted under different mountpoints, so that I can access both of them.
Can I use wildcards (*, ?, …) in the offline_updates_source entry?
Otherwise, as suggested here I can think to a script that creates a symbolic link to the USB stick mountpoint.
But the problem is that this link is persistent after the reboot of the device.
But I would like having it “volatile” (i.e., it’s not preserved after a reboot).
Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!
Did you like my answer?
Hello!
Thank you for your question. Currently, the offline_updates_source entry in the Torizon offline updates configuration does not support the use of wildcards. This means you cannot directly use patterns like /media/* to automatically detect any USB stick mount point.
As an alternative, you can create a script to dynamically manage symbolic links to USB stick mount points. To ensure these links are non-persistent across reboots, you can set up the script to run at startup using a systemd service or a startup script in /etc/init.d/. Here’s a general approach you can follow:
Detect USB Mounts: The script should check /media/ for new directories that represent mounted USB sticks.
Create Symbolic Links: Once a USB stick is detected, the script can create a symbolic link to its mount point.
Cleanup on Shutdown: Optionally, you can configure the script to remove these symbolic links during shutdown, ensuring they do not persist after a reboot.
This method allows you to handle different USB sticks without needing to manually update the configuration each time. Just be sure to handle scenarios where multiple USB sticks might be inserted simultaneously to avoid any conflicts.
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:
The path name needs to be absolute, so no wildcards or other regex type expressions will work.
With regards to the volatility. What kind of behavior do you want exactly? Do you want the symlink to only exist during the update and it should be removed afterwards? Or only a reboot/power cycle should remove it?
Do you want it to be remade on boot or only on specific trigger?
Everything comes from the fact that every USB key is auto-mounted to a different mount point.
But offline_updates_source must be a fixed, absolute path.
For this reason I must add a button in the UI of my application to trigger a script that does something.
As an idea:
list all the mounted USB sticks
select the first one (as an example)
create a symlink to the path offline_updates_source
so that aktualizr starts offline updates.
After the update is complete (or at the first reboot, or when the USB stick is unplugged) I don’t need the symlink anymore.
I’m quite open to ideas, but some kind of script is necessary to handle the different USB stick mount points.
Or, maybe, I missed something.
I see. As you said you will definitely need a script or something of the sorts to control this behavior.
Off the top of my head you could do the process you already described and then remove the symlink when the update is completed. Or maybe instead of a symlink you just mount the USB key to the location that offline_updates_source is pointed at if that USB key gets selected by your UI. Then remove the mountpoint on update completion, or just by removing the USB key itself. I guess there’s not much difference here in terms of symlink vs mounting.
Seems relatively straightforward though what you want to do.