dracutdevs / dracut

dracut the event driven initramfs infrastructure
https://github.com/dracutdevs/dracut/wiki
GNU General Public License v2.0
600 stars 399 forks source link

multipath cleanup #2563

Open mwilck opened 10 months ago

mwilck commented 10 months ago

Changes

Simplify dracut's multipath module by using the upstream systemd service file, and by not enforcing kernel module loading using "rd.driver.pre".

This allows distributions to configure driver loading in the initrd in a generic way which is consistent with the overall configuration of the distribution, and transparent to the user. Also, it makes it possible to avoid loading SCSI modules on systems where no SCSI hardware is installed.

This change may require adaptations in the way distributions handle booting from dm-multipath. Distributions will have to take care that the necessary modules are loaded if necessary. Most distributions will be doing this anyway using modules-load.d or similar mechanisms. dracut already pulls in modules-load.d and modprobe.d configuration files that make this work.

Checklist

Fixes #

mwilck commented 10 months ago

Adding @aafeijoo-suse and @bmarzins.

bmarzins commented 10 months ago

This looks fine to me.

LaszloGombos commented 10 months ago

Thanks @mwilck

not enforcing kernel module loading using "rd.driver.pre".

This is a welcomed change, I also did notice that the current logic has unintended consequences.

I noticed that as a result of this PR, some openSUSE test cases regressed. Somewhat oddly only on openSUSE. As an example Test-01 and Test-02 tests are passing on openSUSE (and all other distributions on the CI) on master, but in the try run of this PR it seems to fail.

mwilck commented 10 months ago

This is currently causing regressions. I probably can't just drop the "rd.driver.pre" without making sure all test distros handle this cleanly. OTOH, this will reveal a couple of subtleties that we should fix anyway. I'm on it.

mwilck commented 10 months ago

Thanks @mwilck

not enforcing kernel module loading using "rd.driver.pre".

This is a welcomed change, I also did notice that the current logic has unintended consequences.

As an example Test-01 and Test-02 tests are passing on openSUSE (and all other distributions on the CI) on master, but in the try run of this PR it seems to fail.

Right. That already revealed a multipath-tools bug (pre-0.9.7, but 0.9.7 has it for systemd versions < 245, too). multipathd.service is lacking a dependency on systemd-modules-load.service.

Good that I finally learn the dracut test suite, very useful stuff.

LaszloGombos commented 10 months ago

This is currently causing regressions. I probably can't just drop the "rd.driver.pre" without making sure all test distros handle this cleanly. OTOH, this will reveal a couple of subtleties that we should fix anyway. I'm on it.

You probably also noticed, but I am seeing the following in the failed test cases:

(multipathd) died (code=exited, status=1/FAILURE)

mwilck commented 10 months ago

(multipathd) died (code=exited, status=1/FAILURE)

Same reason, probably. The dm-multipath kernel module is loaded after multipathd startup, which then fails. An additional dependency would fix it. For the time being, I could add that dependency here, but it must ultimately go into multipath-tools upstream.

Btw I noticed that the stdin redirection from /dev/null for qemu in the test scripts makes it impossible to actually enter emergency mode in the test VM (when DEBUGFAIL) is set. For the time being I just removed this redirection. Is there a more elegant trick to do this that I'm unaware of?

LaszloGombos commented 10 months ago

For the time being I just removed this redirection. Is there a more elegant trick to do this that I'm unaware of?

Not that I am aware of. Tests are design for CI in mind, not for debugging/development (sadly).

stale[bot] commented 5 months ago

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.