Help appreciated: adding set -e to reform-hw-setup

The script reform-hw-setup is one of the last script which does not use set -e. The consequence is, that if any but the last command fails, the reform-hw-setup systemd service will still succeed. This means that your OS may behave wrongly but there is nothing wrong according to your systemd unit. This should not happen and as we saw with Systemctl: error starting reform-hw-setup.service (which was only spotted because the failing command was the last in the script and thus the exit code of the whole script indeed was non-zero) it is very useful to have this service fail if one of the commands it spawns fails.

Unfortunately, the reform-hw-setup script does very different things depending on the platform and I can only test the Reform 2 with A311D and with the LS1028A. This is where you come in, if you like. Add set -e to the top of /usr/sbin/reform-hw-setup and run systemctl restart reform-hw-setup and observe if anything fails. If yes, either report it here or already prepare a patch like this one for A311D: Draft: reform-hw-setup: run with set -e (!70) · Merge requests · Reform / MNT Reform Tools · GitLab

In the end, I’ll collect all the results in this merge request which is marked as a draft until all platforms got tested:

Thanks!

2 Likes