Skip to content

Conversation

@mulkieran
Copy link
Member

@mulkieran mulkieran commented Sep 8, 2025

Summary by CodeRabbit

  • Chores
    • Standardized installation of generated configuration and service files with explicit permissions, ensuring consistent modes across environments (readable configs, executable scripts).
    • Improved reliability of the build/installation process by using a unified install method for generated files.
    • No changes to file contents or runtime behavior; this is a consistency and maintainability update.

Install sets the file permissions; sed might default to setting file
permissions incorrectly.

0755 for files that might need to be executed; 0644 for those that will
not.

Signed-off-by: mulhern <[email protected]>
@mulkieran mulkieran self-assigned this Sep 8, 2025
@coderabbitai
Copy link

coderabbitai bot commented Sep 8, 2025

Walkthrough

The Makefile now generates config and service files by piping sed output into install, setting explicit permissions (0644 for services, 0755 for a module script). Targets for dracut and systemd switch from redirection to install -Dpm… while preserving file contents.

Changes

Cohort / File(s) Summary of Changes
Makefile install refactor
Makefile
Replace redirection of sed output with `sed ...
Dracut targets
dracut/stratisd-min.service, dracut/module-setup.sh.in
Generate via `sed ...
Systemd service targets
systemd/stratisd.service, systemd/stratisd-min-postinitrd.service, systemd/[email protected], systemd/[email protected]
Generate via `sed ...

Sequence Diagram(s)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I tapped my paw on Makefile ground,
Pipe to install—permissions found.
0644, services neat,
0755, scripts complete.
With sed we hop, with modes we cheer,
A tidy warren builds this year. 🐇✨

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  - Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.
  - Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mulkieran mulkieran moved this to Pending in 2025September Sep 8, 2025
@mulkieran mulkieran marked this pull request as ready for review September 8, 2025 18:25
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
Makefile (2)

248-249: Safer sed→install: avoid -p and guard against sed failure

Piping into install can create zero-byte files if sed errors; -p also tries to preserve timestamps from /dev/stdin. Prefer a tmp-file handoff and drop -p. Also add “--” before DEST to guard against dash-prefixed paths.

Option A (robust):

-	sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' dracut/90stratis/stratisd-min.service.in | $(INSTALL) -Dpm0644 /dev/stdin $(DESTDIR)$(DRACUTDIR)/modules.d/90stratis/stratisd-min.service
-	sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' dracut/90stratis/module-setup.sh.in | $(INSTALL) -Dpm0755 /dev/stdin $(DESTDIR)$(DRACUTDIR)/modules.d/90stratis/module-setup.sh
+	tmp="$$(mktemp)"; sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' dracut/90stratis/stratisd-min.service.in > "$$tmp" && $(INSTALL) -Dm0644 "$$tmp" -- $(DESTDIR)$(DRACUTDIR)/modules.d/90stratis/stratisd-min.service && rm -f "$$tmp"
+	tmp="$$(mktemp)"; sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' dracut/90stratis/module-setup.sh.in > "$$tmp" && $(INSTALL) -Dm0755 "$$tmp" -- $(DESTDIR)$(DRACUTDIR)/modules.d/90stratis/module-setup.sh && rm -f "$$tmp"

Option B (minimal change):

-	sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' dracut/90stratis/stratisd-min.service.in | $(INSTALL) -Dpm0644 /dev/stdin $(DESTDIR)$(DRACUTDIR)/modules.d/90stratis/stratisd-min.service
-	sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' dracut/90stratis/module-setup.sh.in | $(INSTALL) -Dpm0755 /dev/stdin $(DESTDIR)$(DRACUTDIR)/modules.d/90stratis/module-setup.sh
+	sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' dracut/90stratis/stratisd-min.service.in | $(INSTALL) -Dm0644 /dev/stdin -- $(DESTDIR)$(DRACUTDIR)/modules.d/90stratis/stratisd-min.service
+	sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' dracut/90stratis/module-setup.sh.in | $(INSTALL) -Dm0755 /dev/stdin -- $(DESTDIR)$(DRACUTDIR)/modules.d/90stratis/module-setup.sh

259-262: Same here: make pipeline resilient and drop -p

Mirror the dracut fix: prevent empty installs on sed error and skip timestamp preservation from stdin.

Option A (robust):

-	sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' systemd/stratisd.service.in | $(INSTALL) -Dpm0644 /dev/stdin $(DESTDIR)$(UNITDIR)/stratisd.service
-	sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' systemd/stratisd-min-postinitrd.service.in | $(INSTALL) -Dpm0644 /dev/stdin $(DESTDIR)$(UNITDIR)/stratisd-min-postinitrd.service
-	sed 's|@UNITEXECDIR@|$(UNITEXECDIR)|' systemd/[email protected] | $(INSTALL) -Dpm0644 /dev/stdin $(DESTDIR)$(UNITDIR)/[email protected]
-	sed 's|@UNITEXECDIR@|$(UNITEXECDIR)|' systemd/[email protected] | $(INSTALL) -Dpm0644 /dev/stdin $(DESTDIR)$(UNITDIR)/[email protected]
+	tmp="$$(mktemp)"; sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' systemd/stratisd.service.in > "$$tmp" && $(INSTALL) -Dm0644 "$$tmp" -- $(DESTDIR)$(UNITDIR)/stratisd.service && rm -f "$$tmp"
+	tmp="$$(mktemp)"; sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' systemd/stratisd-min-postinitrd.service.in > "$$tmp" && $(INSTALL) -Dm0644 "$$tmp" -- $(DESTDIR)$(UNITDIR)/stratisd-min-postinitrd.service && rm -f "$$tmp"
+	tmp="$$(mktemp)"; sed 's|@UNITEXECDIR@|$(UNITEXECDIR)|' systemd/[email protected] > "$$tmp" && $(INSTALL) -Dm0644 "$$tmp" -- $(DESTDIR)$(UNITDIR)/[email protected] && rm -f "$$tmp"
+	tmp="$$(mktemp)"; sed 's|@UNITEXECDIR@|$(UNITEXECDIR)|' systemd/[email protected] > "$$tmp" && $(INSTALL) -Dm0644 "$$tmp" -- $(DESTDIR)$(UNITDIR)/[email protected] && rm -f "$$tmp"

Option B (minimal change):

-	sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' systemd/stratisd.service.in | $(INSTALL) -Dpm0644 /dev/stdin $(DESTDIR)$(UNITDIR)/stratisd.service
-	sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' systemd/stratisd-min-postinitrd.service.in | $(INSTALL) -Dpm0644 /dev/stdin $(DESTDIR)$(UNITDIR)/stratisd-min-postinitrd.service
-	sed 's|@UNITEXECDIR@|$(UNITEXECDIR)|' systemd/[email protected] | $(INSTALL) -Dpm0644 /dev/stdin $(DESTDIR)$(UNITDIR)/[email protected]
-	sed 's|@UNITEXECDIR@|$(UNITEXECDIR)|' systemd/[email protected] | $(INSTALL) -Dpm0644 /dev/stdin $(DESTDIR)$(UNITDIR)/[email protected]
+	sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' systemd/stratisd.service.in | $(INSTALL) -Dm0644 /dev/stdin -- $(DESTDIR)$(UNITDIR)/stratisd.service
+	sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' systemd/stratisd-min-postinitrd.service.in | $(INSTALL) -Dm0644 /dev/stdin -- $(DESTDIR)$(UNITDIR)/stratisd-min-postinitrd.service
+	sed 's|@UNITEXECDIR@|$(UNITEXECDIR)|' systemd/[email protected] | $(INSTALL) -Dm0644 /dev/stdin -- $(DESTDIR)$(UNITDIR)/[email protected]
+	sed 's|@UNITEXECDIR@|$(UNITEXECDIR)|' systemd/[email protected] | $(INSTALL) -Dm0644 /dev/stdin -- $(DESTDIR)$(UNITDIR)/[email protected]
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1b360b6 and ed1334d.

📒 Files selected for processing (1)
  • Makefile (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (33)
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:cockpit
  • GitHub Check: testing-farm:fedora-43-x86_64:cockpit
  • GitHub Check: testing-farm:fedora-42-x86_64:local
  • GitHub Check: testing-farm:fedora-41-x86_64:local
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:local
  • GitHub Check: testing-farm:fedora-43-x86_64:local
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: checks (make -f Makefile build-no-ipc, 1.89.0, cargo)
  • GitHub Check: checks (make -f Makefile test, 1.89.0, cargo)
  • GitHub Check: checks (make -f Makefile docs-ci, 1.89.0, cargo)
  • GitHub Check: checks (make -f Makefile build-min, 1.89.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-no-ipc, 1.89.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.89.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min-no-systemd, 1.89.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-utils, 1.89.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.89.0, clippy)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min, 1.89.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile stratisd-tools, 1.89.0, cargo)
  • GitHub Check: checks (make -f Makefile check-typos, 1.89.0, cargo)
  • GitHub Check: tests-with-testing-repo (master)
  • GitHub Check: stratis-min-cli-checks
  • GitHub Check: checks (make -f Makefile fmt-ci, 1.89.0, rustfmt)
  • GitHub Check: stratis-cli-checks
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.89.0, cargo)
  • GitHub Check: checks_with_tang_should_fail (TANG_URL=localhost make -f Makefile test-clevis-loop-should-fail-ro...
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.89.0, cargo)

@mulkieran
Copy link
Member Author

I bet dracut doesn't even care about exec permission...but the install is less repeatable because the timestamp does change...

@packit-as-a-service
Copy link

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/stratis-storage-stratisd-3912-copr_pull
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

@mulkieran mulkieran moved this to Pending in 2025October Oct 11, 2025
@mulkieran mulkieran removed this from 2025October Nov 17, 2025
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.

1 participant