Update TwinCAT/BSD

This step shows how to update TwinCAT/BSD with the tool tcbsd-upgrade. The goal is to bring the system up to date. The tool automatically creates a restore point with the current timestamp. You can list restore points with restorepoint status.

In addition, the upgrade is carried out in a new boot environment so that the current system remains largely untouched during the upgrade process. If an error occurs during the upgrade, the boot environment is simply removed and the system is left in its original state. The old EFI Loader is also restored.

If something goes wrong after the upgrade and restart, you can use the restore point to undo the upgrade. This can be done via SSH or the system terminal if the system is accessible:

bectl list
doas bectl activate upgrade-<timestamp>
reboot

Update the system as follows:

1. Enter the command doas tcbsd-upgrade minor in the console.
The update is started.
2. If everything went well and you are sure that you do not want to undo anything, you can clean the restore point:
restorepoint status
doas restorepoint destroy upgrade-backup-<timestamp>
3. Replace the old boot environment (default) with the new boot environment (upgrade-<timestamp>) and rename the new boot environment back to default:
bectl list
doas bectl destroy default
doas bectl rename upgrade-<timestamp> default
4. Restart TwinCAT/BSD with shutdown -r now.
It is important to keep the old name (default) for the boot environment to prevent old restore points (e.g. factoryreset) from being damaged. The tool restorepoint will try to activate the old boot environment (e.g. "zroot/ROOT/default") during the recovery and will fail if the old boot environment no longer exists. The tool tcbsd-upgrade creates clones of the current boot environment during the upgrade to preserve the history or snapshots so that the old boot environment can be replaced by the new one to avoid corruption of the restore points.