Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.0] dracut: patch for systemd-cryptsetup module to be included #12827

Open
wants to merge 2 commits into
base: 3.0-dev
Choose a base branch
from

Conversation

arc9693
Copy link
Contributor

@arc9693 arc9693 commented Mar 5, 2025

Merge Checklist

All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)

  • The toolchain has been rebuilt successfully (or no changes were made to it)
  • The toolchain/worker package manifests are up-to-date
  • Any updated packages successfully build (or no packages were changed)
  • Packages depending on static components modified in this PR (Golang, *-static subpackages, etc.) have had their Release tag incremented.
  • Package tests (%check section) have been verified with RUN_CHECK=y for existing SPEC files, or added to new SPEC files
  • All package sources are available
  • cgmanifest files are up-to-date and sorted (./cgmanifest.json, ./toolkit/scripts/toolchain/cgmanifest.json, .github/workflows/cgmanifest.json)
  • LICENSE-MAP files are up-to-date (./LICENSES-AND-NOTICES/SPECS/data/licenses.json, ./LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md, ./LICENSES-AND-NOTICES/SPECS/LICENSE-EXCEPTIONS.PHOTON)
  • All source files have up-to-date hashes in the *.signatures.json files
  • sudo make go-tidy-all and sudo make go-test-coverage pass
  • Documentation has been updated to match any changes to the build system
  • Ready to merge

Summary

What does the PR accomplish, why was it needed?
This PR fixes an issue where cryptsetup.target does not honor crypttab entries during the initrd phase due to missing systemd-cryptsetup-generator and systemd-cryptsetup binaries in the Dracut-generated initramfs.

Starting from Dracut version 102, the systemd-cryptsetup module was separated from the crypt module (as per dracut-ng#262) and is no longer included by default. This change causes encrypted volumes to not be processed correctly in the early boot phase.

Fix

This PR applies a patch to the dracut-systemd module to explicitly include the systemd-cryptsetup module when needed. The patch modifies the module-setup.sh script in modules.d/98dracut-systemd/ to ensure that systemd-cryptsetup is installed as a dependency, restoring the expected cryptsetup functionality.

Patch Details

  • Patch Name: fix-dracut-systemd-include-systemd-cryptsetup.patch
  • Modified File: modules.d/98dracut-systemd/module-setup.sh
  • Patch Reference: Commit e0e5424a7b5e387ccb70e47ffea5a59716bf7b76
  • Fix: Updates the Dracut systemd module to correctly install the systemd-cryptsetup module when needed.
Does this affect the toolchain?

NO

Associated issues
Test Methodology

@microsoft-github-policy-service microsoft-github-policy-service bot added Packaging 3.0-dev PRs Destined for AzureLinux 3.0 labels Mar 5, 2025
@arc9693 arc9693 marked this pull request as ready for review March 5, 2025 13:22
@arc9693 arc9693 requested a review from a team as a code owner March 5, 2025 13:22
@arc9693 arc9693 added the stable-release-shiproom PRs for consideration for stable shiproom label Mar 5, 2025
@arc9693 arc9693 changed the title [3.0] dracut: add patch for systemd-cryptsetup module to be included [3.0] dracut: patch for systemd-cryptsetup module to be included Mar 5, 2025
Copy link
Contributor

@Camelron Camelron left a comment

Choose a reason for hiding this comment

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

We may want to consider including this change as well?

dracut-ng/dracut-ng@484a8a2

Though I guess we don't have a systemd that has been built with cryptsetup disabled so maybe safe to ignore. https://github.com/microsoft/azurelinux/blob/3.0/SPECS/systemd/systemd.spec#L679

@arc9693 arc9693 force-pushed the archana1/dracut-cryptsetup-fix branch from dc82bf4 to 4ff729b Compare March 11, 2025 11:42
@arc9693
Copy link
Contributor Author

arc9693 commented Mar 11, 2025

Rebased to remove conflicts.
Buddy build: https://dev.azure.com/mariner-org/mariner/_build/results?buildId=759607&view=results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0-dev PRs Destined for AzureLinux 3.0 Packaging stable-release-shiproom PRs for consideration for stable shiproom