With that clarified let me discuss what options there are here.
First of all the images provision
command of TorizonCore Builder does not currently support setting the device name or ID. Though this sounds like a reasonable feature request that I can make to the team, though of course it will take time for this to be picked up and done.
As for what you can do now there are still some possibilities. First let me clear up some of your questions from your initial post.
Can this be done programmatically through an /etc/sota/conf.d/ file instead just like how the hardware ID can be customized?
The answer for this is no. The configuration files here are for the update client on the device. The update client does not use the device name or ID. These descriptors are only used on the server-side of things.
Can it be changed after the device has been provisioned without needing to re-provision the device?
Device name yes, device ID I don’t think you can, but I may need to check this.
Now moving on to what your options are. When you run the images provision
command with TorizonCore Builder this will place the provisioning information into the image at flashing time. When the device boots up for the first time if the provisioning information is present then a systemd service called auto-provisioning.service
is ran. The service can be seen here: https://github.com/toradex/meta-toradex-torizon/blob/kirkstone-6.x.y/recipes-sota/auto-provisioning/auto-provisioning/auto-provisioning.sh
As you can see this service then runs a script that does the actual provisioning. The script source is found here: https://github.com/toradex/meta-toradex-torizon/blob/kirkstone-6.x.y/recipes-sota/auto-provisioning/auto-provisioning/auto-provisioning.service
The important bit you’re concerned about is in the register_device
function. Here we set the device ID and device name that gets registered to the server. In the script you see we don’t set the device name which results in the randomized name on the server. For device ID we just use the hostname of the device which is the default behavior.
Knowing this what can you do right now. You can modify the service to point to another script of your design that sets the device name and or ID. Or you can just modify the script itself. Alternatively you can just change the hostname of the device. This way the original script will used your custom hostname for the device ID anyways. Either way such changes should be possible with TorizonCore Builder.
These would probably be your most straightforward options until we actually have a feature for this.
Let me know if I can help further clear any of this up.
Best Regards,
Jeremias