Files
LEDMatrix/scripts/install
ChuckBuildsandClaude Opus 5 cbfb0e035d fix(web): stop the installer chmod stripping exec bits on every update
git tracks five scripts as mode 644 that first_time_install.sh then chmods to
755 (start_display.sh, stop_display.sh, the two install_*_service.sh, and
one-shot-install.sh does the same to first_time_install.sh). With
core.fileMode true, the default on Linux, git reports all five as modified
from then on, in files the user never touched.

The update button stashes local changes before pulling, so it is not blocked
by this. But it never pops that stash -- stash pop and stash apply appear
nowhere in the update flow -- so the mode change is stashed away and left
there, and the files revert:

    === file modes after the update button's stash ===
      664  first_time_install.sh      <- installer had made these 755
      664  start_display.sh
      664  stop_display.sh
      664  scripts/install/install_service.sh

So every web-UI update silently strips the executable bit from the installer's
own scripts, and leaves a stash entry holding the difference. start_display.sh
and stop_display.sh stop working from the shell afterwards.

A manual `git pull --rebase` over SSH fails outright, since nothing stashes for
it: "cannot pull with rebase: You have unstaged changes". That is the likely
source of the reports, since plenty of people update that way.

Tracking the five as 755 -- what they should always have been, as the
installer chmodding them attests -- removes the spurious mode change
entirely: nothing to stash, nothing stripped, no stash entry, and manual
pulls work.

The pull also passes --autostash, for the case the code explicitly tolerates:
when the stash fails it logs a warning and pulls anyway, and that pull is what
then fails. Autostash also pops what it stashes, which the manual stash does
not.

Note that `git add -A` after `git update-index --chmod=+x` silently reverts
the index to the on-disk mode, so the modes here were set by chmodding the
files themselves.

Regression test asserts the five stay tracked executable; reverting any one
of them fails it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01STMbQE4YctTacQXfbYqKuW
2026-08-20 13:53:50 -04:00
..
2025-12-27 14:15:49 -05:00
2025-12-27 14:15:49 -05:00

Installation Scripts

This directory contains scripts for installing and configuring the LEDMatrix system.

Scripts

  • one-shot-install.sh - Single-command installer; clones the repo, checks prerequisites, then runs first_time_install.sh. Invoked via curl ... | bash from the project root README.
  • install_service.sh - Installs the main LED Matrix display service (systemd)
  • install_web_service.sh - Installs the web interface service (systemd)
  • install_wifi_monitor.sh - Installs the WiFi monitor daemon service
  • setup_cache.sh - Sets up persistent cache directory with proper permissions
  • configure_web_sudo.sh - Configures passwordless sudo access for web interface actions
  • configure_wifi_permissions.sh - Grants the ledmatrix user the WiFi management permissions needed by the web interface and the WiFi monitor service
  • migrate_config.sh - Migrates configuration files to new formats (if needed)
  • debug_install.sh - Diagnostic helper used when an install fails; collects environment info and recent logs

Usage

These scripts are typically called by first_time_install.sh in the project root (which itself is invoked by one-shot-install.sh), but can also be run individually if needed.

Note: Most installation scripts require sudo privileges to install systemd services and configure system settings.