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

fix(dracut): move hooks directory from /usr/lib to /var/lib #2591

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aafeijoo-suse
Copy link
Member

Since systemd/systemd@ffc1ec73, /usr is mounted as read-only in the initramfs by default.

Checklist

  • I have tested it locally
  • I have reviewed and updated any documentation if relevant
  • I am providing new code and test(s) for it

Fixes #2588

@aafeijoo-suse
Copy link
Member Author

@lnussel I'm not sure if /var is a good long-term option, see https://github.com/systemd/systemd/blob/5a4631bd8fde4122bf6f25872df07229a6b3ed74/TODO#L966-L970

A specific directory outside the FHS (such as /.dracut) would not suffer these types of changes.

@lnussel
Copy link

lnussel commented Dec 28, 2023

That's talking about /sysroot/var IMO

@aafeijoo-suse
Copy link
Member Author

That's talking about /sysroot/var IMO

Right, I was wrong. Thanks.

@aafeijoo-suse aafeijoo-suse marked this pull request as ready for review December 28, 2023 14:29
@johannbg
Copy link
Collaborator

johannbg commented Jan 4, 2024

@aafeijoo-suse did you look into how this change would affect non systemd based distributions and which locations those users/distro's might want to use instead since the scope of this change is not limited to systemd based distributions.

@aafeijoo-suse
Copy link
Member Author

@aafeijoo-suse did you look into how this change would affect non systemd based distributions and which locations those users/distro's might want to use instead since the scope of this change is not limited to systemd based distributions.

No, I didn't. That's why upstream PRs are public, so people from other environments can comment whether this change suits their systems. What I know is that initrds generated by dracut don't work with the upcoming systemd-v256, but we are not in a hurry, the new place to save the hooks is something to discuss here.

@LaszloGombos
Copy link
Collaborator

LaszloGombos commented Jan 5, 2024

Regardless of the new writable location, can dracut maintain a link from /lib/dracut/hooks to the new directory location for improved compatibility ?

Copy link

stale bot commented Mar 13, 2024

This issue is being marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days. Thank you for your contributions.

@stale stale bot added the stale communication is stuck label Mar 13, 2024
@aafeijoo-suse aafeijoo-suse removed the stale communication is stuck label Mar 14, 2024
@aafeijoo-suse
Copy link
Member Author

@aafeijoo-suse did you look into how this change would affect non systemd based distributions and which locations those users/distro's might want to use instead since the scope of this change is not limited to systemd based distributions.

No, I didn't. That's why upstream PRs are public, so people from other environments can comment whether this change suits their systems. What I know is that initrds generated by dracut don't work with the upcoming systemd-v256, but we are not in a hurry, the new place to save the hooks is something to discuss here.

Bumping this topic again, systemd will tag v256-rc1 soon and dracut is broken without this fix.

@thesamesam @floppym @AndrewAmmerlaan @ahesford ping, I don't know if /var is a good idea on non-systemd systems, or an out-of-tree directory like /.dracut is better.

@ahesford
Copy link
Contributor

ahesford commented Apr 5, 2024

I'll tag @zdykstra for further comment as the maintainer of Void's dracut package and fellow ZFSBootMenu author.

On the surface, this is probably irrelevant to ZFSBootMenu, because we should be using dracut's hook installation functions to put our stuff where it needs to go. We don't work with systemd in the initramfs and just exec into our own event loop anyway.

In the meantime, I'll grumble quietly, but loudly enough to say that this is yet another example of a questionable decision by systemd that produces no discernible benefit (why is /usr even a separate filesystem in the initramfs?!?!?) and makes the quest to incorporate systemd into initramfs images seem even more quixotic.

@LaszloGombos
Copy link
Collaborator

LaszloGombos commented Apr 5, 2024

Regardless of the new writable location, can dracut maintain a link from /lib/dracut/hooks to the new directory location for improved compatibility ?

I do not see how we can maintain Compatibility without having a link from /lib/dracut/hooks.

Random (perhaps not the best) example that I think would break by this PR (from openshift) - https://github.com/openshift/installer/blob/master/pkg/asset/agent/image/agentartifacts.go#L164

@zdykstra
Copy link

zdykstra commented Apr 5, 2024

There's nothing I can see on the Void side that will break because of this change. I seriously question the need for making /usr read-only in an initramfs, but that ship seems to have already sailed.

Since systemd/systemd@ffc1ec73, /usr is mounted as
read-only in the initramfs by default.

Fixes dracutdevs#2588
@github-actions github-actions bot added test Issues related to testing modules Issue tracker for all modules resume Issues related to the resume module dracut-systemd Issues related to the dracut-systemd module base Issues related to the base module shutdown Issues related to the shutdown module docs labels Apr 5, 2024
Copy link
Collaborator

@LaszloGombos LaszloGombos left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks for adding a link from /lib/dracut/hooks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
base Issues related to the base module docs dracut-systemd Issues related to the dracut-systemd module modules Issue tracker for all modules resume Issues related to the resume module shutdown Issues related to the shutdown module test Issues related to testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hookdir can't be in /usr if used for writing
6 participants