dracut
dracut copied to clipboard
fix(net-lib): add a new dracut module called net-lib
Motivations:
- meta modules (such as dbus or network) should not include any scripts. meta modules should only have
module-setup.sh
files as it has been also pointed out during earlier PR reviews and discussions. - fix dependencies. As an example
dracut -m network-manager
produces a broken initramfs that this PR fixes. - follow the wise people before me with good modular design as it has been proven for e.g. fs-lib, url-lib modules
Checklist
- [X] I have tested it locally
- [X] I have reviewed and updated any documentation if relevant
- [X] I am providing new code and test(s) for it
Fixes #2195
Before PR (net-lib.sh is NOT included)
dracut: Arguments: -v -m 'network-manager' dracut: dracut modules: dracut: bash dracut: systemd dracut: dbus-daemon dracut: dbus dracut: network-manager
After PR (net-lib.sh is included)
dracut: Arguments: -v -m 'network-manager' dracut: dracut modules: dracut: bash dracut: systemd dracut: dbus-daemon dracut: dbus dracut: network-manager dracut: net-lib dracut: udev-rules dracut: base
networking tests are all passing (without changing the tests itself, which is a good indication for maintaining compatibility)
@aafeijoo-suse do you have any questions or concerns regarding this PR ?
@aafeijoo-suse if you have time, can you please help and check if your concerns are resolved on this PR. Thank you !
@aafeijoo-suse if you have time, can you please help and check if your concerns are resolved on this PR. Thank you !
My main concern is how many setups will break with this change, I thought that you wanted to be conservative. Just doing a quick search on GitHub:
- https://github.com/flatcar/bootengine/blob/cc0fdec0cc6c5692acac95a928984ea8a5eb8f08/dracut/03flatcar-network/module-setup.sh#L46
- https://github.com/xcat2/confluent/blob/809099c8f80febb1937244fff17f6bd8f1364c7a/imgutil/el9/dracut/install#L28
- https://github.com/awmacpherson/deboot/blob/582c33e6ef2bc8b537a2f6c086ce276819350d8c/rootfs/mkroot.sh#L42
- https://github.com/alpinelinux/aports/blob/61691bc12240a7ed40637b784c6e2723eb38f3ad/community/dracut/APKBUILD#L39
My main concern is how many setups will break with this change
Valid concern indeed.
I still prefer to be conservative. https://github.com/dracutdevs/dracut/pull/2314 is changing the dracut module interface, this PR does not.
I started documenting different aspects of compatibility here: https://github.com/dracutdevs/dracut/wiki/Dracut-development#compatibility .
- https://github.com/flatcar/bootengine/blob/cc0fdec0cc6c5692acac95a928984ea8a5eb8f08/dracut/03flatcar-network/module-setup.sh#L46
This is best example. From a quick look of it, it seems this module needs to change, BUT after the one-time change it seems that this out-of-tree module can just depend on this newly created net-lib instead of cherry-picking a single file from the network module that has no compatibility promise.
- https://github.com/xcat2/confluent/blob/809099c8f80febb1937244fff17f6bd8f1364c7a/imgutil/el9/dracut/install#L28
We should work with this project if possible, but we should not have any kind of compatibility promise for projects picking single files from random directories. This is not even a proper dracut module, it is just a shell script.
- https://github.com/awmacpherson/deboot/blob/582c33e6ef2bc8b537a2f6c086ce276819350d8c/rootfs/mkroot.sh#L42
Same. Not a dracut module.
- https://github.com/alpinelinux/aports/blob/61691bc12240a7ed40637b784c6e2723eb38f3ad/community/dracut/APKBUILD#L39
This is packaging file. Irrelevant.
As next step I will reach out to bootengine and see if I can get some feedback from them on this PR (instead of me guessing what they think).
Based on discussion at https://github.com/flatcar/bootengine/pull/69 it does not look like there is opposition for this change.
From @Mrfai
dracut module network-legacy installs parse-ibft.sh which want to source /lib/net-lib.sh which is only installed by module network. So should network-legacy depend on network? I had an issue when booting failed with net-lib.sh file not found