Skip to content

Follow the recommended dracut module ordering for out-of-tree modules.#3908

Merged
mulkieran merged 1 commit intostratis-storage:masterfrom
jozzsi:1
Sep 12, 2025
Merged

Follow the recommended dracut module ordering for out-of-tree modules.#3908
mulkieran merged 1 commit intostratis-storage:masterfrom
jozzsi:1

Conversation

@jozzsi
Copy link
Copy Markdown
Contributor

@jozzsi jozzsi commented Aug 31, 2025

Move module ordering from 90 to 50

For dracut release v108 or later the recommended ordering for out out of tree modules is 50-59 range. The following is a section from dracut documentation:

Not using the 50-59 range for out of tree dracut modules will likely
lead to unintended errors in the initramfs generation process as your
dracut module will either run too early or too late in the generation process.
You have been warned.

Summary by CodeRabbit

  • Refactor
    • Moved Stratis initramfs integration to an earlier module stage for more consistent boot behavior and alignment with related components, including Clevis support.
  • Chores
    • Updated installation and cleanup routines to target the new module location and removed references to deprecated paths, ensuring consistent setup and teardown of Stratis and Clevis assets.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Aug 31, 2025

Walkthrough

The Makefile changes retarget dracut module installation and cleanup from dracut/90stratis and dracut/90stratis-clevis to dracut/50stratis and dracut/50stratis-clevis, adjusting directory creation, sed edits, file installs, and clean rules accordingly.

Changes

Cohort / File(s) Summary of Changes
Dracut module path renumbering
Makefile
Updated install-dracut-cfg to use dracut/50stratis instead of dracut/90stratis: create directories, run sed on stratisd-min.service and module-setup.sh, install stratis-rootfs-setup and 61-stratisd.rules. Migrated clevis module references from 90stratis-clevis to 50stratis-clevis, including module-setup.sh and stratis-clevis-rootfs-setup.
Cleanup target alignment
Makefile
Updated clean-cfg to remove dracut/50stratis and dracut/50stratis-clevis (formerly 90* dirs).

Sequence Diagram(s)

sequenceDiagram
  actor Dev as Developer
  participant Make as Makefile
  participant FS as Filesystem
  participant Dracut as Dracut

  Dev->>Make: make install-dracut-cfg
  Make->>FS: mkdir -p dracut/50stratis, dracut/50stratis-clevis
  Make->>FS: sed edits on service & module-setup.sh -> update paths to 50stratis
  Make->>FS: install stratis-rootfs-setup, 61-stratisd.rules, clevis setup files
  FS-->>Dracut: Modules now present under dracut/50stratis* 

  Dev->>Make: make clean-cfg
  Make->>FS: rm -rf dracut/50stratis{,-clevis}
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks (3 passed)

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title concisely and accurately summarizes the primary change: switching dracut out-of-tree module ordering to the recommended 50-range (from 90), which matches the Makefile edits and PR description that move files from dracut/90stratis to dracut/50stratis; it is specific and clear enough for a teammate scanning history to understand the main intent.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

I hopped from ninety down to fifty neat,
New burrows built where dracut pathways meet.
I nudged the scripts, moved clevis with a grin,
Tidied trails, stamped paws, and hopped back in.
Carrot-coded changes — a small, bright win. 🥕🐇

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.

  • 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.
  • 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.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7efa5de and c55e324.

📒 Files selected for processing (1)
  • Makefile (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Makefile
⏰ 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). (10)
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:cockpit
  • GitHub Check: testing-farm:fedora-43-x86_64:cockpit
  • GitHub Check: testing-farm:fedora-41-x86_64:local
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:local
  • GitHub Check: testing-farm:fedora-42-x86_64:local
  • GitHub Check: testing-farm:fedora-43-x86_64:local
  • 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: rpm-build:fedora-42-x86_64:copr_pull
✨ 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.

Copy link
Copy Markdown

@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: 1

🧹 Nitpick comments (2)
Makefile (2)

246-247: Minor: redundant directory creation

install -d $(DRACUTDIR)/modules.d/50stratis already creates modules.d; the prior mkdir -p …/modules.d is unnecessary.

Consider deleting Line 246.


319-321: Also clean legacy 90stratis directories to avoid upgrade leftovers

Older installs may have 90stratis dirs; remove them on clean to prevent stale modules in initramfs.

Apply:

 	rm -rfv $(DESTDIR)$(DRACUTDIR)/modules.d/50stratis
 	rm -rfv $(DESTDIR)$(DRACUTDIR)/modules.d/50stratis-clevis
+	rm -rfv $(DESTDIR)$(DRACUTDIR)/modules.d/90stratis
+	rm -rfv $(DESTDIR)$(DRACUTDIR)/modules.d/90stratis-clevis
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 67bde7f and 7efa5de.

📒 Files selected for processing (1)
  • Makefile (2 hunks)
🔇 Additional comments (1)
Makefile (1)

247-255: All dracut/50stratis files present and no 90stratis references remain
Verified that every required file under dracut/50stratis and dracut/50stratis-clevis exists and no lingering 90stratis paths were found.

Comment on lines +248 to +249
sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' dracut/50stratis/stratisd-min.service.in > $(DESTDIR)$(DRACUTDIR)/modules.d/50stratis/stratisd-min.service
sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' dracut/50stratis/module-setup.sh.in > $(DESTDIR)$(DRACUTDIR)/modules.d/50stratis/module-setup.sh
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

module-setup.sh not guaranteed executable; fix by installing with mode

Writing via sed loses exec bit; dracut requires module-setup.sh to be executable. Also set a deterministic mode for the generated .service file.

Apply:

-	sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' dracut/50stratis/stratisd-min.service.in > $(DESTDIR)$(DRACUTDIR)/modules.d/50stratis/stratisd-min.service
-	sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' dracut/50stratis/module-setup.sh.in > $(DESTDIR)$(DRACUTDIR)/modules.d/50stratis/module-setup.sh
+	sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' dracut/50stratis/stratisd-min.service.in \
+	  | $(INSTALL) -Dpm0644 /dev/stdin $(DESTDIR)$(DRACUTDIR)/modules.d/50stratis/stratisd-min.service
+	sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' dracut/50stratis/module-setup.sh.in \
+	  | $(INSTALL) -Dpm0755 /dev/stdin $(DESTDIR)$(DRACUTDIR)/modules.d/50stratis/module-setup.sh
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' dracut/50stratis/stratisd-min.service.in > $(DESTDIR)$(DRACUTDIR)/modules.d/50stratis/stratisd-min.service
sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' dracut/50stratis/module-setup.sh.in > $(DESTDIR)$(DRACUTDIR)/modules.d/50stratis/module-setup.sh
sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' dracut/50stratis/stratisd-min.service.in \
| $(INSTALL) -Dpm0644 /dev/stdin $(DESTDIR)$(DRACUTDIR)/modules.d/50stratis/stratisd-min.service
sed 's|@LIBEXECDIR@|$(LIBEXECDIR)|' dracut/50stratis/module-setup.sh.in \
| $(INSTALL) -Dpm0755 /dev/stdin $(DESTDIR)$(DRACUTDIR)/modules.d/50stratis/module-setup.sh

@jbaublitz
Copy link
Copy Markdown
Member

Hi @jozzsi, I'm willing to take a look at this but I'm the one who originally did the ordering for the file and when I tried to put it in that range, I remember bumping into boot failures. As I recall, the ordering was actually very important in our case. I'm not sure if it has to do with the fact that we're a storage stack. I can test again, but I think this will require some work just to validate that this change doesn't cause a regression. I will try to take a look at it within the next 3 weeks.

@jozzsi
Copy link
Copy Markdown
Contributor Author

jozzsi commented Sep 2, 2025

I remember bumping into boot failures.

Thanks for this context. Yes, I do expect this needs to be tested very carefully.

As I recall, the ordering was actually very important in our case.

As you except dracut upstream no way of knowing about these ordering dependencies and limitation, so at least knowing about it would allow us to work together to find a solution. Anyways I am also here to help.

I think one known issue is with using '90' ordering is that it breaks squash dracut module (as now this module is ordered before squash. This might not be very important for you, but at least is a breakage that is easy to explain.

@mulkieran
Copy link
Copy Markdown
Member

mulkieran commented Sep 2, 2025

dracut 107 is what is currently in Fedora: https://src.fedoraproject.org/rpms/dracut . 108 was released upstream Aug 4.

@jozzsi
Copy link
Copy Markdown
Contributor Author

jozzsi commented Sep 2, 2025

Processing files: stratisd-dracut-3.9.0~pre-202508310630git7efa5de5.x86_64
Executing(%license): /bin/sh -e /var/tmp/rpm-tmp.lkzYKx
error: File not found: /builddir/build/BUILD/stratisd-3.9.0_pre-build/BUILDROOT/usr/lib/dracut/modules.d/90stratis-clevis/module-setup.sh
error: File not found: /builddir/build/BUILD/stratisd-3.9.0_pre-build/BUILDROOT/usr/lib/dracut/modules.d/90stratis-clevis/stratis-clevis-rootfs-setup
error: File not found: /builddir/build/BUILD/stratisd-3.9.0_pre-build/BUILDROOT/usr/lib/dracut/modules.d/90stratis/61-stratisd.rules
error: File not found: /builddir/build/BUILD/stratisd-3.9.0_pre-build/BUILDROOT/usr/lib/dracut/modules.d/90stratis/module-setup.sh
error: File not found: /builddir/build/BUILD/stratisd-3.9.0_pre-build/BUILDROOT/usr/lib/dracut/modules.d/90stratis/stratis-rootfs-setup
error: File not found: /builddir/build/BUILD/stratisd-3.9.0_pre-build/BUILDROOT/usr/lib/dracut/modules.d/90stratis/stratisd-min.service

@jozzsi
Copy link
Copy Markdown
Contributor Author

jozzsi commented Sep 2, 2025

This out of tree file needs to be changed as well

https://src.fedoraproject.org/rpms/stratisd/raw/rawhide/f/stratisd.spec

I will not be able to do that (as I do not wish to create. an account on src.fedoraproject.org).

Please let me know how to proceed !

@mulkieran
Copy link
Copy Markdown
Member

This out of tree file needs to be changed as well

https://src.fedoraproject.org/rpms/stratisd/raw/rawhide/f/stratisd.spec

I will not be able to do that (as I do not wish to create. an account on src.fedoraproject.org).

Please let me know how to proceed !

Try adding a spec file to this PR and modifying the .packit.yaml file to use that spec file. I think that will work and will be simplest. It may be that the choice to pull the spec file from fedora is a mistake in the first place, and we should re-evaluate that.

@jozzsi
Copy link
Copy Markdown
Contributor Author

jozzsi commented Sep 2, 2025

Try adding a spec file to this PR and modifying the .packit.yaml file to use that spec file. I think that will work and will be simplest. It may be that the choice to pull the spec file from fedora is a mistake in the first place, and we should re-evaluate that.

I think this is a great idea, but I prefer it to be out of scope of this PR if possible (and I prefer if someone else could work on it instead). Perhaps this suggested change in the CI needs to happen before this PR can lands.

@mulkieran
Copy link
Copy Markdown
Member

Try adding a spec file to this PR and modifying the .packit.yaml file to use that spec file. I think that will work and will be simplest. It may be that the choice to pull the spec file from fedora is a mistake in the first place, and we should re-evaluate that.

I think this is a great idea, but I prefer it to be out of scope of this PR if possible (and I prefer if someone else could work on it instead). Perhaps this suggested change in the CI needs to happen before this PR can lands.

Adding the spec file in this PR is a suggestion for a quick and possibly temporary fix for you. Changing where we get the spec file from, that is, solving this kind of problem in the general case, is on me. You are welcome to leave the problem of editing the spec file to us entirely, if you prefer. Thanks for bringing this dracut change to our attention!

@mulkieran
Copy link
Copy Markdown
Member

mulkieran commented Sep 2, 2025

@jozzsi Is it expected that dracut 108 will be released in Fedora 44? No f44 change request, one bz: https://bugzilla.redhat.com/show_bug.cgi?id=2386448 . It looks like it will likely go into f43, consistent with where the new version of systemd has landed. Here is the systemd update that is currently causing the dracut problems: https://bodhi.fedoraproject.org/updates/FEDORA-2025-364b5c32da .

@jozzsi
Copy link
Copy Markdown
Contributor Author

jozzsi commented Sep 3, 2025

@jozzsi Is it expected that dracut 108 will be released in Fedora 44?

@pvalena drives this, I neither have opinion nor permission for this.

I do however think landing the change itself can be done before the v108 update and there is no need to coordinate this PR with the v108 update.

@jbaublitz
Copy link
Copy Markdown
Member

@jozzsi Usually I'm the one doing the testing. I may have to plan this for the next sprint unless I can get it added to this sprint. It will be a non-trivial amount of work just because we still do not have Anaconda support. I will try to get this scheduled.

@jozzsi
Copy link
Copy Markdown
Contributor Author

jozzsi commented Sep 8, 2025

Fedora rawhide upgraded to dracut v108 - https://src.fedoraproject.org/rpms/dracut/c/79a4f0367da56140506db78c6a7e1ea300e8a469?branch=rawhide

Move module ordering from 90 to 50

For dracut release v108 or later the recommended ordering for out out of tree modules
is 50-59 range. The following is a section from dracut documentation:

> Not using the 50-59 range for out of tree dracut modules will likely
> lead to unintended errors in the initramfs generation process as your
> dracut module will either run too early or too late in the generation process.
> You have been warned.
Copy link
Copy Markdown
Member

@mulkieran mulkieran left a comment

Choose a reason for hiding this comment

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

I checked it against stratis-storage/ci#558 , and srpm builds fine. I'll merge this and then that PR immediately.

@mulkieran mulkieran merged commit 9659bbe into stratis-storage:master Sep 12, 2025
25 of 47 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Done in 2025September Sep 12, 2025
@mulkieran mulkieran moved this from Done to Done(2) in 2025September Sep 16, 2025
@jozzsi jozzsi deleted the 1 branch September 18, 2025 01:48
@mulkieran mulkieran added this to the v3.8.5 milestone Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done(2)

Development

Successfully merging this pull request may close these issues.

3 participants