REB_Update.sh - Update Rose Engine Butler
Rose Engine Butler’s Key Programs: Overview · REB_Launch.sh · REB_Settings.sh · REB_Backup.sh · REB_Update.sh · REB_Change_Network.sh · REB_Install_Debian_13_Trixie.sh
Purpose
REB_Update.sh brings a machine up to date: the latest Rose Engine Butler files from GitHub, any new settings those files need, and the latest Debian, LinuxCNC and ClamAV packages. This machine's own settings and tuning are kept.
Updating Rose Engine Butler covers local changes, branches and going back to an earlier version; this page covers the program itself.
How it is run
- The Update Rose Engine Butler desktop icon, and Applications > Rose Engine Butler > Update Rose Engine Butler. It runs in a terminal window.
- From a terminal:
|
bash /home/reuben/linuxcnc/configs/RoseEngineButler/REB_Update.sh |
Close LinuxCNC and REB Settings first. It asks for the reuben password (for sudo). It needs the internet (Wi-Fi). Machines installed from the instructions get the files over HTTPS and need no GitHub login; a machine whose repository was switched to SSH (git remote -v shows git@github.com) also needs the reuben user's SSH key registered with GitHub.
Parameters
None.
What it does
- git stash - sets aside local changes to files in the repository (e.g. the tool table).
- git pull - gets the latest version of the branch the machine is on (normally main). If this fails, it puts the local changes back and stops.
- git stash pop - puts the local changes back. If the update changed the same lines, it leaves the files exactly as pulled, keeps the local changes in the stash, and prints a warning.
- REB_Setup/REB_Update_Settings.py - adds any new settings to this machine's settings file. A problem here is reported but the update carries on. It then:
- runs the one-time steps for machines built before they were added to the installer - REB_Add_Shortcuts.sh (folder shortcuts) and REB_Set_Serial_Number.sh (asks for the serial number if none is recorded). Each does nothing once it has been done.
- sends a version report (see below).
- Refreshes the EtherLab package signing key - only if that package source is set up; a failure only warns.
- sudo apt update and sudo apt upgrade -y - stops with an error if either fails.
Programs it calls
| Program | What for |
| git (stash, pull, stash pop, reset) | Getting the latest files from GitHub, keeping local edits. |
| REB_Setup/REB_Update_Settings.py | Adds new settings to REBset_v1.ini; uses REB_Display/reb_settings_io.py. |
| REB_Setup/REB_Add_Shortcuts.sh, REB_Set_Serial_Number.sh, REB_Report_Version.py | The one-time steps and the version report, run by REB_Update_Settings.py. |
| curl, gpg, cmp, sudo install | Fetching, checking and installing the EtherLab signing key. |
| sudo apt update, sudo apt upgrade -y | Updating Debian, LinuxCNC, ClamAV and the other packages. |
Files it reads
- The whole repository at /home/reuben/linuxcnc/configs/RoseEngineButler (through git)
- REB_Setup/REBset_v1.ini - the shipped starting settings, with every setting
- /home/reuben/Documents/REBset_v1.ini - this machine's settings
- /etc/apt/sources.list.d/ethercat.sources - the EtherLab package source, if present
Files it creates or changes
| File | Change |
| The repository files | Replaced with the latest versions. Local edits are kept in a stash named REB_Update date time when they can't be put back. |
| /home/reuben/Documents/REBset_v1.ini | New settings added with their starting values; Max Speed / Max Acceleration / PID Max Output filled in from this machine's own values if missing. Existing values are never changed, except that a stepgen speed or acceleration limit is raised if it is now below the axis's Max Speed / Max Acceleration. Missing file: created from the shipped copy. |
| /home/reuben/Documents/REBset_v1.ini.bak-YYYYMMDD-HHMMSS | A copy of the settings file from before the change - only when something was added. |
| Other /home/reuben/Documents/*.ini settings files | The explanatory comment lines are added to saved and exported settings files that lack them. Their settings aren't changed. |
| The EtherLab keyring named in ethercat.sources | Replaced, only if a newer copy of the same key is available. |
| /home/reuben/.config/REB/report_log.jsonl | One line added for every version report, whether or not it could be sent. |
| /home/reuben/.config/REB/serial, the folder shortcuts | Only the first time, on a machine that doesn't have them yet. |
| System packages | Updated by apt. |
Notes for support
- It updates whichever branch the machine is on. Check with git branch --show-current - customer machines should be on main.
- "git pull failed" - usually no internet. On a machine using SSH (git remote -v), GitHub may be asking for a passphrase or rejecting the key - test it with ssh -T git@github.com as reuben.
- "local changes could not be re-applied" - see Updating Rose Engine Butler for finding them in the stash.
- "settings file could not be checked" - REBset_v1.ini couldn't be read. It is left as it was; check it isn't empty or hand-edited, and that reuben owns it (ls -l ~/Documents/REBset_v1.ini).
- EtherLab key warnings are harmless - nothing Rose Engine Butler uses comes from that source.
- Version report. Every update sends this machine's Raspberry Pi hardware serial number, its serial number (if one was recorded), the Rose Engine Butler version and date shown on the panel, and the time, to https://support.roseenginebutler.com/reb_report.php. Nothing else is sent. It is logged first in ~/.config/REB/report_log.jsonl; if there's no internet it prints a warning and the update carries on (that report isn't sent later).
- It asks for a serial number at every update until one is given (press Enter to skip). To set it later, run bash /home/reuben/linuxcnc/configs/RoseEngineButler/REB_Setup/REB_Set_Serial_Number.sh.
- Run it twice after a big change: the first run may update REB_Update.sh or REB_Update_Settings.py themselves, and the second run uses the new versions.
- Once the update has run, start Rose Engine Butler normally - the new files take effect at the next launch.
- The installer also puts a copy of this script at /home/reuben/REB_Update.sh. Nothing uses it - the desktop icon and menu entry run the one in the RoseEngineButler folder - and updates never refresh it, so don't run it.
|
eMail comments to |
