Skip to content

Preview udev rules before installing them and install with mode 644 - #302

Merged
ap-- merged 3 commits into
mainfrom
copilot/ap-python-seabreeze-300-preview-udev-rules
Aug 9, 2026
Merged

Preview udev rules before installing them and install with mode 644#302
ap-- merged 3 commits into
mainfrom
copilot/ap-python-seabreeze-300-preview-udev-rules

Conversation

Copilot AI commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

seabreeze_os_setup installed the udev rules without ever showing what it was about to write to /etc/udev/rules.d/, and offered no path for installing them by hand. It also copied the rules straight from the 0600 temporary download file, so the installed rules ended up root-only readable.

Changes

  • Preview: the contents of the rules file (downloaded from GitHub or passed on the command line) are printed along with the target path, right before the confirmation prompt.
  • Manual install: declining the prompt now prints the commands needed to install the previewed rules by hand instead of silently exiting.
  • Permissions: sudo cp replaced with sudo install -m 644, so the rules are world readable regardless of the source file mode. A non-zero return code now exits with 1 instead of printing Success.
  • Docs: os_support/readme.md and CHANGELOG updated to describe the preview/confirm/644 behavior.
  • Tests: new tests/test_os_setup.py covering the preview output, the install -m 644 invocation, the declined path, and a failing install.

Example

$ seabreeze_os_setup
The following udev rules will be installed as /etc/udev/rules.d/10-oceanoptics.rules:
  # udev rules file for Ocean Optics, Inc. spectrometers
  # ====================================================
  ...
  LABEL="oceanoptics_rules_end"
Install udev rules? [y/n] n
To install the rules manually, copy the rules shown above to
/etc/udev/rules.d/10-oceanoptics.rules and run:

  sudo chmod 644 /etc/udev/rules.d/10-oceanoptics.rules
  sudo udevadm control --reload-rules

Copilot AI and others added 2 commits August 9, 2026 10:58
Co-authored-by: ap-- <1463443+ap--@users.noreply.github.com>
Co-authored-by: ap-- <1463443+ap--@users.noreply.github.com>
Copilot AI changed the title [WIP] Print udev rules before installing them and allow manual installation Preview udev rules before installing them and install with mode 644 Aug 9, 2026
Copilot AI requested a review from ap-- August 9, 2026 11:00
Copilot finished work on behalf of ap-- August 9, 2026 11:00
@ap--
ap-- marked this pull request as ready for review August 9, 2026 11:17
@ap--
ap-- merged commit 3de4fdd into main Aug 9, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

print udev rules before installing them/allow manual installation of rules

2 participants