#1996 Issue closed: ReaR fails on Fedora 29 with UEFI when grub2-efi-modules are missing

Labels: support / question, fixed / solved / done

bojleros opened issue at 2018-12-04 18:21:

While running 'rear mkrescue' (OUTPUT=ISO , OUTPUT_URL=file:///mnt/) :

2018-12-04 19:17:28.141403886 Testing 'ldd /bin/bash' to ensure 'ldd' works for the subsequent 'ldd' tests
        linux-vdso.so.1 (0x00007f9078481000)
        libtinfo.so.6 => /lib64/libtinfo.so.6 (0x00007f907832a000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f9078324000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f907815e000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f9078483000)
2018-12-04 19:17:36.922227123 Including build/default/985_fix_broken_links.sh
cp: cannot stat '/efi/EFI/fedora/grubenv': No such file or directory
'////sbin/chkconfig' -> './////sbin/chkconfig'
'////sbin/chkconfig' -> './////sbin/chkconfig'
'/usr/share/zoneinfo/Europe/Warsaw' -> './/usr/share/zoneinfo/Europe/Warsaw'
cp: cannot stat '/boot/efi/EFI/fedora/grubcfg': No such file or directory
2018-12-04 19:17:36.976555533 Including build/default/990_update_os_conf.sh
2018-12-04 19:17:36.978019003 Finished running 'build' stage in 22 seconds
2018-12-04 19:17:36.979242068 ======================
2018-12-04 19:17:36.980375688 Running 'pack' stage
2018-12-04 19:17:36.981482878 ======================
2018-12-04 19:17:36.988486087 Including pack/Linux-i386/300_copy_kernel.sh
2018-12-04 19:17:36.992944289 Including pack/GNU/Linux/400_guess_kernel.sh
2018-12-04 19:17:36.994823936 Guessed kernel /boot/vmlinuz-4.19.5-300.fc29.x86_64
2018-12-04 19:17:36.999596216 Including pack/GNU/Linux/900_create_initramfs.sh
2018-12-04 19:17:37.003596308 Creating recovery/rescue system initramfs/initrd initrd.cgz with gzip default compression
2018-12-04 19:17:55.082886709 Created initrd.cgz with gzip default compression (250266628 bytes) in 18 seconds
2018-12-04 19:17:55.083929812 Finished running 'pack' stage in 19 seconds
2018-12-04 19:17:55.084621826 ======================
2018-12-04 19:17:55.085263818 Running 'output' stage
2018-12-04 19:17:55.085887814 ======================
2018-12-04 19:17:55.090291871 Including output/default/010_set_umask.sh
2018-12-04 19:17:55.091319135 Setting umask to 077
2018-12-04 19:17:55.094477641 Including output/default/100_mount_output_path.sh
2018-12-04 19:17:55.100146254 Including output/default/150_save_copy_of_prefix_dir.sh
2018-12-04 19:17:55.103869895 Including output/default/200_make_boot_dir.sh
2018-12-04 19:17:55.109096133 Including output/default/200_make_prefix_dir.sh
2018-12-04 19:17:55.120786280 Including output/default/250_create_lock.sh
2018-12-04 19:17:55.131949323 Including output/ISO/Linux-i386/250_populate_efibootimg.sh
/usr/share/rear/lib/_input-output-functions.sh: line 328: type: grub-mkimage: not found
grub2-mkimage: error: cannot open `/usr/lib/grub/x86_64-efi/moddep.lst': No such file or directory.
2018-12-04 19:17:55.154872846 ERROR: Error occurred during grub2-mkimage of BOOTX64.efi
==== Stack trace ====
Trace 0: /usr/sbin/rear:543 main
Trace 1: /usr/share/rear/lib/mkrescue-workflow.sh:22 WORKFLOW_mkrescue
Trace 2: /usr/share/rear/lib/framework-functions.sh:101 SourceStage
Trace 3: /usr/share/rear/lib/framework-functions.sh:49 Source
Trace 4: /usr/share/rear/output/ISO/Linux-i386/250_populate_efibootimg.sh:75 source
Trace 5: /usr/share/rear/lib/uefi-functions.sh:50 build_bootx86_efi
Trace 6: /usr/share/rear/lib/_input-output-functions.sh:371 StopIfError
Message: Error occurred during grub2-mkimage of BOOTX64.efi
== End stack trace ==
2018-12-04 19:17:55.162801678 Exiting rear mkrescue (PID 1564) and its descendant processes
2018-12-04 19:17:56.219237721 rear,1564 /usr/sbin/rear mkrescue
  `-rear,23875 /usr/sbin/rear mkrescue
      `-pstree,23876 -Aplau 1564
/usr/share/rear/lib/_input-output-functions.sh: line 157: kill: (23879) - No such process
2018-12-04 19:17:56.238356993 Running exit tasks
2018-12-04 19:17:56.240058833 Finished in 45 seconds
2018-12-04 19:17:56.241001389 Removing build area /tmp/rear.vliy4zdPmBGwkoc
2018-12-04 19:17:56.315819241 End of program reached

jsmeix commented at 2018-12-05 07:49:

@bojleros
follow
https://github.com/rear/rear/blob/master/.github/ISSUE_TEMPLATE.md
and follow in particular the section about
"Debugging issues with Relax-and-Recover" at
https://en.opensuse.org/SDB:Disaster_Recovery

gdha commented at 2018-12-05 16:21:

@bojleros I will first check the behaviour on fedora28 - afterwards will do an upgrade to fedora29 and test it again.

gozora commented at 2018-12-05 16:48:

First of all, I fully agree here with @jsmeix https://github.com/rear/rear/issues/1996#issuecomment-444390661, but to save some time of @gdha, try dnf install grub2-efi-modules.x86_64 ...

V.

jsmeix commented at 2018-12-06 08:38:

@gozora
could you tell me make and vendor of your crystal ball?
I like to have the same ;-)

This issue is a duplicate of
https://github.com/rear/rear/issues/1193
so that I close this issue hereby.

@gdha
feel free to reopen it or make a new separated issue
if you think some automatism needs to be implemented
to autodetect when grub2-efi-modules are actually needed
and error out with a more explict error message if they are missing.

gozora commented at 2018-12-06 12:49:

@jsmeix

This issue is a duplicate of
#1193
so that I close this issue hereby.

I'll tell you who my vendor is, if you tell me yours ;-)

V.

bojleros commented at 2018-12-06 18:28:

Thank you for linking related issues. I think that at least one crystal ball vendor needs to be contacted since progress is partial ;) :

2018-12-06 19:20:06.960187931 ======================
2018-12-06 19:20:06.960804882 Running 'output' stage
2018-12-06 19:20:06.961491829 ======================
2018-12-06 19:20:06.967477308 Including output/default/010_set_umask.sh
2018-12-06 19:20:06.968621222 Setting umask to 077
2018-12-06 19:20:06.972171785 Including output/default/100_mount_output_path.sh
2018-12-06 19:20:06.977202464 Including output/default/150_save_copy_of_prefix_dir.sh
2018-12-06 19:20:06.981445707 Including output/default/200_make_boot_dir.sh
2018-12-06 19:20:06.987403279 Including output/default/200_make_prefix_dir.sh
2018-12-06 19:20:06.997923880 Including output/default/250_create_lock.sh
2018-12-06 19:20:07.008891681 Including output/ISO/Linux-i386/250_populate_efibootimg.sh
/usr/share/rear/lib/_input-output-functions.sh: line 328: type: grub-mkimage: not found
grub2-mkimage: error: cannot open `/usr/lib/grub/x86_64-efi/linuxefi.mod': No such file or directory.
2018-12-06 19:20:07.030670251 ERROR: Error occurred during grub2-mkimage of BOOTX64.efi
==== Stack trace ====
Trace 0: /usr/sbin/rear:543 main
Trace 1: /usr/share/rear/lib/mkrescue-workflow.sh:22 WORKFLOW_mkrescue
Trace 2: /usr/share/rear/lib/framework-functions.sh:101 SourceStage
Trace 3: /usr/share/rear/lib/framework-functions.sh:49 Source
Trace 4: /usr/share/rear/output/ISO/Linux-i386/250_populate_efibootimg.sh:75 source
Trace 5: /usr/share/rear/lib/uefi-functions.sh:50 build_bootx86_efi
Trace 6: /usr/share/rear/lib/_input-output-functions.sh:371 StopIfError
Message: Error occurred during grub2-mkimage of BOOTX64.efi
== End stack trace ==
2018-12-06 19:20:07.037777942 Exiting rear mkrescue (PID 7284) and its descendant processes
2018-12-06 19:20:08.083746479 rear,7284 /usr/sbin/rear mkrescue
  `-rear,28636 /usr/sbin/rear mkrescue
      `-pstree,28637 -Aplau 7284
/usr/share/rear/lib/_input-output-functions.sh: line 157: kill: (28640) - No such process
2018-12-06 19:20:08.100968612 Running exit tasks
2018-12-06 19:20:08.102491706 Finished in 46 seconds
2018-12-06 19:20:08.103379147 Removing build area /tmp/rear.mzrH8UNiA2itpTX
2018-12-06 19:20:08.178599667 End of program reached

Unfrortunately dnf claims there is no package that provides '/usr/lib/grub/x86_64-efi/linuxefi.mod'.

PS. This system was upgraded from Fedora 28 , same goes for my second system where results are the same.

Kind Regards !

gozora commented at 2018-12-06 18:34:

I'm not a big Fedora user so I can't help much here.
Maybe you can ask around Fedora community why is linuxefi.mod not available any more or what is its replacement ?

V.

jsmeix commented at 2018-12-07 10:47:

@rmetrich
could you perhaps help here what additional RPM packages
need to be installed in Fedora 29 (that was upgraded from Fedora 28)
so that 'grub2-mkimage' can still succeed?

rmetrich commented at 2018-12-07 11:11:

@bojleros You need to install grub2-efi-x64-modules and probably fix the line 53 of /usr/share/rear/lib/uefi-functions.sh to remove the linuxefi module which seems to not exist anymore, ending up with having same line as for slackware.

gdha commented at 2018-12-10 17:05:

@rmetrich could you verify PR #2001 ?

rmetrich commented at 2018-12-10 20:00:

@gdha I will, give me some time, I need to check on Fed28, then Fed29

rmetrich commented at 2018-12-11 14:37:

What about including the linuxefi module if it exists in /usr/lib/grub/$(uname -p)-efi/ and don't distinguish between slackware, fedora and the rest?

jsmeix commented at 2018-12-11 15:22:

If possible that would be also my preferred way
i.e. test for "the real thing" instead of Linux distribution specific tests,
cf. in
https://github.com/rear/rear/issues/1368#issuecomment-302410707
the section "Reason" the part about We must inspect "the real thing"

jsmeix commented at 2018-12-11 15:38:

FYI:
On my SLES15-like openSUSE Leap 15.0 system I have

# find /boot /usr/lib/grub2/ | grep -i linuxefi
/boot/grub2/x86_64-efi/linuxefi.mod
/usr/lib/grub2/x86_64-efi/linuxefi.mod
/usr/lib/grub2/x86_64-efi/linuxefi.module

# rpm -qf $( find /boot /usr/lib/grub2/ | grep -i linuxefi )
file /boot/grub2/x86_64-efi/linuxefi.mod is not owned by any package
grub2-x86_64-efi-2.02-lp150.13.7.1.x86_64
grub2-x86_64-efi-2.02-lp150.13.7.1.x86_64

# md5sum $( find /boot /usr/lib/grub2/ | grep -i linuxefi )
6beadb0fbf1dedbf5fd4663199c212ab  /boot/grub2/x86_64-efi/linuxefi.mod
6beadb0fbf1dedbf5fd4663199c212ab  /usr/lib/grub2/x86_64-efi/linuxefi.mod
b9bb16c7d6053c8886039fcac7483945  /usr/lib/grub2/x86_64-efi/linuxefi.module

I assume the file /boot/grub2/x86_64-efi/linuxefi.mod is what
is actually used by GRUB when booting so that this one should
be also used by ReaR (it might be different compared to the one
from a grub RPM package).

rmetrich commented at 2018-12-11 16:03:

@jsmeix can you try if creating the ISO in UEFI without linuxefi works on SuSE? It works on Fedora 27 at least, that's somehow odd.

gozora commented at 2018-12-11 16:08:

I'm starting to be interested in why should Fedora 29 suddenly lack linuxefi.mod.
I'm currently downloading Fedora29 and try to find out ...

V.

gozora commented at 2018-12-11 16:10:

Found this Grub post, which reads excerpt:

linuxefi is not inclluded in upstream GRUB2, it is carried as distribution specific patch.

V.

bojleros commented at 2018-12-11 22:38:

@bojleros You need to install grub2-efi-x64-modules and probably fix the line 53 of /usr/share/rear/lib/uefi-functions.sh to remove the linuxefi module which seems to not exist anymore, ending up with having same line as for slackware.

I have followed your sugestion and also removed multiboot (it was causing the same problems as linuxefi):

# diff uefi-functions.sh /usr/share/rear/lib/uefi-functions.sh
49c49
<     $gmkimage $v -O x86_64-efi -c $TMP_DIR/mnt/EFI/BOOT/embedded_grub.cfg -o $TMP_DIR/mnt/EFI/BOOT/BOOTX64.efi -p "/EFI/BOOT" part_gpt part_msdos fat ext2 normal chain boot configfile linux linuxefi multiboot jfs iso9660 usb usbms usb_keyboard video udf ntfs all_video gzio efi_gop reboot search test echo btrfs
---
>     $gmkimage $v -O x86_64-efi -c $TMP_DIR/mnt/EFI/BOOT/embedded_grub.cfg -o $TMP_DIR/mnt/EFI/BOOT/BOOTX64.efi -p "/EFI/BOOT" part_gpt part_msdos fat ext2 normal chain boot configfile linux jfs iso9660 usb usbms usb_keyboard video udf ntfs all_video gzio efi_gop reboot search test echo btrfs

I can't test this iso on my host right now but i will try this method on test vm and post results.

Thank you all for help !


[Export of Github issue for rear/rear.]