#3152 Issue closed: SLES15 SP5: Cannot create initrd (found no mkinitrd in the recreated system)

Labels: enhancement, bug, fixed / solved / done

abbbi opened issue at 2024-02-12 13:30:

Rear 2.7

hi,

it appears that

finalize/SUSE_LINUX/i386/550_rebuild_initramfs.sh

makes use of the "mkinitrd" executable. This executable has been moved to a special package on SLES15 SP5 called
dracut-mkinitrd-deprecated, which seems to be optional and may not be existent on the system backed up.

In reality it seems this "mkinitrd" exectuable is just an wrapper shellscript to call dracut, see the following
discussion:

https://lists.opensuse.org/archives/list/factory@lists.opensuse.org/thread/WKZFPUPW3BQ4GYLI4HIWLJDWANUOBLIT/

However, as the executable may be missing, this can result in recovery to spoil:

2024-01-10 13:38:11.294431793 Running mkinitrd...
2024-01-10 13:38:11.298370613 WARNING:
Cannot create initrd (found no mkinitrd in the recreated system).
Check the recreated system (mounted at /mnt/local)
and decide yourself, whether the system will boot or not.

maybe it would make sense to implement an fall-back to dracut commands if mkinitrd is not available:

dracut -f --regenerate-all

pcahyna commented at 2024-02-12 13:37:

See https://github.com/rear/rear/pull/2825

abbbi commented at 2024-02-12 19:52:

@pcahyna thanks, it may make sense to either port these changes to the SUSE related parts too, or use common code base for this?

jsmeix commented at 2024-02-13 13:24:

I can reproduce it.

Running mkinitrd...
WARNING:
Cannot create initrd (found no mkinitrd in the recreated system).
Check the recreated system (mounted at /mnt/local)
and decide yourself, whether the system will boot or not.

Installing GRUB2 boot loader...
Determining where to install GRUB2 (no GRUB2_INSTALL_DEVICES specified)
Found possible boot disk /dev/vda - installing GRUB2 there

Nevertheless the recreated system boots well for me
as expected because I recreated on 100% compatible
replacement "hardware" (on a same VM) so the same initrd
from the original system should still work.

I will have a look how to solve it properly.

jsmeix commented at 2024-02-16 11:59:

@abbbi
could you please test if
https://github.com/rear/rear/pull/3155
also works for you?

In particular check your "rear -D recover" log file
for possible issues when dracut is run
and during reboot of the recreated system
for issues that could be related to the initrd.

jsmeix commented at 2024-02-22 10:07:

This issue happens only since SLES15-SP5.

This is the reason why I did not notice it
because I falsely assumed that SLE service packs
do not break backward compatibility without serious reason.

I do not re-test ReaR for new SLE service packs. See
https://github.com/rear/rear/wiki/Test-Matrix-ReaR-2.7
what and where I tested for ReaR 2.7.

In this case it seems backward compatibility got broken
by accident because a single RPM requirement in one
RPM package (mdadm) was no longer needed and that
single RPM requirement was the only reason why
dracut-mkinitrd-deprecated got installed on SLES15-SP4.

Details:

I installed SLES15-SP4 and there
dracut-mkinitrd-deprecated is installed by default.

In contrast on SLES15-SP5 dracut-mkinitrd-deprecated
is no longer installed by default.

Both on SLES15-SP4 and SLES15-SP5 dracut-mkinitrd-deprecated
belongs to the sle-module-basesystem repository

# zypper search -v dracut-mkinitrd-deprecated
...
Name                       ... Repository
dracut-mkinitrd-deprecated ... sle-module-basesystem

so on SLES15-SP5 dracut-mkinitrd-deprecated
should be always available to be "just installed".

On SLES15-SP4 dracut-mkinitrd-deprecated
is installed because mdadm requires /sbin/mkinitrd

SLES15-SP4: # rpm -e --test dracut-mkinitrd-deprecated
error: Failed dependencies:
/sbin/mkinitrd is needed by (installed) mdadm-4.1-...

On SLES15-SP5 mdadm does no longer require /sbin/mkinitrd

SLES15-SP5: # rpm -q --changelog mdadm
...
* Thu Nov 24 2022 colyli@suse.com
- mdadm.spec: remove "PreReq: %{_sbindir}/mkinitrd" as it is
  unnecessary now. (bsc#1202352)

where bsc#1202352 is
https://bugzilla.opensuse.org/show_bug.cgi?id=1202352

Therein another openSUSE mail thread
on factory@lists.opensuse.org is referenced
https://lists.opensuse.org/archives/list/factory@lists.opensuse.org/thread/GDAZ7TVXS2BAXENVBAMHVXVHLSR7D7NQ/

abbbi commented at 2024-03-04 18:29:

Tested and can Confirm its working for me, thanks!


[Export of Github issue for rear/rear.]