#2825 PR merged: Replace mkinitrd with dracut on Fedora and RHEL

Labels: enhancement, cleanup, fixed / solved / done

lzaoral opened issue at 2022-06-21 15:58:

Pull Request Details:

RHEL 9 VM without this patch that failed to regenerate the initrd and same VM with this patch that regenerated the initrd successfully.

  • Brief description of the changes in this pull request:

For a long time, mkinitrd was a wrapper script around dracut in Fedora and RHEL that maintained backwards compatibility with the real (but rather obsolete) mkinitrd.

Dracut 054 removed the mkinitrd wrapper script [1] so now we have to execute dracut directly. Fortunately, ReaR did not use almost anything from mkinitrd's interface (with the exception of --with) so the transition is quite straightforward.

Without this patch the initrd regeneration in the finalize stage of recovery fails on RHEL 9 and Fedora 33 or newer.

[1] https://github.com/dracutdevs/dracut/pull/1285

lzaoral commented at 2022-06-21 16:14:

@pcahyna, it is expected that the production-build Packit jobs will start only for high privileged contributors?

pcahyna commented at 2022-06-22 08:14:

@pcahyna, it is expected that the production-build Packit jobs will start only for high privileged contributors?

I have no idea. Why would it be limited to production-build and not rpm-build, anyway?

pcahyna commented at 2022-06-22 08:17:

@jsmeix I checked that dracut exists in RHEL 6 (the oldest release that ReaR cares about) and that even there mkinitrd was a shell script that invokes dracut internally. Of course this does not guarantee that it will work properly, but at least the chances are quite high.

jsmeix commented at 2022-06-22 10:25:

@pcahyna
when the changes work sufficiently backward compatible
for what Red Hat needs we should include it in ReaR 2.7
so feel free to merge it as you like.

lzaoral commented at 2022-06-22 13:46:

@jsmeix, Sorry, I should have already mentioned that in the commit message. As @pcahyna already mentioned, RHEL 6 was the first release that used dracut to generate initrds. That said I've also tested this change on RHEL 7 and RHEL 8 without any dracut related regressions spotted.

jsmeix commented at 2022-06-22 15:16:

@lzaoral
thank you for your enhancement and for your tests!

jsmeix commented at 2022-06-23 14:03:

@pcahyna
is there a reason why you do not merge it?

jsmeix commented at 2022-07-04 13:44:

@pcahyna
is there a reason why you do not merge it?

Could or should perhaps I "just merge" it?

pcahyna commented at 2022-07-04 13:48:

@jsmeix sorry, I forgot about this. Yes, I will merge it.

jsmeix commented at 2022-07-04 13:50:

@pcahyna
thank you


[Export of Github issue for rear/rear.]