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

Provide early boot systemd unit files within the associated dracut module #1886

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

davidcassany
Copy link
Contributor

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Dec 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b33f303) 73.60% compared to head (3b07f37) 73.60%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1886   +/-   ##
=======================================
  Coverage   73.60%   73.60%           
=======================================
  Files          69       69           
  Lines        7332     7332           
=======================================
  Hits         5397     5397           
  Misses       1544     1544           
  Partials      391      391           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor Author

@davidcassany davidcassany left a comment

Choose a reason for hiding this comment

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

inst_simple "${moddir}/elemental-setup-rootfs.service" \
"${systemdsystemunitdir}/elemental-setup-rootfs.service"
mkdir -p "${initdir}/${systemdsystemunitdir}/initrd-root-fs.target.requires"
ln_r "../elemental-setup-rootfs.service" \
"${systemdsystemunitdir}/initrd-root-fs.target.requires/elemental-setup-rootfs.service"

${moddir} relates to the root folder of the dracut module, this is the folder of this current file, hence this path was essentially wrong.

@@ -1,4 +1,2 @@
install_items+=" /usr/lib/systemd/system/elemental-setup-initramfs.service /etc/systemd/system/initrd.target.requires/elemental-setup-initramfs.service "
install_items+=" /usr/lib/systemd/system/elemental-setup-rootfs.service /etc/systemd/system/initrd-fs.target.requires/elemental-setup-rootfs.service "
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I saw dracut error messages trying to execute those, that's how all this PR started.

@@ -146,11 +146,7 @@ func Get(names []string) ([]*Feature, error) {
return features, fmt.Errorf("Conflicting features: %s and %s", FeatureElementalRootfs, FeatureImmutableRootfs)
}

units := []*systemd.Unit{
systemd.NewUnit("elemental-rootfs.service"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Was there an error for these units? These are actually pretty handy to include since you can run systemctl status elemental-rootfs in the booted system and see failures/logs..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point I am not sure if this will still be de case. I mean the unit is there but mostly managed by the initramfs systemd unit.

The thing is that I to make inst_simple command in module-setup.sh functional having the service file within the module makes it easy. Probably we could use the full path in there as long as the unit file and the dracut module are in the same feature it shouldn't be a problem having a hardcoded full path in there. I can give it a quick test.

Copy link
Contributor

@frelon frelon left a comment

Choose a reason for hiding this comment

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

LGTM!

Signed-off-by: David Cassany <dcassany@suse.com>
@davidcassany davidcassany enabled auto-merge (rebase) December 14, 2023 11:24
@davidcassany davidcassany merged commit 29a6223 into rancher:main Dec 14, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants